Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

Conflicts:
	app/views/users/_new_user_message.html.erb
	public/stylesheets/css/user.css
This commit is contained in:
cxt 2016-12-16 14:41:37 +08:00
commit 0fe7b96473
44 changed files with 290 additions and 131 deletions

View File

@ -811,7 +811,7 @@ class StudentWorkController < ApplicationController
@new_score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
@new_score.user_id = User.current.id
@new_score.student_work_id = @work.id
if @is_teacher && @work.work_status == 0
if @is_teacher && !@new_score.score.nil? && @work.work_status == 0
@work.update_attributes(:work_status => 1, :commit_time => Time.now)
end
if User.current.admin?

View File

@ -0,0 +1,3 @@
class DataException < ActiveRecord::Base
attr_accessible :container_id, :container_type, :message
end

View File

@ -44,7 +44,9 @@ class Poll < ActiveRecord::Base
def act_as_course_activity
if self.polls_type == "Course"
if self.polls_status == 2 #问卷是发布状态
self.course_acts << CourseActivity.new(:user_id => self.user_id,:course_id => self.polls_group_id)
if CourseActivity.where(:course_id => self.polls_group_id, :user_id => self.user_id, :course_act_id => self.id, :course_act_type => 'Poll').count == 0
self.course_acts << CourseActivity.new(:user_id => self.user_id,:course_id => self.polls_group_id)
end
elsif self.polls_status == 1 #问卷是新建状态
self.course_acts.destroy_all
end

View File

@ -92,7 +92,7 @@
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
<div class="cl"></div>
<div class="homepagePostIntro break_word upload_img table_maxWidth " id="activity_description_<%= @article.id%>">
<div class="homepagePostIntro break_word upload_img table_maxWidth ke-block" id="activity_description_<%= @article.id%>">
<div id="intro_content_<%= @article.id%>">
<%= @article.content.to_s.html_safe %>
</div>

View File

@ -28,7 +28,7 @@
<%= render :partial => 'action_menu' %>
<div class="cl"></div>
<% if @issue.description? || @issue.attachments.any? -%>
<div class="talk_info mb10 issue_desc" id="issue_desc_<%= @issue.id %>" style="word-break:break-all;">
<div class="talk_info mb10 issue_desc ke-block" id="issue_desc_<%= @issue.id %>" style="word-break:break-all;">
<% if @issue.description? %>
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
<%= textAreailizable @issue, :description, :attachments => @issue.attachments %>

View File

@ -59,7 +59,7 @@
<% if params[:action] == "new" %>
<a href="<%= project_issues_path(@project, :remote => true) %>" class="sy_btn_grey mr5 fr"> 取消</a>
<% else %>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="sy_btn_grey mr5 fr" > 取消 </a>
<%= link_to "取消", issue_path(@issue), :class => "sy_btn_grey mr5 fr" %>
<% end %>
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
<!--<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>-->

View File

@ -1,6 +1,6 @@
<% if @issue_commit_ids %>
<% unless @issue_commit_ids.blank? %>
<% @issue_commit_ids.each do |commit_id| %>
<div class="btn btn-blue mb5">
<div class="btn-commit-issue btn-blue mb5 mr5">
<%= link_to commit_id[0,8], {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit_id}, :target => "_blank", :class => "commit_id_value" %>
<% if @issue %>
<% if User.current.admin? || is_project_manager?(User.current.id, @project.id) || User.current.id == @issue.author_id %>
@ -13,6 +13,4 @@
<% end %>
</div>
<% end %>
<% else %>
<div class="c_grey">暂无</div>
<% end %>

View File

