Merge branch 'develop' into cxt_course

This commit is contained in:
cxt 2016-09-12 08:54:30 +08:00
commit 9bc40d2fad
26 changed files with 90 additions and 57 deletions

View File

@ -372,7 +372,8 @@ class ApplicationController < ActionController::Base
return true return true
end end
if allowed
if allowed || (params[:type] && params[:type] == "wechat" )
true true
else else
if @project && @project.archived? if @project && @project.archived?

View File

@ -130,7 +130,12 @@ class AttachmentsController < ApplicationController
def download def download
# modify by nwb # modify by nwb
# 下载添加权限设置 # 下载添加权限设置
candown = attachment_candown @attachment if (params[:type] && params[:type] == "wechat" )
candown = true
else
candown = attachment_candown @attachment
end
if candown || User.current.admin? || User.current.id == @attachment.author_id if candown || User.current.admin? || User.current.id == @attachment.author_id
if stale?(:etag => @attachment.digest) if stale?(:etag => @attachment.digest)
if params[:preview] == 'true' if params[:preview] == 'true'
@ -710,7 +715,7 @@ class AttachmentsController < ApplicationController
def has_login def has_login
unless (@attachment && @attachment.container_type == "Organization").nil? unless (@attachment && @attachment.container_type == "Organization").nil?
unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil? unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil?
render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) render_403 if (!User.current.logged? && !(params[:type] && params[:type] == "wechat")) && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download)
end end
end end
end end

View File

@ -132,16 +132,13 @@ class IssuesController < ApplicationController
User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!} User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!}
end end
# 缺陷状态更新 # 缺陷状态消息更新
query_journals = @issue.journals query_journals_ids = @issue.journals.map{|journal| journal.id}
query_journals.each do |query_journal| if query_journals_ids.length > 0
query_journal.forge_messages.each do |f| query_journals = ForgeMessage.where("user_id =? and forge_message_type =? and forge_message_id in (#{query_journals_ids.join(",")})", User.current.id, "Journal")
if User.current.id == f.user_id query_journals.update_all(:viewed => true)
f.update_attributes(:viewed => true) end
end
end
end
# end
@jour_reply = Journal.new @jour_reply = Journal.new
@journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all @journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all
@journals.each_with_index {|j,i| j.indice = i+1} @journals.each_with_index {|j,i| j.indice = i+1}

View File

@ -88,7 +88,7 @@ class OrganizationsController < ApplicationController
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
project_ids = (@organization.projects.map(&:id) - shield_project_ids) << 0 project_ids = (@organization.projects.map(&:id) - shield_project_ids) << 0
course_ids = (@organization.courses.map(&:id) - shield_course_ids) << 0 course_ids = (@organization.courses.not_deleted.map(&:id) - shield_course_ids) << 0
course_types = "('Message','News','HomeworkCommon','Poll','Course')" course_types = "('Message','News','HomeworkCommon','Poll','Course')"
@project_acts = get_project_activities_org @organization, project_ids @project_acts = get_project_activities_org @organization, project_ids
@course_acts = get_course_activities_org @organization, course_ids @course_acts = get_course_activities_org @organization, course_ids
@ -140,7 +140,7 @@ class OrganizationsController < ApplicationController
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0 project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0
course_ids = (@organization.courses.map(&:id)-shield_course_ids) << 0 course_ids = (@organization.courses.not_deleted.map(&:id)-shield_course_ids) << 0
course_types = "('Message','News','HomeworkCommon','Poll','Course')" course_types = "('Message','News','HomeworkCommon','Poll','Course')"
case params[:type] case params[:type]
when nil when nil

View File

