Merge branch 'develop' into rep_quality

This commit is contained in:
huang 2016-08-30 11:18:49 +08:00
commit bbe44b3957
26 changed files with 68 additions and 49 deletions

View File

@ -325,7 +325,7 @@ class FilesController < ApplicationController
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
show_attachments @containers
get_attachment_for_tip(@all_attachments)
# get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments
@ -378,7 +378,7 @@ class FilesController < ApplicationController
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
show_attachments @containers
get_attachment_for_tip(@all_attachments)
# get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments

View File

@ -229,7 +229,7 @@ class MembersController < ApplicationController
user_ids.each do |user_id|
member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id)
role_ids = attrs.delete(:role_ids)
role_ids = params[:membership][:role_ids]
#role = Role.find(params[:membership][:role_ids])
# 这里的判断只能通过角色名,可以弄成常量
if role_ids && role_ids.include?("10")

View File

@ -2524,7 +2524,7 @@ module ApplicationHelper
def footer_logo(ul_class=nil, li_class=nil)
logos = []
logos.push(link_to image_tag('/images/footer_logo/nudt.png',:alt=>"nudt"),"http://www.nudt.edu.cn/special.asp?classid=12" )
logos.push(link_to image_tag('/images/footer_logo/peking_eecs.png', :alt=>"peking_eecs"), "http://eecs.pku.edu.cn" )
logos.push(link_to image_tag('/images/footer_logo/peking_eecs.png', :alt=>"peking_eecs"), "http://www.sei.pku.edu.cn/" )
logos.push(link_to image_tag('/images/footer_logo/buaa_scse.png', :alt=>"buaa_scse"), "http://scse.buaa.edu.cn/" )
logos.push(link_to image_tag('/images/footer_logo/iscas.png', :alt=>"iscas"), "http://www.iscas.ac.cn" )
logos.push(link_to image_tag('/images/footer_logo/inforbus.png', :alt=>"inforbus"), "http://www.inforbus.com" )

View File

@ -7,7 +7,7 @@ module OrgMemberHelper
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, host_with_protocol + "/org_member/org_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js').to_query, :remote => true
}

View File

@ -52,6 +52,9 @@ class Member < ActiveRecord::Base
ids += member_roles.select {|mr| !mr.inherited_from.nil?}.collect(&:role_id)
new_role_ids = ids - role_ids
if (new_role_ids.include?(7) || new_role_ids.include?(9)) && role_ids.include?(10)
member_roles.where("role_id = 10").first.update_column('is_current', 0)
end
# Add new roles
if new_role_ids.include?(7) && new_role_ids.include?(10)
member_roles << MemberRole.new(:role_id => 7)

View File

@ -115,21 +115,22 @@
</div>
<div class="cl"></div>
<div class="re_con_top">
<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">
<%= render :partial => "files/tip_attachment_count" %>
<!--<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">-->
<!--<%#= render :partial => "files/tip_attachment_count" %>-->
<!--</p>-->
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080" id="course_filter_order">
<%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %>
</p>
<p class="f_r" style="color: #808080" id="course_filter_order">
<%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %>
</p>
</div>
</div>
<div class="cl"></div>
<div class="resource_tip_box fontGrey2">
<em></em>
<span></span>
<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>
<p>公共资源:<br/>对所有用户可见</p>
</div>
<!--<div class="resource_tip_box fontGrey2">-->
<!--<em></em>-->
<!--<span></span>-->
<!--<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>-->
<!--<p>公共资源:<br/>对所有用户可见</p>-->
<!--</div>-->
</div>
<div id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>

View File

@ -85,9 +85,10 @@
</div>
<div class="cl"></div>
<div class="re_con_top">
<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">
<%= render :partial => "files/tip_attachment_count" %>
</p>
<!--<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">-->
<!--<%#= render :partial => "files/tip_attachment_count" %>-->
<!--</p>-->
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count%></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080">
<% if @order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
@ -102,14 +103,14 @@
</div>
</div>
<div class="cl"></div>
<% if !User.current.member_of?(@project) && show_attachment_tip(@project.id, "Project") %>
<div class="resource_tip_box fontGrey2">
<em></em>
<span></span>
<p class="mb5">私有资源:<br/>仅对本项目成员可见</p>
<p>公共资源:<br/>对所有用户可见</p>
</div>
<% end %>
<%# if !User.current.member_of?(@project) && show_attachment_tip(@project.id, "Project") %>
<!--<div class="resource_tip_box fontGrey2">-->
<!--<em></em>-->
<!--<span></span>-->
<!--<p class="mb5">私有资源:<br/>仅对本项目成员可见</p>-->
<!--<p>公共资源:<br/>对所有用户可见</p>-->
<!--</div>-->
<%# end %>
</div>
<div id="course_list">
<%= render :partial => 'project_list',:locals => {project: @project, all_attachments: @all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments} %>