@ -0,0 +1,20 @@
<% if !@issue_commit_ids.blank? %>
<span class="pro_new_conbox_leftspan mb5">关联Commit</span>
<% @issue_commit_ids.each do |commit_id| %>
<div class="btn-commit-issue btn-blue mb5 mr5">
<%= link_to commit_id[0,8], {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit_id}, :target => "_blank", :class => "commit_id_value" %>
<% if @issue %>
<% if User.current.admin? || is_project_manager?(User.current.id, @project.id) || User.current.id == @issue.author_id %>
<%= link_to "×", issue_commit_delete_issues_path(:commit_id => commit_id, :project_id => @project.id, :issue_commit_ids => @issue_commit_ids, :issue_id => @issue.try(:id)), :remote => true, :style => "color:#fff;" %>
<% end %>
<% else %>
<% if User.current.member_of?(@project) %>
<%= link_to "×", issue_commit_delete_issues_path(:commit_id => commit_id, :project_id => @project.id, :issue_commit_ids => @issue_commit_ids, :issue_id => @issue.try(:id)), :remote => true, :style => "color:#fff;" %>
<% end %>
<% end %>
</div>
<% end %>
<% else %>
<span class="pro_new_conbox_leftspan mb5 fl">关联Commit</span>
<span class="pro_new_conbox_rightspan fl ml10">无</span>
<% end %>

View File

@ -73,7 +73,7 @@
<span class="fl mr5"><%= activity.journals.count %></span>
<% end %>
<div class="undis" style="position: absolute; <%= activity.journals.count > 0 ? 'top:25px;' : 'top:7px' %>">
<%= link_to "", issue_path(activity.id, :edit => 'true'), :class => 'sy_icons_edit fl mt15', :style => "margin-top:25px;", :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
<%= link_to "", edit_issue_path(activity.id), :class => 'sy_icons_edit fl mt15', :style => "margin-top:25px;", :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
<% if !defined?(project_id) && !defined?(user_id) %>
<%= link_to "", issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15', :style => "margin-top:25px;" if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(project_id) %>

View File

@ -37,7 +37,7 @@
</div>
</div>
<ul class="fr pro_new_conbox_right" id="project_issue_info_show">
<ul class="fr pro_new_conbox_right mt10" id="project_issue_info_show">
<li class="clear">
<span class="pro_new_conbox_leftspan fl">当前状态</span>
<span class="pro_new_conbox_rightspan fl ml10"><%= @issue.status.name %></span>
@ -74,10 +74,8 @@
<span class="pro_new_conbox_rightspan fl ml10"><%= @issue.done_ratio %>%</span>
</li>
<% end %>
<li class="clear"><span class="pro_new_conbox_leftspan mb5">关联Commit</span>
<div id="issue_commit_ids">
<%= render :partial => "issues/issue_commit_ids" %>
</div>
<li class="clear">
<%= render :partial => "issues/issue_commit_ids_show" %>
</li>
</ul>
<div class="cl"></div>

View File

@ -45,7 +45,7 @@
<%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content" id="activity_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content ke-block" id="activity_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%>
</div>
<div class="cl"></div>

View File

@ -73,7 +73,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word ke-block" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @topic.content.html_safe%>
</div>
<div class="cl"></div>

View File

@ -104,7 +104,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time(@topic.created_on) %></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;">
<div class="homepagePostIntro memo-content upload_img break_word ke-block" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;">
<%= @topic.content.html_safe %>
</div>
<div class="cl"></div>

View File

@ -136,7 +136,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word ke-block" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @topic.content.html_safe%>
</div>
<div class="cl"></div>

View File

@ -1,8 +1,8 @@
$("img[nhname='avatar_image']").attr('src',$("#nh_source_tx").attr('src'));
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
showModal('ajax-modal','460px');
$('#ajax-modal').siblings().hide();
$('#ajax-modal').parent().removeClass("alert_praise").removeClass("copyCoursePopup");
$('#ajax-modal').parent().css("top","30%").css("left","40%");
$('#ajax-modal').parent().addClass("alert_box");
$('#ajax-modal').parent().css("border", "3px solid #269ac9").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0");
$("img[nhname='avatar_image']").attr('src',$("#nh_source_tx").attr('src'));
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
showModal('ajax-modal','460px');
$('#ajax-modal').siblings().hide();
$('#ajax-modal').parent().removeClass("alert_praise").removeClass("copyCoursePopup");
$('#ajax-modal').parent().css("top","30%").css("left","40%");
$('#ajax-modal').parent().addClass("alert_box");
$('#ajax-modal').parent().css("border", "3px solid #269ac9").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0");