@ -252,7 +252,7 @@ class QualityAnalysisController < ApplicationController
unresolved_issue_count = JSON.parse(unresolved_issues)["total"].to_i unresolved_issue_count = JSON.parse(unresolved_issues)["total"].to_i
all_issues = open(@sonar_address + "/api/issues/search?projectKeys=#{@resource_id}&authors=#{email}").read all_issues = open(@sonar_address + "/api/issues/search?projectKeys=#{@resource_id}&authors=#{email}").read
all_issue_count = JSON.parse(all_issues)["total"].to_i all_issue_count = JSON.parse(all_issues)["total"].to_i
ratio = (changes == 0 ? 0 : format("%0.4f",unresolved_issue_count.to_f/changes.to_f)) ratio = ((changes == 0 || all_issue_count == 0) ? 0 : format("%0.4f",all_issue_count.to_f/changes.to_f))
@user_quality_infos << {:email => email, :changes => changes, :unresolved_issue_count => unresolved_issue_count, :ratio => ratio, :all_issue_count => all_issue_count} @user_quality_infos << {:email => email, :changes => changes, :unresolved_issue_count => unresolved_issue_count, :ratio => ratio, :all_issue_count => all_issue_count}
end end

View File

@ -417,13 +417,13 @@ module ApplicationHelper
end end
# status_id3、已解决 5、已关闭 # status_id3、已解决 5、已关闭
if issue.status_id == 3 if issue.status_id == 3
s = link_to text, issue_path(issue), :class => "text_line_s", :title => title s = link_to text, issue_path(issue), :class => "text_line_s fl", :title => title
elsif issue.status_id == 5 elsif issue.status_id == 5
s = link_to text, issue_path(issue), :class => "text_line_s del_line", :title => title s = link_to text, issue_path(issue), :class => "text_line_s del_line fl", :title => title
else else
s = link_to text, issue_path(issue), :class => "c_blue", :title => title s = link_to text, issue_path(issue), :class => "c_blue fl", :title => title
end end
s << h(": #{subject}") if subject s << h("<span style='width:450px;display:inline-block;' class='hidden'>: #{subject}</span>".html_safe) if subject
s = h("#{issue.project} - ") + s if options[:project] s = h("#{issue.project} - ") + s if options[:project]
s s
end end
@ -652,7 +652,7 @@ module ApplicationHelper
s << watcher_link(@project, User.current)#, ['whiteButton']) s << watcher_link(@project, User.current)#, ['whiteButton'])
s << "</span>" s << "</span>"
end end
s << (render :partial => 'projects/project', :locals => {:project => project}).to_s s << (render :partial => 'projects/tracker_project', :locals => {:project => project}).to_s
else else
s << (render :partial => 'projects/course', :locals => {:project => project}).to_s s << (render :partial => 'projects/course', :locals => {:project => project}).to_s
end end
@ -832,9 +832,15 @@ module ApplicationHelper
atts.count > 0 ? true :false atts.count > 0 ? true :false
end end
# 必须是项目成,项目必须提交过代码 # 如果Pull Request数量为0就显示在更多中
def allow_show_pull_request project
g = Gitlab.client
count = g.merge_requests(project.gpid).count
end
# 必须是项目成员,项目必须提交过代码
def allow_pull_request project def allow_pull_request project
return false if project.gpid.nil? return 0 if project.gpid.nil?
g = Gitlab.client g = Gitlab.client
count = g.user_static(project.gpid, :rev => "master").count count = g.user_static(project.gpid, :rev => "master").count
count count

View File

@ -64,7 +64,6 @@
<td class="buttons"> <td class="buttons">
<%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %> <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %>
<%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %> <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %>
<%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %>
<%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del', :onClick=>"delcfm()" ) %> <%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del', :onClick=>"delcfm()" ) %>
</td> </td>
</tr> </tr>

View File

@ -78,5 +78,12 @@
<div class="cl"></div> <div class="cl"></div>
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %> <%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %> <% end %>
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();location.reload()" class="blue_btn fl ml80" id="issue_confirm"> 确定</a> <a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="blue_btn fl ml80" id="issue_confirm"> 确定</a>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50 ml10" > 取消 </a> <% if params[:action] == "new" %>
<% if @copy_from %>
<%= link_to "取消", issue_path(@copy_from), :class => "grey_btn fl mr50 ml10" %>
<% end %>
<% else %>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50 ml10" > 取消 </a>
<% end %>

View File