View File

@ -3,6 +3,6 @@
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
<% else %>
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
// $("#tip_attachment_count").html("<%#= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
<% end %>

View File

@ -0,0 +1,5 @@
<% count = @issue.journals.count %>
回复<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=@issue.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@issue, :user_activity_id=>@issue.id,:type=>"activity"}%>
</span>

View File

@ -17,5 +17,5 @@ issue_desc_editor = KindEditor.create('#issue_description',
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>');
$(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%= @issue.class.name %>");

View File

@ -36,7 +36,9 @@
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= @issue.journals.count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" >
<div class="homepagePostReplyBannerCount" >回复(<%= @issue.journals.count %></div>
<div class="homepagePostReplyBannerCount">
<%=render :partial => 'issue_reply_banner' %>
</div>
<div class="homepagePostReplyBannerTime"></div>
</div>
<div class="" id="reply_div_<%= @issue.id %>" >

View File

@ -26,7 +26,7 @@
<%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank" %>
</span>
<span class="footer_logo_link">
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>l(:label_co_organizer_EECS)), "http://eecs.pku.edu.cn", :target => "_blank" %>
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>l(:label_co_organizer_EECS)), "http://www.sei.pku.edu.cn/", :target => "_blank" %>
</span>
<span class="footer_logo_link">
<%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank" %>

View File

@ -24,7 +24,7 @@
<a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=41" class="mr45 f_grey" target="_blank"><%= l(:label_sponsor)%></a>
</li>
<li class="fl mr10">
<strong><%= l(:label_partners)%></strong><a href="http://eecs.pku.edu.cn" class="ml10 f_grey" target="_blank"><%= l(:label_co_organizer_EECS)%></a>
<strong><%= l(:label_partners)%></strong><a href="http://www.sei.pku.edu.cn/" class="ml10 f_grey" target="_blank"><%= l(:label_co_organizer_EECS)%></a>
</li>
<li class="fl">
<a href="http://scse.buaa.edu.cn/" class="mr10 f_grey" target="_blank"><%= l(:label_co_organizer_BHU)%></a>

View File

@ -2,7 +2,7 @@
<% teacher_num = TeacherAndAssistantCount(@course) %>
<% student_num = studentCount(@course) %>
<% course_file_num = visable_attachemnts_incourse(@course).count %>
<p class="sy_cgrey mb10">
<p class="sy_cgrey mb10 mr20">
<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cgrey') %>
&nbsp;&gt;&nbsp;
<% if @course.syllabus %>

View File

@ -22,7 +22,7 @@
<strong><%= l(:label_partners)%></strong>
</li>
<li class="fl mr20">
<a href="http://eecs.pku.edu.cn" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
<a href="http://www.sei.pku.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
</li>
<li class="fl mr20">
<a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a>

View File

@ -22,7 +22,7 @@
<strong><%= l(:label_partners)%></strong>
</li>
<li class="fl mr20">
<a href="http://eecs.pku.edu.cn" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
<a href="http://www.sei.pku.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
</li>
<li class="fl mr20">
<a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a>

View File

@ -13,7 +13,7 @@
<%= link_to image_tag('/images/footer_logo/nudt.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_NUDT)),"http://www.nudt.edu.cn/special.asp?classid=12", :target => "_blank"%>
</li>
<li class="fl mr20">
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_EECS)), "http://eecs.pku.edu.cn", :target => "_blank"%>
<%= link_to image_tag('/images/footer_logo/peking_eecs.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_EECS)), "http://www.sei.pku.edu.cn/", :target => "_blank"%>
</li>
<li class="fl mr20">
<%= link_to image_tag('/images/footer_logo/buaa_scse.png',:style => "width:90px;height:30px;",:alt=>l(:label_co_organizer_BHU)), "http://scse.buaa.edu.cn/", :target => "_blank"%>

View File

@ -1,6 +1,6 @@
<%# course_model %>
<%# course_file_num = visable_attachemnts_incourse(@course).count%>
<% course_file_num = Attachment.where(:container_type => "Course", :container_id => @course.id).count %>
<% course_file_num = visable_attachemnts_incourse(@course).count%>
<%# course_file_num = Attachment.where(:container_type => "Course", :container_id => @course.id).count %>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
<% homework_num = visable_course_homework @course %>
@ -131,10 +131,13 @@
<%= render :partial => 'courses/course_activity_users', :locals => {:course => @course} %>
<%# 课程英雄榜 %>
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
<div class="sy_class_leftbox mb15" >
<div class="sy_class_leftbox" >
<h3 class="fontGrey7">班级推荐</h3>
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @course %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @course.visits.to_i %> 自2016年5月</div>
</div><!--sy_class_l end-->
<div class="fl">
<%= yield %>

View File

@ -110,8 +110,10 @@
</div>
</div>
<% else %>
<a href="javascript:void(0)" class="user_leftinfo_img"><%=image_tag(url_to_avatar(@user),width:"74", height: "74")%></a>
<% end %>
<a href="javascript:void(0)" class="user_leftinfo_img" style="cursor: default">
<%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_source_tx') %>
</a>
<% end %>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender == 1 ? 'user_leftinfo_female' : 'user_leftinfo_male' %> "></span>
<% end %>
@ -214,6 +216,8 @@
</ul>
</div><!--sy_class_leftnav end-->
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<div class="fontGrey5 mt10 ml20">访问计数 <%= @user.visits.to_i %> 自2016年5月</div>
</div>
<div class="homepageRight">

View File

@ -32,8 +32,8 @@
<% end %>
</li>
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left" onclick="$(this).parent().height();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
<a href="javascript:void(0)" style = "color: #0781B4;margin-left: 30px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</a>
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 10px;float: left" onclick="$(this).parent().height();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
<a href="javascript:void(0)" style = "color: #0781B4;margin-left: 10px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</a>
<%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
<div class="cl"></div>
</ul>

View File

@ -106,7 +106,7 @@
<%= render :partial=>"org_member_list",:locals=> {:members=>@organization.org_members} %>
</div>
</div>
<div class="fr orgMemContainer">
<div class="fl ml10 orgMemContainer">
<div class="orgMemberAdd">
<p class="fontBlue fb mb5">添加成员</p>
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -398,7 +398,7 @@ a:hover.c_grey{ color:#333;}
.fontGrey2 {color:#888888;}
.fontGrey3 {color:#484848;}
.fontGrey4{color:#999999;}
.fontGrey5 {color:#a1a1a1;}
.fontGrey5 {color:#ddd;}
.fontGrey6 {color:#7a7a7a;}
.fontGrey7 {color:#555;}
.fontBlue {color:#3498db;}

View File

@ -17,14 +17,14 @@
.orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;}
a.saveBtn {padding:2px 10px; background-color:#269ac9; color:#ffffff;}
a.saveBtn:hover {background-color:#297fb8;}
.orgMemberList {width:420px; float:left;}
.orgMemberList {width:300px; float:left;}
.orgColumnList {width:688px; float:left;}
.orgListUser {width:110px; float:left;padding-right: 10px;}
.orgListRole {width:180px; float:left;}
.orgListRole {width:100px; float:left;}
.orgOrder {width:70px; float:left; text-align:center;}
.orgSubNum {width:30px; float:left; text-align:center;}
.subNumBlock {cursor:pointer;background-color:#fffce6;color: #0d90c3; width:30px; height:17px; line-height:17px; margin:7px 0; vertical-align:middle;}
.orgMemContainer {width:268px;}
.orgMemContainer {width:378px;}
.orgMemberAdd {float:right;}
.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;}

View File

@ -199,7 +199,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostBrief {width:720px; margin:0px auto; position:relative;}
.homepagePostPortrait {float:left; width:50px;}
.homepagePostDes {float:left; width:655px; margin-left:15px; overflow:hidden;}
.homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;}
.homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px; margin-right: 20px;}
.homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;}
.homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;}
.homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;}