View File

@ -70,7 +70,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word ke-block" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%>
</div>
<div class="cl"></div>

View File

@ -60,7 +60,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word ke-block" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%>
</div>
<div class="cl"></div>

View File

@ -74,7 +74,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word ke-block" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%>
</div>
<div class="cl"></div>

View File

@ -17,7 +17,7 @@
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
<%= link_to l(:button_edit), edit_issue_path(activity.id), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
</li>
<li>
<% if !defined?(project_id) && !defined?(user_id) %>

View File

@ -9,10 +9,10 @@
<div class="homepagePostTo break_word">
<%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.project), :class => "newsBlue ml15" %>
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, project_files_path(activity.project), :class => "postGrey" %>
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline mr15">

View File

@ -6,10 +6,15 @@
<div class="alert alert-orange mb15 ">
项目分支 <%= @request.source_branch %> 和 <%= @request.target_branch %> 似乎没有差异,请将新改动提交至源分支或者切换到其它目标分支
</div>
<% elsif !@request.merge_when_build_succeeds %>
<div class="alert alert-orange mb15 ">
Pull Request中存在冲突请先解决冲突或者手动进行合并。
</div>
<% else %>
<% if is_project_manager?(User.current.id, @project.id) %>
<div class="alert alert-orange mb15 ">
在管理员接受后,将由系统自动合并。<%= link_to "接受", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "linkBlue2", :remote => true %></a>
在管理员接受后,将由系统自动合并。
<%= link_to "接受", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "linkBlue2", :remote => true %></a>
</div>
<% end %>
<% end %>

View File

@ -48,6 +48,7 @@
<div class="cl"></div>
<p id="hint_message"></p>
<div class="cl"></div>
<div class="_notice_box text_c none mt5" style="height: 20px; width: 397px; padding: 4px 4px; line-height: 20px;" id="_notice_box">注意暂不支持IE浏览器的上传请更换浏览器</div>
<div style="margin-top: 10px">
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="fl sy_btn_grey mr10" onclick="closeModal();">取消</a>
<a href="javascript:void(0);" id="upload_files_submit_btn" class="fl sy_btn_blue" onclick="submit_revise_files();">确定</a>
@ -55,4 +56,14 @@
<% end %>
</div>
<div class="cl"></div>
</div>
</div>
<script>
$(function(){
if(is_IE()){
$("#_notice_box").show();
$("#uploadReviseBox").addClass('disable_link');
$("#uploadReviseBox").attr("title","IE无法上传");
$("#choose_revise_attach").attr("onclick","return false;");
}
});
</script>

View File