@ -1,8 +1,5 @@
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue}) %>");
$("#issue_detail_show").html('<%= escape_javascript(render :partial => 'issues/detail') %>') location.reload();
$("#issue_edit_show").html('<%= escape_javascript(render :partial => 'issues/edit') %>')
$("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => @issue}) %>");
sd_create_editor_from_data(<%= @issue.id %>, null, "100%", "<%= @issue.class.name %>");
issue_desc_editor = KindEditor.create('#issue_description', issue_desc_editor = KindEditor.create('#issue_description',
{"width":"85%", {"width":"85%",
"resizeType":0, "resizeType":0,
@ -17,5 +14,3 @@ issue_desc_editor = KindEditor.create('#issue_description',
"uploadJson":"/kindeditor/upload", "uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"}); "fileManagerJson":"/kindeditor/filemanager"});
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
$(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%= @issue.class.name %>");

View File

@ -1,12 +1,5 @@
<% if @saved %> <% if @saved %>
$("#issue_detail").replaceWith('<%= escape_javascript(render :partial => 'issues/detail') %>') location.reload();
$("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>')
$("#issue_detail").show();
$("#issue_edit").hide();
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
$(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
//edit里的编辑器貌似显示不出来所以手动js生成。 //edit里的编辑器貌似显示不出来所以手动js生成。
issue_desc_editor = KindEditor.create('#issue_description', issue_desc_editor = KindEditor.create('#issue_description',
{"width":"85%", {"width":"85%",
@ -31,6 +24,7 @@ issue_desc_editor = KindEditor.create('#issue_description',
// "allowFileManager":true, // "allowFileManager":true,
// "uploadJson":"/kindeditor/upload", // "uploadJson":"/kindeditor/upload",
// "fileManagerJson":"/kindeditor/filemanager"}); // "fileManagerJson":"/kindeditor/filemanager"});
<%else%> <%else%>
alert('<%= @issue.errors.full_messages[0].to_s%>') alert('<%= @issue.errors.full_messages[0].to_s%>')
<%end %> <%end %>

View File

@ -138,7 +138,7 @@
<li><a href="<%=news_path(ma.forge_message.commented.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>评论了新闻:<%= ma.forge_message.commented.title%></a></li> <li><a href="<%=news_path(ma.forge_message.commented.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>评论了新闻:<%= ma.forge_message.commented.title%></a></li>
<% end %> <% end %>
<% elsif ma.class == MemoMessage %> <% elsif ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %> <% if ma.memo_type == "Memo" && !ma.memo.nil? && !ma.memo.author.nil? %>
<li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%></a></li> <li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%></a></li>
<% end %> <% end %>
<% elsif ma.class == UserFeedbackMessage %> <% elsif ma.class == UserFeedbackMessage %>

View File

@ -2,10 +2,10 @@
<li> <li>
<span class="user_icons_class"></span> <span class="user_icons_class"></span>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu hidden" title="<%= course.syllabus.title+' · '+(course.is_public? ? '公开班级:' : '私有班级:')+course.name+''+current_time_and_term(course)+'' %>"> <p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu" title="<%= course.syllabus.title+' · '+(course.is_public? ? '公开班级:' : '私有班级:')+course.name+''+current_time_and_term(course)+'' %>">
<%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank'%> <%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>
&nbsp;<font class="fb">·</font>&nbsp; <font class="fb c_grey" style="height:39px; line-height:39px; vertical-align:top;">·</font>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank'%> <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>
</p> </p>
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), <%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%> :id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
@ -104,4 +104,13 @@
$("#user_show_more_course").hide(); $("#user_show_more_course").hide();
$('#user_hide_course').show(); $('#user_hide_course').show();
} }
$(".course_list_menu").each(function(){
var courseWidth = $(this).children().eq(0).width();
var classWidth = 170 -courseWidth;
console.log(courseWidth, classWidth);
if(courseWidth < 80){
$(this).children().eq(2).css("max-width",classWidth + "px");
}
})
</script> </script>

View File

@ -147,7 +147,7 @@
</ul> </ul>
</div> </div>
<div id="watch_user_btn_div"> <div id="watch_user_btn_div">
<a href="javascript:void(0);" class="user_editinfo" disabled="true">编辑个人资料</a> <%= link_to "编辑个人资料", my_account_path(:tip => 1), :class => "user_editinfo"%>
</div> </div>
</div> </div>

View File

@ -90,7 +90,7 @@
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div> <div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= h reply.content.html_safe%></div> <div class="homepagePostReplyContent break_word" id="activity_description_<%= reply.id %>"><%= h reply.content.html_safe%></div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){

View File

@ -41,7 +41,7 @@
</div> </div>
<% end %> <% end %>
<% if allow_pull_request(@project) %> <% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) > 0 %>
<div class="subNav"> <div class="subNav">
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %> <%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>

View File

@ -1,3 +1,8 @@
<li>
<% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) == 0 %>
<%= link_to "Pull Requests", project_pull_requests_path(@project) %>
<% end %>
</li>
<li> <li>
<% unless @project.enabled_modules.where("name = 'news'").empty? %> <% unless @project.enabled_modules.where("name = 'news'").empty? %>
<%= link_to l(:project_module_news), project_news_index_path(@project) %> <%= link_to l(:project_module_news), project_news_index_path(@project) %>

View File

@ -0,0 +1,6 @@
<div class="project-block">
<div class="wiki-description">
<p><%= textilizable(project.short_description.strip, :project => project) %></p>
</div>
</div>

View File

@ -37,16 +37,17 @@
<% else %> <% else %>
<% projects.each_with_index do |project, i| %> <% projects.each_with_index do |project, i| %>
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;"> <div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;">
<% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public == 1 %> <% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public? %>
<div class="sy_courses_open"> <div class="sy_courses_open">
<span id="collect_project_icon_<%= project.id %>"> <span id="collect_project_icon_<%= project.id %>">
<%=render :partial => 'collect_project', :locals => {:project => project} %> <%=render :partial => 'collect_project', :locals => {:project => project} %>
</span> </span>
<h3><%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank', <h3><%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank',
:class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %></h3> :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %></h3>
<% unless project.is_public? %> <%# unless project.is_public? %>
<span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span> <!-- <span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span> -->
<% end %> <%# end %>
<span class="<%= project.is_public? ? 'syllabus_class_open' : 'syllabus_class_private' %> fl ml10 mt3 syllabus_class_property"><%= project.is_public? ? '公开' : '私有' %></span>
<% projectUser = User.where("id=?",project.user_id).first %> <% projectUser = User.where("id=?",project.user_id).first %>
<%= link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %> <%= link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,5 +1,5 @@
<% if ma.class == MemoMessage %> <% if ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %> <% if ma.memo_type == "Memo" && !ma.memo.nil? && !ma.memo.author.nil? %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author), :target => '_blank' %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author), :target => '_blank' %></a>

View File

@ -47,6 +47,7 @@
<% issues.each do |issue| -%> <% issues.each do |issue| -%>
<li style="overflow:hidden"> <li style="overflow:hidden">
<%= link_to_issue_version(issue, :project => (@project != issue.project)) %> <%= link_to_issue_version(issue, :project => (@project != issue.project)) %>
<span class="mr5 fr" >指派给:<%= link_to "#{User.find(issue.try(:assigned_to_id)).show_name}", user_path(issue.try(:assigned_to_id)), :class => "c_blue hidden fr", :style => "width:50px;" %></span>
</li> </li>
<% end -%> <% end -%>
</ul> </ul>

View File

@ -230,7 +230,7 @@
</div> </div>
<div ng-class="{'undis': !showResources}"> <div ng-class="{'undis': !showResources}">
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /><span class="fl ml10 resource-width">{{r.filename}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r,1)">发送</a><div class="cl"></div></div> <div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /><a ng-href="{{g_localhost}}/attachments/download/{{r.id}}/{{r.filename}}?type=wechat" target="_blank" class="fl ml10 resource-width">{{r.filename}}</a><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r,1)">发送</a><div class="cl"></div></div>
<p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br /> <p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br />
请登录Trustie网站在PC浏览器中上传课件。</p> 请登录Trustie网站在PC浏览器中上传课件。</p>
</div> </div>

View File

@ -5,7 +5,7 @@
<form novalidate name="classForm"> <form novalidate name="classForm">
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程名称</span><input ng-change="syllabus.change = true" ng-class="['new-class-input ml25', {'c-grey':syllabus.change} ]" ng-model="syllabus.tmptitle" required placeholder="如:软件工程" /></div> <div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">课程名称</span><input ng-change="syllabus.change = true" ng-class="['new-class-input ml25', {'c-grey':syllabus.change} ]" ng-model="syllabus.tmptitle" required placeholder="如:软件工程" /></div>
<div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses" ng-show="course.can_setting"><span class="fl ml15 c-grey3">班级名称</span><input ng-change="course.change = true" required ng-class="['new-class-input ml25', {'c-grey':course.change} ]" ng-model="course.tmpname" placeholder="如:软件工程计算机学院A班" /><a ng-click="deleteClass($index)" class="fr mr10 c-grey6 delete-class-link">删除</a></div> <div class="course-list-row f13 c-grey3 mt10" ng-repeat="course in syllabus.courses" ng-show="course.can_setting"><span class="fl ml15 c-grey3">班级名称</span><input ng-change="course.change = true" required ng-class="['new-class-input ml25', {'c-grey':course.change} ]" ng-model="course.tmpname" placeholder="如:计算机系2016秋季A班" /><a ng-click="deleteClass($index)" class="fr mr10 c-grey6 delete-class-link">删除</a></div>
<div class="tac"><a ng-click="addClass()" class="link-blue2 f13 mt15 inline-block add-class-link">+新增班级</a></div> <div class="tac"><a ng-click="addClass()" class="link-blue2 f13 mt15 inline-block add-class-link">+新增班级</a></div>
<a ng-click="newClass(classForm, syllabus)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a> <a ng-click="newClass(classForm, syllabus)" ng-class="['finish-btn', {'btn-disabled':!classForm.$valid} ]" >完成</a>
</form> </form>

View File

@ -12,7 +12,7 @@
<div ng-class="{'undis': currentTab!=1}"> <div ng-class="{'undis': currentTab!=1}">
<div ng-repeat="r in resources|filter:{filename:searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"> <div ng-repeat="r in resources|filter:{filename:searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]">
<img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /> <span class="fl ml10 resource-width">{{r.filename}}</span><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,1)" class="fr mr10 link-blue2">发送</a><div class="cl"></div> <img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /> <a ng-href="{{g_localhost}}/attachments/download/{{r.id}}/{{r.filename}}?type=wechat" target="_blank" class="fl ml10 resource-width">{{r.filename}}</a><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,1)" class="fr mr10 link-blue2">发送</a><div class="cl"></div>
<span class="f12 mt5 ml35 c-grey4 fl courseware-from-width hidden">课件来源:{{r.coursename}}</span><span class="f12 ml10 mt5 c-grey4 fl">大小:{{r.attafile_size}}</span><div class="cl"></div> <span class="f12 mt5 ml35 c-grey4 fl courseware-from-width hidden">课件来源:{{r.coursename}}</span><span class="f12 ml10 mt5 c-grey4 fl">大小:{{r.attafile_size}}</span><div class="cl"></div>
</div> </div>
<div ng-if="has_more"> <div ng-if="has_more">

View File

@ -6,6 +6,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
}; };
var vm = $scope; var vm = $scope;
vm.g_localhost = window.g_localhost;
var courseid = $routeParams.id; var courseid = $routeParams.id;
var tag = $routeParams.tag; var tag = $routeParams.tag;

View File

@ -3,6 +3,9 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
var vm = $scope; var vm = $scope;
// vm.menus = ['课件', '作业', '测验']; // vm.menus = ['课件', '作业', '测验'];
vm.g_localhost = window.g_localhost;
vm.menus = ['课件', '作业']; vm.menus = ['课件', '作业'];
vm.resources = []; vm.resources = [];

View File

@ -599,6 +599,7 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
.user_sub_menu li p {padding:0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;} .user_sub_menu li p {padding:0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;}
.user_sub_menu li p:hover {background:#fff;} .user_sub_menu li p:hover {background:#fff;}
.user_sub_menu li p:hover a {background:#fff;} .user_sub_menu li p:hover a {background:#fff;}
.user_sub_menu li p:hover,.user_sub_menu li p:target {color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;}
.users_accordion li > .user_sub_menu { .users_accordion li > .user_sub_menu {
display: none; display: none;
} }