Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-06-06 12:13:37 +08:00
commit e52751f5e0
7 changed files with 39 additions and 37 deletions

View File

@ -365,15 +365,18 @@ class ProjectsController < ApplicationController
def invite_members_by_mail def invite_members_by_mail
if User.current.member_of?(@project) || User.current.admin? if User.current.member_of?(@project) || User.current.admin?
@inviter_lists = InviteList.where(project_id:@project.id).all @inviter_lists = InviteList.where(project_id:@project.id).all
@inviters = []
@waiters = []
unless @inviter_lists.blank? unless @inviter_lists.blank?
@inviter_lists.each do|inviter_list| @inviter_lists.each do|inviter_list|
@inviters = [] unless inviter_list.user.nil?
@waiters = [] if inviter_list.user.member_of?(@project)
@inviters << inviter_list.user @inviters << inviter_list.user
@inviters_count = @inviters.size @inviters_count = @inviters.size
unless inviter_list.user.member_of?(@project) else
@waiters << inviter_list.user @waiters << inviter_list.user
@waiters_count = @waiters.size @waiters_count = @waiters.size
end
end end
end end
end end

View File

@ -199,8 +199,8 @@ class Mailer < ActionMailer::Base
@title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}" @title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
@issue_author_url = url_for(user_activities_url(@user)) @issue_author_url = url_for(user_activities_url(@user))
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型 @url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
when :Bid # when :Bid
course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") # course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project when :Project
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
@ -236,12 +236,12 @@ class Mailer < ActionMailer::Base
mail :to => @recipients, mail :to => @recipients,
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} ", :subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} ",
:filter => true :filter => true
elsif journals_for_message.jour.class.to_s.to_sym == :Bid # elsif journals_for_message.jour.class.to_s.to_sym == :Bid
if !journals_for_message.jour.author.notify_about? journals_for_message # if !journals_for_message.jour.author.notify_about? journals_for_message
return -1 # return -1
end # end
#
mail :to => recipients, :subject => @title,:filter => true # mail :to => recipients, :subject => @title,:filter => true
elsif journals_for_message.jour.class.to_s.to_sym == :Contest elsif journals_for_message.jour.class.to_s.to_sym == :Contest
if !journals_for_message.jour.author.notify_about? journals_for_message if !journals_for_message.jour.author.notify_about? journals_for_message
return -1 return -1

View File

@ -39,7 +39,7 @@
<% end %> <% end %>
<!--课程作业--> <!--课程作业-->
<% if !@bids.first.nil? %> <% unless @bids.empty? %>
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;"> <ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:720px; margin-bottom:15px;">
<h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;"><%= l(:label_homework_overview) %><span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @bids.count %>)</span></h4> <h4 class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;"><%= l(:label_homework_overview) %><span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @bids.count %>)</span></h4>
<% unless @bids.first.nil?%> <% unless @bids.first.nil?%>
@ -48,20 +48,20 @@
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span> <span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">[</span>
<%= link_to truncate(bid.courses.first.name,length: 30,omission: '...'), course_url(bid.courses.first, :token => @token.value), <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value),
:class=> "wmail_column", :class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span> <span class="wmail_b" style="color:#1b55a7; font-weight:bold; float:left;">]</span>
<%= link_to bid.author, user_activities_url(bid.author,:token => @token.value), :class => "wmail_name", <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_course_homework) %></span> <span class="wmail_txt" style="float:left; margin-right:5px;color:#6e6e6e;"><%= l(:label_course_homework) %></span>
<%= link_to truncate(bid.name,length: 30,omission: '...'), course_for_bid_url(:id => bid.id,:token => @token.value), <%= link_to truncate(bid.name,length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value),
:class => 'wmail_info', :class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%> %>
<span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(bid.created_on) %></span> <span class="wmail_date" style="color:#6e6e6e; float:right;display:block; margin-left:10px;"><%= format_time(bid.created_at) %></span>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>
@ -138,7 +138,6 @@
<%= l(:label_course_attendingcontestwork_download) %> <%= l(:label_course_attendingcontestwork_download) %>
<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @attachments.count %>)</span> <span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%= @attachments.count %>)</span>
</h4> </h4>
<% @attachments.each do |attachment|%> <% @attachments.each do |attachment|%>
<li style="clear: both; list-style: none;"> <li style="clear: both; list-style: none;">
<span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span> <span class="wmail_dis" style="float:left; color:#000000; margin-right:5px;">▪</span>

View File

@ -27,27 +27,27 @@
<% end %> <% end %>
<% end %> <% end %>
<% if !@bids.first.nil? %> <% unless @bids.empty? %>
<%= l(:label_homework_overview) %><%= @bids.count %> <%= l(:label_homework_overview) %><%= @bids.count %>
<% unless @bids.first.nil?%> <% unless @bids.first.nil?%>
<% @bids.each do |bid| %> <% @bids.each do |bid| %>
[ [
<%= link_to truncate(bid.courses.first.name,length: 30,omission: '...'),course_url(bid.courses.first, :token => @token.value) <%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
%> %>
] ]
<%= link_to bid.author, user_activities_url(bid.author,:token => @token.value) <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value)
%> %>
<%= l(:label_course_homework) %> <%= l(:label_course_homework) %>
<%= link_to truncate(bid.name,length: 30,omission: '...'), course_for_bid_url(bid,:token => @token.value) <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
%> %>
<%= format_time(bid.created_on) %> <%= format_time(bid.created_at) %>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -80,19 +80,17 @@
<%# 邀请用户的状态 %> <%# 邀请用户的状态 %>
<% unless @inviter_lists.blank? %> <% unless @inviter_lists.blank? %>
<div> <div>
<% if @inviters_count > 0 %> <% unless @inviters_count.nil? %>
<span class="status_inviter">已邀请的用户</span><br/> <span class="status_inviter">已加入项目的用户</span><br/>
<% @inviter_lists.each do |inviter_list| %> <% @inviters.each do |inv| %>
<%= inviter_list.user.name unless inviter_list.user.nil? %><br/> <%= inv.name unless inv.nil? %><br/>
<% end %> <% end %>
<% end %> <% end %>
</br> </br>
<% unless @waiters_count.nil? %> <% unless @waiters_count.nil? %>
<span class="status_inviter">等待加入项目的用户</span><br/> <span class="status_inviter">等待加入项目的用户</span><br/>
<% @inviter_lists.each do |inviter_list| %> <% @waiters.each do |wai| %>
<% unless inviter_list.user.member_of?(@project) %> <%= wai.name unless wai.nil?%><br/>
<%= inviter_list.user.name unless inviter_list.user.nil? %><br/>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>

View File

@ -6,13 +6,15 @@
<span> <span>
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</span> </span>
<% else%>
<span class="ml30">--</span>
<% end%> <% end%>
</li> </li>
<li class="hwork_name"> <li class="hwork_name">
<% if is_my_work%> <% if is_my_work%>
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name %> <%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02" %>
<% else%> <% else%>
<%= link_to "匿名","javascript:void(0)"%> <%= link_to "匿名","javascript:void(0)", :class => "c_blue02"%>
<% end%> <% end%>
</li> </li>
<li class=" hwork_tit_e" style="width: 410px"> <li class=" hwork_tit_e" style="width: 410px">

View File

@ -6,7 +6,7 @@
</span> </span>
</li> </li>
<li class=" hwork_name "> <li class=" hwork_name ">
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name%> <%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li> </li>
<li class=" hwork_tit"> <li class=" hwork_tit">
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%> <%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>