@ -5,6 +5,16 @@
<% end %>
<script type="text/javascript">
$(function(){
if(is_IE()){
$("#_notice_box").show();
$("#uploadReviseBox").addClass('disable_link');
$("#upload_file_local").attr("title","IE无法上传");
$("#upload_file_local").attr("onclick","return false;");
$("#resource_repo_upload").attr("title","IE无法上传");
$("#resource_repo_upload").attr("href","javascript:void(0)");
}
});
<%if @homework.anonymous_comment == 0 && @homework.homework_detail_manual.comment_status != 1%>
$(function(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_student_work_alert') %>');
@ -203,8 +213,9 @@
</div>
<div class="cl"></div>
<div class="HomeWork" id="users_setting">
<div class="_notice_box text_c none mb10" style="height: 20px; padding: 4px 4px; line-height: 20px;" id="_notice_box">注意暂不支持IE浏览器的上传请更换浏览器</div>
<div class="HomeWork" id="users_setting">
<div class="HomeWorkBox">
<div class="">
<div class="homepagePostTitle fl m_w530 hidden">

View File

@ -39,7 +39,7 @@
<p class="sy_tab_con_p">该课程尚未填写课程大纲,敬请期待!</p>
<% else %>
<div class="sy_tab_con">
<div class="syllabuscon upload_img" id="syllabus_description_<%= @syllabus.id %>">
<div class="syllabuscon upload_img ke-block" id="syllabus_description_<%= @syllabus.id %>">
<%=@syllabus.description.html_safe %>
</div>
<div class="mt10" style="font-weight:normal; font-size: 12px;">

View File

@ -1,4 +1,4 @@
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
</div>

View File

@ -0,0 +1,4 @@
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
</div>

View File

@ -0,0 +1,4 @@
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
</div>

View File

@ -20,7 +20,7 @@
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
<%= link_to l(:button_edit), edit_issue_path(activity.id), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
</li>
<li>
<% if !defined?(project_id) && !defined?(user_id) %>

View File

@ -69,8 +69,8 @@
<div class="mt5 fl">
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
<%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true %>
<a href="javascript:void(0);" id="upload_file_local" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
<%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true, :id => "resource_repo_upload" %>
</div>
<% content_for :header_tags do %>

View File

@ -1,39 +1,39 @@
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="margin-left:95px; width:80px" >
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li><%= link_to "全部动态", {:controller => "users", :action => "course_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %></li>
<li><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "course_community", :type => "current_user"}, :class => "homepagePostTypeMine postTypeGrey" %></li>
<li><%= link_to "作业动态", {:controller => "users", :action => "course_community", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey" %></li>
<li><%= link_to "通知动态", {:controller => "users", :action => "course_community", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
<li><%= link_to "论坛动态", {:controller => "users", :action => "course_community", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey" %></li>
<li><%= link_to "问卷动态", {:controller => "users", :action => "course_community", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey" %></li>
<li><%= link_to "班级留言", {:controller => "users", :action => "course_community", :type => "course_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<li><%= link_to "个人留言", {:controller => "users", :action => "course_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<% end %>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities, :page => 0, :type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="margin-left:95px; width:80px" >
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li><%= link_to "全部动态", {:controller => "users", :action => "course_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %></li>
<li><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "course_community", :type => "current_user"}, :class => "homepagePostTypeMine postTypeGrey" %></li>
<li><%= link_to "作业动态", {:controller => "users", :action => "course_community", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey" %></li>
<li><%= link_to "通知动态", {:controller => "users", :action => "course_community", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
<li><%= link_to "论坛动态", {:controller => "users", :action => "course_community", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey" %></li>
<li><%= link_to "问卷动态", {:controller => "users", :action => "course_community", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey" %></li>
<li><%= link_to "班级留言", {:controller => "users", :action => "course_community", :type => "course_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<li><%= link_to "个人留言", {:controller => "users", :action => "course_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<% end %>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities, :page => 0, :type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>

View File

@ -1,6 +1,6 @@
$("#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),
$("#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 => "course_community"} )%>");

View File

@ -1,37 +1,37 @@
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="margin-left:95px; width:80px" >
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li><%= link_to "全部动态", {:controller => "users", :action => "project_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %></li>
<li><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "project_community", :type => "current_user"},
:class => "homepagePostTypeMine postTypeGrey" %></li>
<li><%= link_to "问题动态", {:controller => "users", :action => "project_community", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%></li>
<li><%= link_to "论坛动态", {:controller => "users", :action => "project_community", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>
<li><%= link_to "个人留言", {:controller => "users", :action => "project_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<% end %>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => { :user_activities => @user_activities, :page => 0, :type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="margin-left:95px; width:80px" >
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li><%= link_to "全部动态", {:controller => "users", :action => "project_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %></li>
<li><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "project_community", :type => "current_user"},
:class => "homepagePostTypeMine postTypeGrey" %></li>
<li><%= link_to "问题动态", {:controller => "users", :action => "project_community", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%></li>
<li><%= link_to "论坛动态", {:controller => "users", :action => "project_community", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>
<li><%= link_to "个人留言", {:controller => "users", :action => "project_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
<% end %>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => { :user_activities => @user_activities, :page => 0, :type => @type,
:user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>

View File

@ -1,6 +1,6 @@
$("#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),
$("#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 => "project_community"} )%>");

View File

@ -0,0 +1,6 @@
$("#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 => "project_community"} )%>");

View File

@ -0,0 +1,6 @@
$("#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 => "project_community"} )%>");

View File

@ -0,0 +1,11 @@
class CreateDataExceptions < ActiveRecord::Migration
def change
create_table :data_exceptions do |t|
t.string :message
t.integer :container_id
t.string :container_type
t.timestamps
end
end
end

View File

@ -0,0 +1,14 @@
class DeleteCourseActivities < ActiveRecord::Migration
def up
course_acts = CourseActivity.where(:course_id => 844, :user_id => 10096, :course_act_id => 436, :course_act_type => 'Poll')
if course_acts.count > 1
course_acts.limit(course_acts.count - 1).each do |act|
act.delete
end
end
end
def down
end
end

View File

@ -0,0 +1,50 @@
namespace :gitlab do
desc "make sure trustie'data consistent with gitlab's data"
task :sync_data => :environment do
s = Trustie::Gitlab::Sync.new
g = Gitlab.client
projects = Project.where("gpid is not null and status=?", 1)
projects.each do |project|
# sync members and roles
begin
if project.members.count != g.team_members(project.gpid).count
project.members.each do |m|
begin
gid = m.user.gid
if gid.nil?
gid = s.sync_user(m.user).id
end
access_level = m.roles[0].position == 3 ? 40 : (m.roles[0].position == 4 ? 30 : 20)
# sync project's members
g.add_team_member(project.gpid, gid, access_level)
# sync members' roles
g.edit_team_member(project.gpid, gid, access_level)
rescue Exception => e
DataException.create(:message => e.message, :container_id => project.id, :container_type => "Project")
puts e
end
end
end
rescue Exception => e
puts e
end
end
users = User.where("gid is not null and status =?", 1)
users.each do |user|
begin
# sync username
g.edit_user(user.gid, :username => user.login) if user.login != g.user(user.gid).try(:username)
# sync email
g.edit_user(user.gid, :email => user.mail) if user.mail != g.user(user.gid).try(:email)
# sync password
options = {:encrypted_password=> user.hashed_password, :password_salt=> user.salt}
g.put("/users/ext/#{user.gid}", :body => options)
rescue Exception => e
puts e
end
end
end
end

View File

@ -1,6 +1,4 @@
.ke-content {
font-size: 14px;
/*font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;*/
font-family: "微软雅黑","宋体";
}
.ke-content pre {

View File

@ -2201,3 +2201,12 @@ function archive_course(id, type, source){
}
}
//判断是不是IE浏览器
function is_IE(){
if(navigator.userAgent.toLowerCase().indexOf('msie') > -1){
return true;
}else{
return false;
}
}

View File

@ -834,6 +834,10 @@ a:hover.sy_btn_pink{ background: #e64c4c;}
}
.ke-block ol li{list-style-type: decimal;margin-left: 40px;}
.ke-block ul li{list-style-type: disc;margin-left: 40px;}
.ke-block{font-size: 14px;}
.ke-block h1{font-size: 2em;}
.ke-block h2{font-size: 1.5em;}
.ke-block h3{font-size: 1.17em;}
a.export_icon{background: url(/images/item.png) -58px -30px no-repeat; width: 45px; float: left; line-height: 41px; font-size: 14px; margin-top: -5px;}
a.export_icon:hover {background: url(/images/item.png) -58px -60px no-repeat;}

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe DataException, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end