Merge branch 'dev_daiao' into develop
This commit is contained in:
commit
4584276cbd
|
|
@ -1729,7 +1729,7 @@ class UsersController < ApplicationController
|
|||
# end
|
||||
# end
|
||||
@state = false
|
||||
render :layout=>'new_base_user'
|
||||
render :layout => 'edu_new_base_user'
|
||||
end
|
||||
|
||||
#给某人留言
|
||||
|
|
@ -2128,13 +2128,22 @@ class UsersController < ApplicationController
|
|||
@user_fanlist = fan_query.order("#{Watcher.table_name}.id desc").limit(12);
|
||||
@courses = @user.courses.visible.not_deleted_not_end
|
||||
@courses_count = @courses.count
|
||||
@courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc").limit(8)
|
||||
@courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
|
||||
@limit = 8
|
||||
@is_remote = true
|
||||
@courses_pages = Paginator.new @courses_count, @limit, params['page'] || 1
|
||||
@offset ||= @courses_pages.offset
|
||||
@courses = paginateHelper @courses, @limit
|
||||
|
||||
if @user == User.current
|
||||
@shixuns = @user.shixuns
|
||||
else
|
||||
@shixuns = @user.shixuns.where(:authentication => 1)
|
||||
end
|
||||
@shixuns_count = @shixuns.count
|
||||
@shixuns_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1
|
||||
@offset ||= @shixuns_pages.offset
|
||||
@shixuns = paginateHelper @shixuns, @limit
|
||||
# if User.current == @user
|
||||
# # 点击小铃铛,更新点击时间
|
||||
# update_onclick_time if params[:click_user_message] == 'true'
|
||||
|
|
|
|||
|
|
@ -28,7 +28,11 @@
|
|||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "image", "code", "code-block", "|", "table", "watch", "clear"]
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
|
|
@ -50,7 +54,11 @@
|
|||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "image", "code", "code-block", "|", "table", "watch", "clear"]
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
|
|
@ -61,7 +69,6 @@
|
|||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>"//url
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -160,7 +167,7 @@
|
|||
<% end %>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class=" panel-form-label fl"> 知识/技能点:</label>
|
||||
<label class=" panel-form-label fl"> 技能标签:</label>
|
||||
<div class="fl task-bd-grey">
|
||||
<% if params[:action] == "edit" && @challenge_tags.count > 0 %>
|
||||
<% @challenge_tags.each do |tag| %>
|
||||
|
|
@ -315,6 +322,44 @@
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
window.onload = function(){
|
||||
$("#challenge_task_pass [type=\"latex\"]").bind("click", function(){
|
||||
taskpass_editormd.cm.replaceSelection("```latex");
|
||||
taskpass_editormd.cm.replaceSelection("\n");
|
||||
taskpass_editormd.cm.replaceSelection("\n");
|
||||
taskpass_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
|
||||
taskpass_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#challenge_answer [type=\"latex\"]").bind("click", function(){
|
||||
taskanswer_editormd.cm.replaceSelection("```latex");
|
||||
taskanswer_editormd.cm.replaceSelection("\n");
|
||||
taskanswer_editormd.cm.replaceSelection("\n");
|
||||
taskanswer_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = taskanswer_editormd.cm.getDoc().getCursor();
|
||||
taskanswer_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#challenge_task_pass [type=\"inline\"]").bind("click", function(){
|
||||
taskpass_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
|
||||
taskpass_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
taskpass_editormd.cm.focus();
|
||||
});
|
||||
|
||||
$("#challenge_answer [type=\"inline\"]").bind("click", function(){
|
||||
taskanswer_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = taskanswer_editormd.cm.getDoc().getCursor();
|
||||
taskanswer_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
taskanswer_editormd.cm.focus();
|
||||
});
|
||||
$("[type=\"inline\"]").attr("title", "行内公式");
|
||||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
}
|
||||
|
||||
// 设置textarea的宽度到140以后出现滚动条
|
||||
var test_set_inputs = document.getElementsByName("test_set[input][]");
|
||||
var test_set_outputs = document.getElementsByName("test_set[output][]");
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@
|
|||
<div class="clearfix mb20">
|
||||
<h3 class="fl panel-inner-title"><span class="color-red mr10">第<%= @challenge.position %>关</span><%= @challenge.subject %></h3>
|
||||
<p class="fr">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" title="编辑"><i class="fa fa-pencil-square-o color-grey font-16 mr5"></i></a>
|
||||
<!-- <a href="<%#= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" title="编辑"><i class="fa fa-pencil-square-o color-grey font-16 mr5"></i></a>-->
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
|
||||
<!-- <a href="<%#= shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" title="删除" method="delete" ><i class="fa fa-trash-o color-grey font-16 mr5"></i></a>-->
|
||||
<!--<a href="#" title="复制"><i class="fa fa-files-o color-grey font-16 mr5"></i></a>-->
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@
|
|||
latest_output: data.latest_output
|
||||
});
|
||||
$("#game_test_set_results").html(html);
|
||||
$("#blacktab_nav_1").trigger("click");
|
||||
if(data.status == 2){
|
||||
clearInterval(cm);
|
||||
clearInterval(intId);
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@
|
|||
}
|
||||
);
|
||||
$("#game_test_set_results").html(html);
|
||||
$("#blacktab_nav_1").trigger("click");
|
||||
});
|
||||
// 公开的测试集允许展开与隐藏
|
||||
function toggle_test_case(t_case, id){
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<ul class="clearfix inner-footer-nav">
|
||||
<li><a href="<%= home_path %>" class="fl" target="_blank">网站首页</a></li>
|
||||
<li><a href="<%= agreement_path %>" class="fl" target="_blank">服务协议</a></li>
|
||||
<li><%= link_to "支持", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "fl", :target=>"_blank" %></li>
|
||||
<li><a href="<%= forums_path %>" class="fl" target="_blank">社区</a></li>
|
||||
<!-- <li><%#= link_to "支持", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "fl", :target=>"_blank" %></li>
|
||||
<li><a href="<%#= forums_path %>" class="fl" target="_blank">社区</a></li>-->
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div class="fl mt20" style="width:440px;height: 50px">
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@
|
|||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
<a href="javascript:void(0);" class="fr inner-nav-mes" style="color:#fff;">
|
||||
<!-- <a href="javascript:void(0);" class="fr inner-nav-mes" style="color:#fff;">
|
||||
<i class="fa fa-bell fl"></i>
|
||||
<span class="inner-nav-cir fl ml5">12</span>
|
||||
</a>
|
||||
</a>-->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,139 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><%= h html_title %></title>
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/edu-popup','css/edu-common', "css/edu-public",'css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user','css/font-awesome', :media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var onUserCard = false;
|
||||
var onImage = false;
|
||||
$(document).ready(function(){
|
||||
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||
$(".relatePInfo").css("display","block");
|
||||
});
|
||||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
});
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
})
|
||||
$(".coursesLineGrey").mouseout(function(){
|
||||
$(this).css("color","#808080");
|
||||
});
|
||||
|
||||
//侧导航栏配置设置
|
||||
$(".homepageLeftMenuCoursesLine").mouseover(function(){
|
||||
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -82px -399px no-repeat");
|
||||
$(this).children().css("color","#ffffff");
|
||||
});
|
||||
$(".homepageLeftMenuCoursesLine").mouseout(function(){
|
||||
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -6px -354px no-repeat");
|
||||
$(this).children().css("color","#808080");
|
||||
});
|
||||
$(".subNavRow").mouseover(function(){
|
||||
$(this).css("background-color","#269ac9");
|
||||
$(this).children().css("color","#ffffff");
|
||||
});
|
||||
$(".subNavRow").mouseout(function(){
|
||||
$(this).css("background-color","#ffffff");
|
||||
$(this).children().css("color","#888888");
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body onload="prettyPrint();">
|
||||
<div class="newContainer"> <!-- 页面全部内容 -->
|
||||
<div class="newHeader">
|
||||
<% is_current_user = User.current.logged? && User.current == @user %>
|
||||
<% if User.current.logged? %>
|
||||
<%= render :partial => 'layouts/logined_header' %>
|
||||
<% else%>
|
||||
<%= render :partial => 'layouts/unlogin_header' %>
|
||||
<% end%>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="newMain clearfix"> <!-- 主题部分 -->
|
||||
<div class="cl"></div>
|
||||
<div class="eduHomepageRight">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'layouts/footer' %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
|
||||
<%= render :partial => 'layouts/upload_avatar', :locals => {:source => @user} %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#user_hide_project').hide();
|
||||
autoUrl("user_brief_introduction_show");
|
||||
if(<%= @is_course == 1 %>) {
|
||||
$("#user_course_list").addClass('active');
|
||||
} else if(<%= @is_project == 1 %>) {
|
||||
$("#user_project_list").addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
$("#courseMenu").mouseenter(function(){
|
||||
$("#topnav_course_menu").show();
|
||||
});
|
||||
$("#courseMenu").mouseleave(function(){
|
||||
$("#topnav_course_menu").hide();
|
||||
});
|
||||
$("#projectMenu").mouseenter(function(){
|
||||
$("#topnav_project_menu").show();
|
||||
});
|
||||
$("#projectMenu").mouseleave(function(){
|
||||
$("#topnav_project_menu").hide();
|
||||
});
|
||||
// 如果是强制修改资料页面,则除退出按钮外,其他按钮的连接都失效
|
||||
<% if @force %>
|
||||
// 禁用所有a标签
|
||||
var t = document.getElementsByTagName("a");
|
||||
len = t.length;
|
||||
for(var i=0;i<len;i++){
|
||||
t[i].href = 'javascript:void(0)';
|
||||
// 火狐浏览器点击弹开空白页
|
||||
t[i].target = '_self';
|
||||
}
|
||||
// 退出按钮可用
|
||||
var d = document.getElementById("logout_trustie");
|
||||
d.href='<%= logout_url_without_domain %>';
|
||||
// 提问按钮不可用
|
||||
document.getElementById('inquiry_question').onclick = function (){return false;};
|
||||
<% end %>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -77,198 +77,200 @@
|
|||
<div class="homepageContentContainer">
|
||||
<!--div class="homepageRightBannerImg"></div-->
|
||||
<div class="cl"></div>
|
||||
<div class="homepageContent">
|
||||
<div class="homepageLeft mt10" id="LSide">
|
||||
<div class="home-user-new-img mb10">
|
||||
<% if User.current.logged? && User.current == @user %>
|
||||
<% if params[:action] != "user_newfeedback" %>
|
||||
<div class="homepageContent">
|
||||
<div class="homepageLeft mt10" id="LSide">
|
||||
<div class="home-user-new-img mb10">
|
||||
<% if User.current.logged? && User.current == @user %>
|
||||
<%= link_to image_tag(url_to_avatar(@user),width:"238", height: "200", :id => 'nh_source_tx'),
|
||||
my_clear_user_avatar_temp_path, :remote => true %>
|
||||
<% else %>
|
||||
<% else %>
|
||||
<%=image_tag(url_to_avatar(@user),width:"238", height: "200", :id=>'nh_source_tx') %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="home-user-newinfo-box mb10">
|
||||
<h3 class="mb5 fontGrey3 break_full_word">
|
||||
<%= link_to @user.show_name, user_path(@user), :class => "mb5 fontGrey3" %>
|
||||
<% if @user.user_extensions && @user.user_extensions.identity %>
|
||||
(<%= get_user_roll @user %>)
|
||||
<% end%>
|
||||
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
|
||||
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female fr' : 'user_leftinfo_male fr' %> "></span>
|
||||
<% end %>
|
||||
</h3>
|
||||
<h4 class="fontGrey2 mb5"><%= @user.login %></h4>
|
||||
<p class="fontGrey2">
|
||||
<% if !@user.user_extensions.school_id.blank? %>
|
||||
<%= @user.user_extensions.school.name %>
|
||||
<% end %>
|
||||
</p>
|
||||
<span class="border-line mt10 mb10"></span>
|
||||
<ul class="home-user-newinfo-ul ">
|
||||
<li class="clear">
|
||||
<a href="<%= user_blogs_path(:user_id => @user) %>" class="fl linkGrey7 f14">博客</a>
|
||||
<span class="issues_nav_tag fr"><%= @user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<a href="<%= user_watchlist_user_path(@user) %>" class="fl linkGrey7 f14" >关注</a>
|
||||
<span class="issues_nav_tag fr" id="user_watchers_number"><%= User.watched_by(@user).count %></span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<a href="<%= user_fanslist_user_path(@user) %>" class="fl linkGrey7 f14">粉丝</a>
|
||||
<span class="issues_nav_tag fr" id="user_fans_number"><%= @user.watcher_users.count %></span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear">
|
||||
<% if User.current.logged?%>
|
||||
<% if User.current == @user %>
|
||||
<%= link_to '个人主页', homepage_user_path(@user), :class => "home-big-btn-grey", :target => '_blank' %>
|
||||
<% else %>
|
||||
<% if(@user.watched_by?(User.current)) %>
|
||||
<%= link_to "取消关注",
|
||||
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
|
||||
:class => "home-btn-grey fl mr12",
|
||||
:method => "delete",
|
||||
:remote => "true",
|
||||
:title => "取消关注" %>
|
||||
<% else %>
|
||||
<%= link_to "添加关注",
|
||||
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
|
||||
:class => "home-btn-grey fl mr12",
|
||||
:method => "post",
|
||||
:remote => "true",
|
||||
:title => "添加关注" %>
|
||||
<% end %>
|
||||
<% if @user.base_homepage.nil? %>
|
||||
<a href="javascript:void(0)" class ="home-btn-grey fl" title="该用户暂未设置主页">TA的主页</a>
|
||||
<% else %>
|
||||
<%= link_to "TA的主页", homepage_user_path(@user.login), :class => 'home-btn-grey fl', :target => '_blank' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% if is_current_user %>
|
||||
<% if hidden_unproject_infos && user_course_count > 0 %>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >
|
||||
<%= link_to "课程社区", user_course_community_path(User.current), :class => "fl" , :target => "_blank", :style => "color:#666" %>
|
||||
</h3>
|
||||
<%# if hidden_unproject_infos %>
|
||||
<ul>
|
||||
<li class="home-user-leftnav-li icons-class clear">
|
||||
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top: 9px;font-size: 11px;background-color:#f5f2f2;color:#666;'>#{user_course_count}</span>".html_safe : "课程",
|
||||
user_course_community_path(User.current), :id => "user_course_list", :target => "_blank" %>
|
||||
</li>
|
||||
<% if user_manage_homework_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-homework clear">
|
||||
<%= link_to user_manage_homework_count > 0 ? "我发布的作业<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_manage_homework_count}</span>".html_safe : "我发布的作业",
|
||||
user_manage_homeworks_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if user_receive_homework_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-homework clear">
|
||||
<%= link_to "我收到的作业<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_receive_homework_count}</span>".html_safe,
|
||||
user_receive_homeworks_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="home-user-leftnav-li icons-doc clear">
|
||||
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :class => "fl", :style => "color:#666" %>
|
||||
</li>
|
||||
<li class="home-user-leftnav-li icons-download clear">
|
||||
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank", :class => "fl", :style => "color:#666" %>
|
||||
</li>
|
||||
</ul>
|
||||
<%# end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if user_project_count > 0%>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >
|
||||
<%= link_to "项目社区", user_project_community_path(User.current), :class => "fl", :target => "_blank", :style => "color:#666" %>
|
||||
</h3>
|
||||
<ul>
|
||||
<li class="home-user-leftnav-li icons-project clear">
|
||||
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_project_count}</span>".html_safe : "项目",
|
||||
user_project_community_path(User.current), :id => 'user_project_list', :target => "_blank" %>
|
||||
</li>
|
||||
<% if issues_author_is_self_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-issue clear">
|
||||
<%= link_to issues_author_is_self_count > 0 ? "我发布的issue<span class='issues_nav_tag mr10 fr'style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:##666;'>#{issues_author_is_self_count}</span>".html_safe : "我发布的issue",
|
||||
user_manage_issues_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if issues_assigned_is_self_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-issue clear">
|
||||
<%= link_to issues_assigned_is_self_count > 0 ? "我收到的issue<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{issues_assigned_is_self_count}</span>".html_safe : "我收到的issue",
|
||||
user_receive_issues_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if hidden_unproject_infos && user_contest_count > 0 %>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >
|
||||
<%= link_to "竞赛社区", user_contest_community_path(User.current), :class => "fl" , :target => "_blank"%>
|
||||
</h3>
|
||||
<ul>
|
||||
<li class="home-user-leftnav-li icons-contest clear">
|
||||
<%= link_to user_contest_count > 0 ? "竞赛<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top: 9px;'>#{user_contest_count}</span>".html_safe : "竞赛",
|
||||
user_contest_community_path(User.current), :id => "user_contest_list", :target => "_blank" %>
|
||||
</li>
|
||||
</ul>
|
||||
<%# end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >Ta在确实
|
||||
<span class="fr mr5" style="font-size:12px;color: #7f7f7f;"><%= time_tag(@user.created_on).html_safe %></span>
|
||||
</h3>
|
||||
<ul>
|
||||
<% if hidden_unproject_infos && user_course_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-class clear">
|
||||
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_course_count}</span>".html_safe : "课程",
|
||||
user_course_community_path(@user), :id => "user_course_list", :class => "fl", :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if user_project_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-project clear">
|
||||
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_project_count}</span>".html_safe : "项目",
|
||||
user_project_community_path(@user), :id => 'user_project_list', :class => "fl", :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if hidden_unproject_infos && user_contest_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-project clear">
|
||||
<%= link_to user_contest_count > 0 ? "竞赛<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_contest_count}</span>".html_safe : "竞赛",
|
||||
user_contest_community_path(@user), :id => 'user_contest_list', :class => "fl", :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="home-user-newinfo-box mb10">
|
||||
<h3 class="mb5 fontGrey3 break_full_word">
|
||||
<%= link_to @user.show_name, user_path(@user), :class => "mb5 fontGrey3" %>
|
||||
<% if @user.user_extensions && @user.user_extensions.identity %>
|
||||
(<%= get_user_roll @user %>)
|
||||
<% end%>
|
||||
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
|
||||
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female fr' : 'user_leftinfo_male fr' %> "></span>
|
||||
<% end %>
|
||||
</h3>
|
||||
<h4 class="fontGrey2 mb5"><%= @user.login %></h4>
|
||||
<p class="fontGrey2">
|
||||
<% if !@user.user_extensions.school_id.blank? %>
|
||||
<%= @user.user_extensions.school.name %>
|
||||
<% end %>
|
||||
</p>
|
||||
<span class="border-line mt10 mb10"></span>
|
||||
<ul class="home-user-newinfo-ul ">
|
||||
<li class="clear">
|
||||
<a href="<%= user_blogs_path(:user_id => @user) %>" class="fl linkGrey7 f14">博客</a>
|
||||
<span class="issues_nav_tag fr"><%= @user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<a href="<%= user_watchlist_user_path(@user) %>" class="fl linkGrey7 f14" >关注</a>
|
||||
<span class="issues_nav_tag fr" id="user_watchers_number"><%= User.watched_by(@user).count %></span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<a href="<%= user_fanslist_user_path(@user) %>" class="fl linkGrey7 f14">粉丝</a>
|
||||
<span class="issues_nav_tag fr" id="user_fans_number"><%= @user.watcher_users.count %></span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear">
|
||||
<% if User.current.logged?%>
|
||||
<% if User.current == @user %>
|
||||
<%= link_to '个人主页', homepage_user_path(@user), :class => "home-big-btn-grey", :target => '_blank' %>
|
||||
<% else %>
|
||||
<% if(@user.watched_by?(User.current)) %>
|
||||
<%= link_to "取消关注",
|
||||
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
|
||||
:class => "home-btn-grey fl mr12",
|
||||
:method => "delete",
|
||||
:remote => "true",
|
||||
:title => "取消关注" %>
|
||||
<% else %>
|
||||
<%= link_to "添加关注",
|
||||
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
|
||||
:class => "home-btn-grey fl mr12",
|
||||
:method => "post",
|
||||
:remote => "true",
|
||||
:title => "添加关注" %>
|
||||
<% end %>
|
||||
<% if @user.base_homepage.nil? %>
|
||||
<a href="javascript:void(0)" class ="home-btn-grey fl" title="该用户暂未设置主页">TA的主页</a>
|
||||
<% else %>
|
||||
<%= link_to "TA的主页", homepage_user_path(@user.login), :class => 'home-btn-grey fl', :target => '_blank' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="user_leftnav ">
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_10" class="user_icons_mes">
|
||||
<%= link_to "留言", feedback_path(@user, :host=> Setting.host_user)%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% if is_current_user %>
|
||||
<% if hidden_unproject_infos && user_course_count > 0 %>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >
|
||||
<%= link_to "课程社区", user_course_community_path(User.current), :class => "fl" , :target => "_blank", :style => "color:#666" %>
|
||||
</h3>
|
||||
<%# if hidden_unproject_infos %>
|
||||
<ul>
|
||||
<li class="home-user-leftnav-li icons-class clear">
|
||||
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top: 9px;font-size: 11px;background-color:#f5f2f2;color:#666;'>#{user_course_count}</span>".html_safe : "课程",
|
||||
user_course_community_path(User.current), :id => "user_course_list", :target => "_blank" %>
|
||||
</li>
|
||||
<% if user_manage_homework_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-homework clear">
|
||||
<%= link_to user_manage_homework_count > 0 ? "我发布的作业<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_manage_homework_count}</span>".html_safe : "我发布的作业",
|
||||
user_manage_homeworks_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if user_receive_homework_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-homework clear">
|
||||
<%= link_to "我收到的作业<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_receive_homework_count}</span>".html_safe,
|
||||
user_receive_homeworks_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="home-user-leftnav-li icons-doc clear">
|
||||
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :class => "fl", :style => "color:#666" %>
|
||||
</li>
|
||||
<li class="home-user-leftnav-li icons-download clear">
|
||||
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank", :class => "fl", :style => "color:#666" %>
|
||||
</li>
|
||||
</ul>
|
||||
<%# end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if user_project_count > 0%>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >
|
||||
<%= link_to "项目社区", user_project_community_path(User.current), :class => "fl", :target => "_blank", :style => "color:#666" %>
|
||||
</h3>
|
||||
<ul>
|
||||
<li class="home-user-leftnav-li icons-project clear">
|
||||
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_project_count}</span>".html_safe : "项目",
|
||||
user_project_community_path(User.current), :id => 'user_project_list', :target => "_blank" %>
|
||||
</li>
|
||||
<% if issues_author_is_self_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-issue clear">
|
||||
<%= link_to issues_author_is_self_count > 0 ? "我发布的issue<span class='issues_nav_tag mr10 fr'style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:##666;'>#{issues_author_is_self_count}</span>".html_safe : "我发布的issue",
|
||||
user_manage_issues_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if issues_assigned_is_self_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-issue clear">
|
||||
<%= link_to issues_assigned_is_self_count > 0 ? "我收到的issue<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{issues_assigned_is_self_count}</span>".html_safe : "我收到的issue",
|
||||
user_receive_issues_user_path(@user), :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if hidden_unproject_infos && user_contest_count > 0 %>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >
|
||||
<%= link_to "竞赛社区", user_contest_community_path(User.current), :class => "fl" , :target => "_blank"%>
|
||||
</h3>
|
||||
<ul>
|
||||
<li class="home-user-leftnav-li icons-contest clear">
|
||||
<%= link_to user_contest_count > 0 ? "竞赛<span class='issues_nav_tag mr10 fr' style='line-height:18px;margin-top: 9px;'>#{user_contest_count}</span>".html_safe : "竞赛",
|
||||
user_contest_community_path(User.current), :id => "user_contest_list", :target => "_blank" %>
|
||||
</li>
|
||||
</ul>
|
||||
<%# end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="home-user-leftnav">
|
||||
<h3 >Ta在确实
|
||||
<span class="fr mr5" style="font-size:12px;color: #7f7f7f;"><%= time_tag(@user.created_on).html_safe %></span>
|
||||
</h3>
|
||||
<ul>
|
||||
<% if hidden_unproject_infos && user_course_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-class clear">
|
||||
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_course_count}</span>".html_safe : "课程",
|
||||
user_course_community_path(@user), :id => "user_course_list", :class => "fl", :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if user_project_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-project clear">
|
||||
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_project_count}</span>".html_safe : "项目",
|
||||
user_project_community_path(@user), :id => 'user_project_list', :class => "fl", :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if hidden_unproject_infos && user_contest_count > 0 %>
|
||||
<li class="home-user-leftnav-li icons-project clear">
|
||||
<%= link_to user_contest_count > 0 ? "竞赛<span class='issues_nav_tag ml140' style='line-height:18px;margin-top:9px;font-size:11px;background-color:#f5f2f2;color:#666;'>#{user_contest_count}</span>".html_safe : "竞赛",
|
||||
user_contest_community_path(@user), :id => 'user_contest_list', :class => "fl", :target => "_blank" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="user_leftnav ">
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_10" class="user_icons_mes">
|
||||
<%= link_to "留言", feedback_path(@user, :host=> Setting.host_user)%>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @user %>
|
||||
<div class="">
|
||||
<ul class="home-user-footerinfo">
|
||||
<% unless @user.user_extensions.location.blank? %>
|
||||
<li><i class="icon-map-marker mr5 ml10 f14"></i>
|
||||
<span><%= @user.user_extensions.location %>-<%= @user.user_extensions.location_city %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><i class="icon-time mr5 ml10 f14"></i><span><%= @user.created_on.strftime('%Y-%m-%d') %>开始使用</span></li>
|
||||
<li style="color:#b3b3b3"><i class="icon-eye-open mr5 ml10 f14"></i><span><%= @user.visits.to_i %>次访问(自2016年5月)</span></li>
|
||||
</ul>
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @user %>
|
||||
<div class="">
|
||||
<ul class="home-user-footerinfo">
|
||||
<% unless @user.user_extensions.location.blank? %>
|
||||
<li><i class="icon-map-marker mr5 ml10 f14"></i>
|
||||
<span><%= @user.user_extensions.location %>-<%= @user.user_extensions.location_city %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><i class="icon-time mr5 ml10 f14"></i><span><%= @user.created_on.strftime('%Y-%m-%d') %>开始使用</span></li>
|
||||
<li style="color:#b3b3b3"><i class="icon-eye-open mr5 ml10 f14"></i><span><%= @user.visits.to_i %>次访问(自2016年5月)</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="homepageRight">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@
|
|||
<% end %>
|
||||
|
||||
<% memo = Memo.where(:id => 1232).first %>
|
||||
<% unless memo.nil? %>
|
||||
<a href="<%= Setting.protocol + "://" %><%=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2" target="_blank">如何提交代码</a>
|
||||
<% end %>
|
||||
<%# unless memo.nil? %>
|
||||
<!-- <a href="<%#= Setting.protocol + "://" %><%#=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2" target="_blank">如何提交代码</a>-->
|
||||
<%# end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,12 @@
|
|||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "image", "code", "code-block", "|", "table", "watch", "clear"]
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
|
|
@ -81,7 +86,11 @@
|
|||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "image", "code", "code-block", "|", "table", "watch", "clear"]
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
|
|
@ -119,4 +128,41 @@
|
|||
$("#new_shixun").submit();
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = function(){
|
||||
$("#shixun_introduction [type=\"latex\"]").bind("click", function(){
|
||||
shixun_editormd.cm.replaceSelection("```latex");
|
||||
shixun_editormd.cm.replaceSelection("\n");
|
||||
shixun_editormd.cm.replaceSelection("\n");
|
||||
shixun_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = shixun_editormd.cm.getDoc().getCursor();
|
||||
shixun_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#shixun_propaedeutics [type=\"latex\"]").bind("click", function(){
|
||||
shixun_propaedeutics.cm.replaceSelection("```latex");
|
||||
shixun_propaedeutics.cm.replaceSelection("\n");
|
||||
shixun_propaedeutics.cm.replaceSelection("\n");
|
||||
shixun_propaedeutics.cm.replaceSelection("```");
|
||||
var __Cursor = shixun_propaedeutics.cm.getDoc().getCursor();
|
||||
shixun_propaedeutics.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#shixun_introduction [type=\"inline\"]").bind("click", function(){
|
||||
shixun_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = shixun_editormd.cm.getDoc().getCursor();
|
||||
shixun_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
shixun_editormd.cm.focus();
|
||||
});
|
||||
|
||||
$("#shixun_propaedeutics [type=\"inline\"]").bind("click", function(){
|
||||
shixun_propaedeutics.cm.replaceSelection("$$$$");
|
||||
var __Cursor = shixun_propaedeutics.cm.getDoc().getCursor();
|
||||
shixun_propaedeutics.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
shixun_propaedeutics.cm.focus();
|
||||
});
|
||||
$("[type=\"inline\"]").attr("title", "行内公式");
|
||||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
@ -64,7 +64,11 @@
|
|||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "image", "code", "code-block", "|", "table", "watch", "clear"]
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
|
|
@ -87,7 +91,11 @@
|
|||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "image", "code", "code-block", "|", "table", "watch", "clear"]
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
|
|
@ -99,4 +107,41 @@
|
|||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>" //url
|
||||
});
|
||||
|
||||
window.onload = function(){
|
||||
$("#setting_introduction [type=\"latex\"]").bind("click", function(){
|
||||
setting_editormd.cm.replaceSelection("```latex");
|
||||
setting_editormd.cm.replaceSelection("\n");
|
||||
setting_editormd.cm.replaceSelection("\n");
|
||||
setting_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = setting_editormd.cm.getDoc().getCursor();
|
||||
setting_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#setting_propaedeutics [type=\"latex\"]").bind("click", function(){
|
||||
p_editormd.cm.replaceSelection("```latex");
|
||||
p_editormd.cm.replaceSelection("\n");
|
||||
p_editormd.cm.replaceSelection("\n");
|
||||
p_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = p_editormd.cm.getDoc().getCursor();
|
||||
p_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#setting_introduction [type=\"inline\"]").bind("click", function(){
|
||||
setting_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = setting_editormd.cm.getDoc().getCursor();
|
||||
setting_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
setting_editormd.cm.focus();
|
||||
});
|
||||
|
||||
$("#setting_propaedeutics [type=\"inline\"]").bind("click", function(){
|
||||
p_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = p_editormd.cm.getDoc().getCursor();
|
||||
p_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
p_editormd.cm.focus();
|
||||
});
|
||||
$("[type=\"inline\"]").attr("title", "行内公式");
|
||||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
</div>
|
||||
<% else %>
|
||||
<% @shixuns.each do |shixun| %>
|
||||
<div class="task-index-list-box fl ">
|
||||
<div class="task-index-list-box-top">
|
||||
<div class="task-index-list-box fl">
|
||||
<div class="task-index-list-box-top" onclick="shixun_link('<%= shixun.identifier %>')" style="cursor: pointer;">
|
||||
<p class="task-index-list-title two_lines_show">
|
||||
<%= link_to shixun.name, shixun_path(shixun), :target => "_blank" %>
|
||||
<%= link_to shixun.name, "javascrip:void(0);" %>
|
||||
</p>
|
||||
<div class=" clearfix task-index-list-user">
|
||||
<%= link_to image_tag(url_to_avatar(shixun.owner), :width =>"60", :height => "60", :class => "panel-warp-img mr10 fl", :alt=>"头像"), user_path(shixun.owner), :target => "_blank" %>
|
||||
<%= link_to shixun.owner.try(:show_name), user_path(shixun.owner), :class => "task-index-name task-hide fl", :target => "_blank" %>
|
||||
<%= link_to image_tag(url_to_avatar(shixun.owner), :width =>"60", :height => "60", :class => "panel-warp-img mr10 fl", :alt=>"头像"), "javascrip:void(0);" %>
|
||||
<%= link_to shixun.owner.try(:show_name), "javascrip:void(0);" , :class => "task-index-name task-hide fl", :target => "_blank" %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="mt10 mb10"><%= shixun.language == "JDBC" ? "Java/SQL" : shixun.language %></span>
|
||||
|
|
@ -33,4 +33,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
function shixun_link(shixun){
|
||||
console.log(shixun);
|
||||
window.open('/shixuns/' + shixun);
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
|
||||
<%= javascript_include_tag '/editormd/editormd.min.js' %>
|
||||
|
||||
<div class="btns">
|
||||
<button id="insert-inline-code">Insert Inline code</button>
|
||||
</div>
|
||||
<div class="task-pm-content" >
|
||||
<p class="mb10 mt10"><i class="fa fa-map-marker mr5 color-grey" ></i>
|
||||
<a href="<%= user_path(User.current) %>"><%= User.current.show_name %></a> > <a href="<%= shixuns_path %>">项目实训</a> > 新建实训
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ $("#shixuns_index_status_2").attr('href','<%= search_shixuns_path(:status => 2,
|
|||
$("#shixuns_index_status_3").attr('href','<%= search_shixuns_path(:status => 3, :language => @language, :search => @search, :order => @order) %>');
|
||||
$("#shixuns_index_status_4").attr('href','<%= search_shixuns_path(:status => 4, :language => @language, :search => @search, :order => @order) %>');
|
||||
$("#shixuns_index_status_5").attr('href','<%= search_shixuns_path(:status => 5, :language => @language, :search => @search, :order => @order) %>');
|
||||
$("#add_collaborators_form").attr('action','<%= search_shixuns_path(:status => @status, :language => @language, :search => @search, :order => @order) %>');
|
||||
$("#add_collaborators_form").attr('action','<%= search_shixuns_path(:status => @status, :language => @language, :order => @order) %>');
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
<% if !courses.blank? %>
|
||||
<% courses.each_with_index do |course, i| %>
|
||||
<% allow_visit = course.is_delete == 0 && (User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1) %>
|
||||
<li class="clearfix">
|
||||
<span class="span4 fl ">
|
||||
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" onclick="<%= allow_visit ? '' : 'notice_sure_box(\'你不是该私有班级的成员,不能访问\')' %>" class="fl mr5" target="<%= allow_visit ? '_blank' : "" %>"><%= course.name %></a>
|
||||
<% if course.is_public == 0 %>
|
||||
<a href="javascript:void(0);" class="fa fa-lock fl" style="padding-top:18px;color:#ccc;" aria-hidden="true"></a>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="span5 fl font-12"><a href="<%= user_path(course.teacher) %>" class="color-grey"><%= course.teacher.show_name %></a></span>
|
||||
<span class="fl font-12"><i><%= format_date Time.at(course.updatetime) %></i>更新</span>
|
||||
<li class=" clearfix edu-class-con-list">
|
||||
<div class="fl task-form-90 ">
|
||||
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" onclick="<%= allow_visit ? '' : 'notice_sure_box(\'你不是该私有班级的成员,不能访问\')' %>" class="edu-class-inner-list fl ml30 font-14 color-grey"><%= course.name %></a>
|
||||
<% if course.is_public == 0 %>
|
||||
<i class="fa fa-lock fl color-grey font-16 mt5 ml10"></i>
|
||||
<% end %>
|
||||
<span class="fr font-12 color-grey"><%= format_date Time.at(course.updatetime) %> 更新</span>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
@ -1,43 +1,52 @@
|
|||
<% if @join_syllabuses.count > 0 %>
|
||||
<% @join_syllabuses.each_with_index do |syllabus, index|%>
|
||||
<% course_count = @status == 1 ? syllabus.courses.where("is_delete = 0 and is_end = 0").count : syllabus.courses.where("is_delete = 0 and is_end = 1").count %>
|
||||
<% if !(@status == 2 && course_count == 0) %>
|
||||
<div class="sub-con color-grey">
|
||||
<div class="head-top">
|
||||
<span class="count">
|
||||
<i class="fa fa-plus-square color-blue font-20 add" aria-hidden="true"></i>
|
||||
<i class="fa fa-minus-square color-blue font-20 cut" aria-hidden="true" style="display:none;"></i>
|
||||
</span>
|
||||
<span class="span1 ">
|
||||
<a href="<%= syllabus_path(syllabus.id) %>" class="ml6 mr10" target="_blank"><%= syllabus.title %></a>
|
||||
<% if course_count > 0 %>
|
||||
<em class="font-12"><%= course_count %></em>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="span2 font-12"><a href="<%= user_path(syllabus.user) %>" class="color-grey" target="_blank"><%= syllabus.user.show_name %></a></span>
|
||||
<span class="span3 pl5 font-12"><i><%=format_date syllabus.updated_at %></i>更新</span>
|
||||
<span><i class="fa fa-ellipsis-v operate padding15" aria-hidden="true"></i></span>
|
||||
<ul class="handle">
|
||||
<span><%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :target => '_blank', :title => "新建班级"%></span>
|
||||
<span><%= link_to '查看课程', syllabus_path(syllabus.id), :target =>'_blank', :title => '查看课程' %></span>
|
||||
<span>
|
||||
<% @join_syllabuses.each_with_index do |syllabus, index|%>
|
||||
<% course_count = @status == 1 ? syllabus.courses.where("is_delete = 0 and is_end = 0").count : syllabus.courses.where("is_delete = 0 and is_end = 1").count %>
|
||||
<% if !(@status == 2 && course_count == 0) %>
|
||||
<div class="clearfix edu-class-con-list padding15">
|
||||
<div class="fl task-form-90">
|
||||
<a href="javascript:void(0)" class="edu-class-inner-list fl color-blue" id="join_syllabus_list_<%= index %>"><i class="fa fa-plus-circle color-blue mr10"></i><%= syllabus.title %></a>
|
||||
<span class="fr font-12 color-grey mt3"><%=format_date syllabus.updated_at %> 更新</span>
|
||||
</div>
|
||||
<script>
|
||||
$("#join_syllabus_list_<%= index %>").click(function(e){
|
||||
$t = $(e.target);
|
||||
if($t.is('a')){
|
||||
window.open("<%= syllabus_path(syllabus.id) %>");
|
||||
}else if($t.is('i')){
|
||||
if($t.hasClass("fa-minus-circle")){
|
||||
$t.removeClass("fa-minus-circle");
|
||||
$t.addClass("fa-plus-circle");
|
||||
}else{
|
||||
$t.addClass("fa-minus-circle");
|
||||
$t.removeClass("fa-plus-circle");
|
||||
}
|
||||
$("#join_syllabus_course_list_<%= index %>").toggle();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<div class="fr edu-position edu-position-hidebox mr5 mt10">
|
||||
<a href="#"><i class="fa fa-bars font-16"></i></a>
|
||||
<ul class="edu-position-hide undis">
|
||||
<li><%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :target => '_blank', :title => "新建班级"%></li>
|
||||
<li><%= link_to '查看课程', syllabus_path(syllabus.id), :target =>'_blank', :title => '查看课程' %></li>
|
||||
<li>
|
||||
<% if User.current == syllabus.user || User.current.admin? %>
|
||||
<%= link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :remote => 'true' %>
|
||||
<%= link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :remote => 'true' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="edu-class-list-inner none" id="join_syllabus_course_list_<%= index %>">
|
||||
<% if @status == 1 %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% else %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% end %>
|
||||
<%= render :partial => 'syllabuses/courses_list', :locals => { :courses => courses, :syllabus => syllabus} %>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="mr20 ml30">
|
||||
<% if @status == 1 %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% else %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% end %>
|
||||
<%= render :partial => 'syllabuses/courses_list', :locals => { :courses => courses, :syllabus => syllabus} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render :partial => 'welcome/no_data' %>
|
||||
<% end %>
|
||||
<%= render :partial => 'welcome/no_data' %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,43 +1,52 @@
|
|||
<% if @my_syllabuses.count > 0 %>
|
||||
<% @my_syllabuses.each_with_index do |syllabus, index|%>
|
||||
<% course_count = @status == 1 ? syllabus.courses.where("is_delete = 0 and is_end = 0").count : syllabus.courses.where("is_delete = 0 and is_end = 1").count %>
|
||||
<% if !(@status == 2 && course_count == 0) %>
|
||||
<div class="sub-con color-grey">
|
||||
<div class="head-top">
|
||||
<span class="count">
|
||||
<i class="fa fa-plus-square color-blue font-20 add" aria-hidden="true"></i>
|
||||
<i class="fa fa-minus-square color-blue font-20 cut" aria-hidden="true" style="display:none;"></i>
|
||||
</span>
|
||||
<span class="span1">
|
||||
<a href="<%= syllabus_path(syllabus.id) %>" class="ml6 mr10" target="_blank"><%= syllabus.title %></a>
|
||||
<% if course_count > 0 %>
|
||||
<em class="font-12"><%= course_count %></em>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="span2 font-12"><a href="<%= user_path(syllabus.user) %>" class="color-grey" target="_blank"><%= syllabus.user.show_name %></a></span>
|
||||
<span class="span3 pl5 font-12 "><i><%=format_date syllabus.updated_at %></i>更新</span>
|
||||
<span><i class="fa fa-ellipsis-v operate padding15" aria-hidden="true"></i></span>
|
||||
<ul class="handle">
|
||||
<span><%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :target => '_blank', :title => "新建班级"%></span>
|
||||
<span><%= link_to '查看课程', syllabus_path(syllabus.id), :target =>'_blank', :title => '查看课程' %></span>
|
||||
<span>
|
||||
<% @my_syllabuses.each_with_index do |syllabus, index|%>
|
||||
<% course_count = @status == 1 ? syllabus.courses.where("is_delete = 0 and is_end = 0").count : syllabus.courses.where("is_delete = 0 and is_end = 1").count %>
|
||||
<% if !(@status == 2 && course_count == 0) %>
|
||||
<div class="clearfix edu-class-con-list padding15">
|
||||
<div class="fl task-form-90">
|
||||
<a href="javascript:void(0)" class="edu-class-inner-list fl color-blue" id="syllabus_list_<%= index %>" ><i class="fa fa-plus-circle color-blue mr10"></i><%= syllabus.title %></a>
|
||||
<span class="fr font-12 color-grey mt3"><%=format_date syllabus.updated_at %> 更新</span>
|
||||
</div>
|
||||
<script>
|
||||
$("#syllabus_list_<%= index %>").click(function(e){
|
||||
$t = $(e.target);
|
||||
if($t.is('a')){
|
||||
window.open("<%= syllabus_path(syllabus.id) %>");
|
||||
}else if($t.is('i')){
|
||||
if($t.hasClass("fa-minus-circle")){
|
||||
$t.removeClass("fa-minus-circle");
|
||||
$t.addClass("fa-plus-circle");
|
||||
}else{
|
||||
$t.addClass("fa-minus-circle");
|
||||
$t.removeClass("fa-plus-circle");
|
||||
}
|
||||
$("#syllabus_course_list_<%= index %>").toggle();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<div class="fr edu-position edu-position-hidebox mr5 mt10">
|
||||
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
|
||||
<ul class="edu-position-hide undis">
|
||||
<li><%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :target => '_blank', :title => "新建班级"%></li>
|
||||
<li><%= link_to '查看课程', syllabus_path(syllabus.id), :target =>'_blank', :title => '查看课程' %></li>
|
||||
<li>
|
||||
<% if User.current == syllabus.user || User.current.admin? %>
|
||||
<%= link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :remote => 'true' %>
|
||||
<%= link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :remote => 'true' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="edu-class-list-inner none" id="syllabus_course_list_<%= index %>">
|
||||
<% if @status == 1 %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% else %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% end %>
|
||||
<%= render :partial => 'syllabuses/courses_list', :locals => { :courses => courses, :syllabus => syllabus} %>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="mr20 ml30">
|
||||
<% if @status == 1 %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% else %>
|
||||
<% courses = syllabus.courses.where("is_delete = 0 and is_end = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<% end %>
|
||||
<%= render :partial => 'syllabuses/courses_list', :locals => { :courses => courses, :syllabus => syllabus} %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render :partial => 'welcome/no_data' %>
|
||||
<% end %>
|
||||
|
|
@ -1,98 +1,64 @@
|
|||
<div class="more" style="margin-top:0px; margin-bottom:20px;">
|
||||
<p class="head font-14">
|
||||
<span class="fl">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
<a href="<%= user_path(User.current) %>"><%= User.current.show_name %></a> >
|
||||
<a href="<%= courses_path() %>">智能课堂</a>>
|
||||
<a href="javascript:void(0);">我的课堂</a>
|
||||
</span>
|
||||
<!-- <span class="fr font-12" style="color:#ccc;">
|
||||
<i class="fa fa-eye" aria-hidden="true" style="color:#ddd;"></i>
|
||||
<em>2625</em> 次访问
|
||||
</span>-->
|
||||
</p>
|
||||
<div class="edu-class-container" >
|
||||
<p class="mb10"><i class="fa fa-map-marker mr5 color-grey" ></i><a href="#">胡莎莎 </a> > <a href="#">项目实训 </a> > 我的实训 </p>
|
||||
<div class="edu-con-bg01 edu-bg-shadow">
|
||||
<div class="">
|
||||
<div class="edu-tab clearfix mb20">
|
||||
<ul id="edu-tab-nav">
|
||||
<li id="edu-tab-nav-1" class="edu-new-tab-hover new-tab-nav" onclick="HoverLi(1)">
|
||||
<a href="javascript:void(0);" class="tab_type">我的发布</a>
|
||||
</li>
|
||||
<li id="edu-tab-nav-2" class="new-tab-nav" onclick="HoverLi(2)">
|
||||
<a href="javascript:void(0);" class="tab_type">我的参与</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="play pl10 pr10">
|
||||
<div class="nav clearfix">
|
||||
<p class="fl font-14 bold task-tab" data-option="release" id="my_publish">
|
||||
我的发布<span class="font-12 ml10"><%= @my_syllabuses.count %></span>
|
||||
<i class="fa fa-caret-down font-12" aria-hidden="true"></i>
|
||||
</p>
|
||||
<p class="fl font-14 task-tab" data-option="partic" id="my_join">
|
||||
我的参与<span class="font-12 ml10"><%= @join_syllabuses.count %></span>
|
||||
<i class="fa fa-caret-down font-12" style="display:none;" aria-hidden="true"></i>
|
||||
</p>
|
||||
</div>
|
||||
<p class="state mt20">
|
||||
<a href="<%= syllabuses_path(:type => 1) %>" class="edu-filter-cir-grey mr5 active" data-remote="true" id="syllabuses_processing">正在进行</a>
|
||||
<a href="<%= syllabuses_path(:type => 2) %>" class="edu-filter-cir-grey mr5" data-remote="true" id="syllabuses_end">已结束</a>
|
||||
</p>
|
||||
<div class="con" style="min-height:740px;">
|
||||
<div class="release" id="my_syllabuses">
|
||||
<%= render :partial => "syllabuses/my_syllabuses" %>
|
||||
</div>
|
||||
<div class="partic undis" id="join_syllabuses" style="padding-bottom:20px;" >
|
||||
<%= render :partial => "syllabuses/join_syllabuses" %>
|
||||
<div id="edu-tab-con-1">
|
||||
<div class=" edu-class-inner-max" style="min-height:700px;">
|
||||
<p class="edu-con-top">
|
||||
<a href="<%= syllabuses_path(:type => 1, :tab => 1) %>" class="ml15 edu-filter-cir-grey mr5 active" data-remote="true" id="syllabuses_processing">正在进行</a>
|
||||
<a href="<%= syllabuses_path(:type => 2, :tab => 1) %>" class="edu-filter-cir-grey mr5" data-remote="true" id="syllabuses_end">已结束</a>
|
||||
</p>
|
||||
<div id="my_syllabuses">
|
||||
<%= render :partial => "syllabuses/my_syllabuses" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edu-tab-con-2" class="undis">
|
||||
<p class="edu-con-top">
|
||||
<a href="<%= syllabuses_path(:type => 1, :tab => 2) %>" class="ml15 edu-filter-cir-grey mr5 active" data-remote="true" id="syllabuses_processing">正在进行</a>
|
||||
<a href="<%= syllabuses_path(:type => 2, :tab => 2) %>" class="edu-filter-cir-grey mr5" data-remote="true" id="syllabuses_end">已结束</a>
|
||||
</p>
|
||||
<div class="edu-class-inner-max" style="min-height:700px;">
|
||||
<div id="join_syllabuses">
|
||||
<%= render :partial => "syllabuses/join_syllabuses" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
console.log($(".con .handle"));
|
||||
$(".play .nav p").click(function () {
|
||||
var $a = $(this).attr("data-option");
|
||||
$(".play .nav p i").hide();
|
||||
$(".play .nav p").removeClass("bold");
|
||||
$(this).addClass("bold");
|
||||
$(this).find("i").show();
|
||||
$(".con").children().hide();
|
||||
$(".con").find("." + $a + "").show();
|
||||
});
|
||||
$(".con .count").click(function () {
|
||||
if ($(this).find(".cut").css("display") == "none") {
|
||||
$(this).find(".cut").show();
|
||||
$(this).find(".add").hide();
|
||||
$(this).parent().next().show();
|
||||
} else {
|
||||
$(this).find(".cut").hide();
|
||||
$(this).find(".add").show();
|
||||
$(this).parent().next().hide();
|
||||
}
|
||||
});
|
||||
$(".con .operate").click(function () {
|
||||
if ($(this).parent().next().css("display") == "none") {
|
||||
$(".con .handle").hide();
|
||||
$(this).parent().next().show();
|
||||
} else {
|
||||
$(this).parent().next().hide();
|
||||
}
|
||||
});
|
||||
$(document).bind("click", function (e) {
|
||||
var target = $(e.target);
|
||||
if (target.closest(".con .handle").length == 0 && target.closest(".con .operate").length == 0) {
|
||||
$(".con .handle").hide();
|
||||
}
|
||||
});
|
||||
function g(o){return document.getElementById(o);}
|
||||
function HoverLi(n){
|
||||
for(var i=1;i<=2;i++){
|
||||
g('edu-tab-nav-'+i).className='new-tab-nav';
|
||||
g('edu-tab-con-'+i).className='undis';
|
||||
}
|
||||
g('edu-tab-con-'+n).className='dis';
|
||||
g('edu-tab-nav-'+n).className='edu-new-tab-hover';
|
||||
}
|
||||
|
||||
// type: 1表示正在进行 2表示一结束
|
||||
$("#syllabuses_processing").live("click", function(){
|
||||
$(this).addClass("active");
|
||||
$(this).next().removeClass("active");
|
||||
/* $.ajax({
|
||||
dateType: "script",
|
||||
url: "<%#= syllabuses_path() %>",
|
||||
data: { type: 1 }
|
||||
})*/
|
||||
});
|
||||
$("#syllabuses_end").live("click", function(){
|
||||
$(this).addClass("active");
|
||||
$(this).prev().removeClass("active");
|
||||
/* $.ajax({
|
||||
dateType: "script",
|
||||
url: "<%#= syllabuses_path() %>",
|
||||
data: { type: 2 }
|
||||
})*/
|
||||
});
|
||||
// type: 1表示正在进行 2表示一结束
|
||||
$("#syllabuses_processing").live("click", function(){
|
||||
$(this).addClass("active");
|
||||
$(this).next().removeClass("active");
|
||||
});
|
||||
$("#syllabuses_end").live("click", function(){
|
||||
$(this).addClass("active");
|
||||
$(this).prev().removeClass("active");
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,36 +1,5 @@
|
|||
$("#my_syllabuses").html("<%= j( render :partial => "syllabuses/my_syllabuses") %>");
|
||||
$("#join_syllabuses").html("<%= j( render :partial => "syllabuses/join_syllabuses") %>");
|
||||
$(".play .nav p").click(function () {
|
||||
var $a = $(this).attr("data-option");
|
||||
$(".play .nav p i").hide();
|
||||
$(".play .nav p").removeClass("bold");
|
||||
$(this).addClass("bold");
|
||||
$(this).find("i").show();
|
||||
$(".con").children().hide();
|
||||
$(".con").find("." + $a + "").show();
|
||||
});
|
||||
$(".con .count").click(function () {
|
||||
if ($(this).find(".cut").css("display") == "none") {
|
||||
$(this).find(".cut").show();
|
||||
$(this).find(".add").hide();
|
||||
$(this).parent().next().show();
|
||||
} else {
|
||||
$(this).find(".cut").hide();
|
||||
$(this).find(".add").show();
|
||||
$(this).parent().next().hide();
|
||||
}
|
||||
});
|
||||
$(".con .operate").click(function () {
|
||||
if ($(this).parent().next().css("display") == "none") {
|
||||
$(".con .handle").hide();
|
||||
$(this).parent().next().show();
|
||||
} else {
|
||||
$(this).parent().next().hide();
|
||||
}
|
||||
});
|
||||
$(document).bind("click", function (e) {
|
||||
var target = $(e.target);
|
||||
if (target.closest(".con .handle").length == 0 && target.closest(".con .operate").length == 0) {
|
||||
$(".con .handle").hide();
|
||||
}
|
||||
});
|
||||
<% if params[:tab].to_i == 1 %>
|
||||
$("#my_syllabuses").html("<%= j( render :partial => "syllabuses/my_syllabuses") %>");
|
||||
<% elsif params[:tab].to_i == 2 %>
|
||||
$("#join_syllabuses").html("<%= j( render :partial => "syllabuses/join_syllabuses") %>");
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
<span class="span1 font-16 task-tab bold" id="my_watchlist_span">
|
||||
<%= str %>的关注
|
||||
<em id="follow"><%= @user_watchlist_count %></em>
|
||||
<i class="fa fa-caret-down font-12" aria-hidden="true"></i>
|
||||
<!-- <i class="fa fa-caret-down font-12" aria-hidden="true"></i>-->
|
||||
</span>
|
||||
<span class="font-16 grey task-tab" id="my_fanlist_span">
|
||||
<%= str %>的粉丝
|
||||
<em id="fens"><%= @user_fanlist_count %></em>
|
||||
<i class="fa fa-caret-down font-12" aria-hidden="true" style="display:none;"></i>
|
||||
<!-- <i class="fa fa-caret-down font-12" aria-hidden="true" style="display:none;"></i>-->
|
||||
</span>
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||
<li class="eduhomepagePostReplyContainer" nhname="reply_rec">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
|
||||
<div class="eduHomepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment, :type => type, :user_activity_id => user_activity_id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
<% @courses.each do |course| %>
|
||||
<p class="clearfix pl10">
|
||||
<a href="<%= course_path(course) %>" target="_blank" class="font-16 first link-color-grey03"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= course.name %></a>
|
||||
<span class="font-14 hasmargin"><a href="<%= syllabus_path(course.syllabus) %>" target="_blank" class="link-color-grey03"><%= course.syllabus.title %></a></span>
|
||||
<span class="font-14 mr25 color-grey fr"><%= format_time course.updatetime %></span>
|
||||
<span class="font-14 last cl" style="display: none;">分享 <i class="fa fa-weixin font-14 blue" aria-hidden="true"></i></span>
|
||||
</p>
|
||||
<% end %>
|
||||
<%# if @courses_count > 8 %>
|
||||
<!--<a href="<%#= courses_path %>" target="_blank" class="font-16 new_expand">点击查看全部</a>-->
|
||||
<%# end %>
|
||||
<div class="cl"></div>
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_right_min" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @courses_pages, @courses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<% @shixuns.each do |shixun| %>
|
||||
<p class="clearfix pl10">
|
||||
<a href="<%= shixun_path(shixun) %>" target="_blank" class="font-16 first"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= shixun.name %></a>
|
||||
<span class="font-14 hasmargin"><a href="javascript:void(0);" target="_blank">已解锁第<i><%= had_passed_changllenge_count(shixun) %></i>关/共<i><%= shixun.challenges.count %></i>关</a></span>
|
||||
<span class="font-14 fr mr25 color-grey"><%= format_time shixun.created_at %></span>
|
||||
<span class="font-14 last cl" style="display: none;">分享 <i class="fa fa-weixin font-14 blue" aria-hidden="true"></i></span>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_right_min" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @shixuns_pages, @shixuns_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<% all_replies = JournalsForMessage.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
<%= render :partial => 'users/wide_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="eduhomepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<div class="eduHomepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<div class="resources mb10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="eduResources mb10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
|
||||
<div class="eduHomepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="eduHomepagePostDes">
|
||||
<div class="homepagePostTo break_word">
|
||||
<%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
|
||||
TO
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
<% else %>
|
||||
<% content = activity.notes %>
|
||||
<% end %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
<%= render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<div class="eduHomepagePostReply">
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/user_journal_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<div class="eduhomepagePostReplyBanner" id="reply_banner_<%=user_activity_id %>">
|
||||
<div class="homepagePostReplyBannerCount">
|
||||
<span>回复</span>
|
||||
<span class="reply_iconup" > ︿</span>
|
||||
<span class="mr15"><%= count>0 ? "(#{count})" : "" %></span><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if expand_more %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<% if activity.class.to_s == 'HomeworkCommon' || activity.class.to_s == 'Work' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply_homework('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=activity.id %>,<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% elsif activity.class.to_s == 'Message' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_all_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% elsif activity.class.to_s == 'BlogComment' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_all_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% else %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_all_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -194,41 +194,20 @@
|
|||
<p class="title">
|
||||
<% str = current_user ? '' : 'TA的' %>
|
||||
<% if @courses_count == 0 %>
|
||||
<span class="font-16 task-tab bold" id="my_shixuns_span">实训<em class="ml10" style="background:#e9e9eb"><%= @shixuns_count %></em><i class="fa fa-caret-down font-12" aria-hidden="true"></i></span>
|
||||
<span class="font-16 task-tab bold" id="my_shixuns_span">实训<em class="ml10" style="background:#e9e9eb"><%= @shixuns_count %></em></span>
|
||||
<% elsif @shixuns_count == 0 %>
|
||||
<span class="font-16 task-tab bold" id="my_courses_span">课堂<em class="ml10" style="background:#e9e9eb"><%= @courses_count %></em><i class="fa fa-caret-down font-12" aria-hidden="true"></i></span>
|
||||
<span class="font-16 task-tab bold" id="my_courses_span">课堂<em class="ml10" style="background:#e9e9eb"><%= @courses_count %></em></span>
|
||||
<% else %>
|
||||
<span class="font-16 task-tab bold" id="my_courses_span">课堂<em class="ml10" style="background:#e9e9eb"><%= @courses_count %></em><i class="fa fa-caret-down font-12" aria-hidden="true"></i></span>
|
||||
<span class="font-16 task-tab " id="my_shixuns_span">实训<em class="ml10" style="background:#e9e9eb"><%= @shixuns_count %></em><i class="fa fa-caret-down font-12" aria-hidden="true" style="display:none;"></i></span>
|
||||
<span class="font-16 task-tab bold" id="my_courses_span">课堂<em class="ml10" style="background:#e9e9eb"><%= @courses_count %></em></span>
|
||||
<span class="font-16 task-tab " id="my_shixuns_span">实训<em class="ml10" style="background:#e9e9eb"><%= @shixuns_count %></em></span>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<div class="lesson clearfix" id="my_courses_list">
|
||||
<% @courses.limit(8).each do |course| %>
|
||||
<p class="clearfix pl10">
|
||||
<a href="<%= course_path(course) %>" target="_blank" class="font-16 first link-color-grey03"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= course.name %></a>
|
||||
<span class="font-14 hasmargin"><a href="<%= syllabus_path(course.syllabus) %>" target="_blank" class="link-color-grey03"><%= course.syllabus.title %></a></span>
|
||||
<span class="font-14 mr25 color-grey fr"><%= format_time course.updatetime %></span>
|
||||
<span class="font-14 last cl" style="display: none;">分享 <i class="fa fa-weixin font-14 blue" aria-hidden="true"></i></span>
|
||||
</p>
|
||||
<% end %>
|
||||
<% if @courses_count > 8 %>
|
||||
<a href="<%= courses_path %>" target="_blank" class="font-16 new_expand">点击查看全部</a>
|
||||
<% end %>
|
||||
<%= render :partial => "my_homepage_courses_list" %>
|
||||
</div>
|
||||
|
||||
<div class="<%= @courses.count > 0 ? 'lesson undis' : 'lesson' %>" id="my_shixuns_list">
|
||||
<% @shixuns.limit(8).each do |shixun| %>
|
||||
<p class="clearfix pl10">
|
||||
<a href="<%= shixun_path(shixun) %>" target="_blank" class="font-16 first"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= shixun.name %></a>
|
||||
<span class="font-14 hasmargin"><a href="javascript:void(0);" target="_blank">已解锁第<i><%= had_passed_changllenge_count(shixun) %></i>关/共<i><%= shixun.challenges.count %></i>关</a></span>
|
||||
<span class="font-14 fr mr25 color-grey"><%= format_time shixun.created_at %></span>
|
||||
<span class="font-14 last cl" style="display: none;">分享 <i class="fa fa-weixin font-14 blue" aria-hidden="true"></i></span>
|
||||
</p>
|
||||
<% end %>
|
||||
<% if @shixuns_count > 8 %>
|
||||
<a href="<%= shixuns_user_path(@user) %>" target="_blank" class="font-16 new_expand">点击查看全部</a>
|
||||
<% end %>
|
||||
<%#= render :partial => "my_homepage_shixuns_list" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<% if is_current_user %>
|
||||
$("#user_homepage_message_list").html("<%= escape_javascript( render :partial => 'users/user_message_list') %>");
|
||||
<% else %>
|
||||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => "user_activities"} )%>");
|
||||
<% end %>
|
||||
<%# if is_current_user %>
|
||||
// $("#user_homepage_message_list").html("<%#= escape_javascript( render :partial => 'users/user_message_list') %>");
|
||||
<%# else %>
|
||||
// $("#show_more_activities").replaceWith("<%#= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => "user_activities"} )%>");
|
||||
<%# end %>
|
||||
$("#my_courses_list").html ("<%= j (render :partial => 'users/my_homepage_courses_list') %>");
|
||||
$("#my_shixuns_list").html ("<%= j (render :partial => 'users/my_homepage_shixuns_list') %>");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div>
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="eduhomepageRightBanner mb10">
|
||||
<div class="NewsBannerName pr"><span id="mesLabel">留言</span></div>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="messageContent" >
|
||||
<div id="messageContent">
|
||||
<% unless is_current_user %>
|
||||
<div class="resources mb10"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
|
||||
<div class="fl" style="width:658px;" >
|
||||
|
|
|
|||
|
|
@ -1502,7 +1502,7 @@
|
|||
var tex = $(this);
|
||||
editormd.$katex.render(tex.text(), tex[0]);
|
||||
|
||||
tex.find(".katex").css("font-size", "1.6em");
|
||||
tex.find(".katex").css("font-size", "1.0em");
|
||||
});
|
||||
|
||||
return this;
|
||||
|
|
@ -4015,7 +4015,7 @@
|
|||
div.find("." + editormd.classNames.tex).each(function(){
|
||||
var tex = $(this);
|
||||
katex.render(tex.html().replace(/</g, "<").replace(/>/g, ">"), tex[0]);
|
||||
tex.find(".katex").css("font-size", "1.6em");
|
||||
tex.find(".katex").css("font-size", "1.0em");
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
|
|
@ -1812,7 +1812,6 @@ function pop_box_new2(value, Width, Height){
|
|||
});
|
||||
$("#popupWrap input, #popupWrap textarea, #popupWrap ul, #popupWrap a").mousedown(function(event){
|
||||
event.stopPropagation();
|
||||
new Drag("popupWrap");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ $(function(){
|
|||
|
||||
/*---------------------- 课堂tab点击事件 -------------------------*/
|
||||
nTabCourse.live('click', function(){
|
||||
$.ajax({
|
||||
url: '/users/' + $("#current_user_id").val(),
|
||||
async: false
|
||||
})
|
||||
var nParent = nTabCourse.parent();
|
||||
nParent.find(".bold").removeClass("bold");
|
||||
nParent.find("i").hide();
|
||||
|
|
@ -40,6 +44,10 @@ $(function(){
|
|||
|
||||
/*---------------------- 实训tab点击事件 -------------------------*/
|
||||
nTabShixun.live('click', function(){
|
||||
$.ajax({
|
||||
url: '/users/' + $("#current_user_id").val(),
|
||||
async: false
|
||||
})
|
||||
var nParent = nTabShixun.parent();
|
||||
nParent.find(".bold").removeClass("bold");
|
||||
nParent.find("i").hide();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
# [<img src="https://khan.github.io/KaTeX/katex-logo.svg" width="130" alt="KaTeX">](https://khan.github.io/KaTeX/) [](https://travis-ci.org/Khan/KaTeX)
|
||||
|
||||
[](https://gitter.im/Khan/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
|
||||
|
||||
* **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://jsperf.com/katex-vs-mathjax/).
|
||||
* **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting.
|
||||
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
|
||||
* **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
|
||||
|
||||
KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, and IE 8 - IE 11. A list of supported commands can be on the [wiki](https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX).
|
||||
|
||||
## Usage
|
||||
|
||||
You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.js"></script>
|
||||
```
|
||||
|
||||
#### In-browser rendering
|
||||
|
||||
Call `katex.render` with a TeX expression and a DOM element to render into:
|
||||
|
||||
```js
|
||||
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element);
|
||||
```
|
||||
|
||||
If KaTeX can't parse the expression, it throws a `katex.ParseError` error.
|
||||
|
||||
#### Server side rendering or rendering to a string
|
||||
|
||||
To generate HTML on the server or to generate an HTML string of the rendered math, you can use `katex.renderToString`:
|
||||
|
||||
```js
|
||||
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}");
|
||||
// '<span class="katex">...</span>'
|
||||
```
|
||||
|
||||
Make sure to include the CSS and font files, but there is no need to include the JavaScript. Like `render`, `renderToString` throws if it can't parse the expression.
|
||||
|
||||
#### Rendering options
|
||||
|
||||
You can provide an object of options as the last argument to `katex.render` and `katex.renderToString`. Available options are:
|
||||
|
||||
- `displayMode`: `boolean`. If `true` the math will be rendered in display mode, which will put the math in display style (so `\int` and `\sum` are large, for example), and will center the math on the page on its own line. If `false` the math will be rendered in inline mode. (default: `false`)
|
||||
- `throwOnError`: `boolean`. If `true`, KaTeX will throw a `ParseError` when it encounters an unsupported command. If `false`, KaTeX will render the unsupported command as text in the color given by `errorColor`. (default: `true`)
|
||||
- `errorColor`: `string`. A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option determines the color which unsupported commands are rendered in. (default: `#cc0000`)
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { displayMode: true });
|
||||
```
|
||||
|
||||
#### Automatic rendering of math on a page
|
||||
|
||||
Math on the page can be automatically rendered using the auto-render extension. See [the Auto-render README](contrib/auto-render/README.md) for more information.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT).
|
||||
|
|
@ -0,0 +1 @@
|
|||
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.renderMathInElement=e()}})(function(){var e,t,r;return function n(e,t,r){function a(o,l){if(!t[o]){if(!e[o]){var f=typeof require=="function"&&require;if(!l&&f)return f(o,!0);if(i)return i(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var s=t[o]={exports:{}};e[o][0].call(s.exports,function(t){var r=e[o][1][t];return a(r?r:t)},s,s.exports,n,e,t,r)}return t[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)a(r[o]);return a}({1:[function(e,t,r){var n=e("./splitAtDelimiters");var a=function(e,t){var r=[{type:"text",data:e}];for(var a=0;a<t.length;a++){var i=t[a];r=n(r,i.left,i.right,i.display||false)}return r};var i=function(e,t){var r=a(e,t);var n=document.createDocumentFragment();for(var i=0;i<r.length;i++){if(r[i].type==="text"){n.appendChild(document.createTextNode(r[i].data))}else{var o=document.createElement("span");var l=r[i].data;try{katex.render(l,o,{displayMode:r[i].display})}catch(f){if(!(f instanceof katex.ParseError)){throw f}console.error("KaTeX auto-render: Failed to parse `"+r[i].data+"` with ",f);n.appendChild(document.createTextNode(r[i].rawData));continue}n.appendChild(o)}}return n};var o=function(e,t,r){for(var n=0;n<e.childNodes.length;n++){var a=e.childNodes[n];if(a.nodeType===3){var l=i(a.textContent,t);n+=l.childNodes.length-1;e.replaceChild(l,a)}else if(a.nodeType===1){var f=r.indexOf(a.nodeName.toLowerCase())===-1;if(f){o(a,t,r)}}}};var l={delimiters:[{left:"$$",right:"$$",display:true},{left:"\\[",right:"\\]",display:true},{left:"\\(",right:"\\)",display:false}],ignoredTags:["script","noscript","style","textarea","pre","code"]};var f=function(e){var t;var r;for(var n=1,a=arguments.length;n<a;n++){t=arguments[n];for(r in t){if(Object.prototype.hasOwnProperty.call(t,r)){e[r]=t[r]}}}return e};var d=function(e,t){if(!e){throw new Error("No element provided to render")}t=f({},l,t);o(e,t.delimiters,t.ignoredTags)};t.exports=d},{"./splitAtDelimiters":2}],2:[function(e,t,r){var n=function(e,t,r){var n=r;var a=0;var i=e.length;while(n<t.length){var o=t[n];if(a<=0&&t.slice(n,n+i)===e){return n}else if(o==="\\"){n++}else if(o==="{"){a++}else if(o==="}"){a--}n++}return-1};var a=function(e,t,r,a){var i=[];for(var o=0;o<e.length;o++){if(e[o].type==="text"){var l=e[o].data;var f=true;var d=0;var s;s=l.indexOf(t);if(s!==-1){d=s;i.push({type:"text",data:l.slice(0,d)});f=false}while(true){if(f){s=l.indexOf(t,d);if(s===-1){break}i.push({type:"text",data:l.slice(d,s)});d=s}else{s=n(r,l,d+t.length);if(s===-1){break}i.push({type:"math",data:l.slice(d+t.length,s),rawData:l.slice(d,s+r.length),display:a});d=s+r.length}f=!f}i.push({type:"text",data:l.slice(d)})}else{i.push(e[o])}}return i};t.exports=a},{}]},{},[1])(1)});
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue