diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index 1e58c53f1..ccdf80464 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -130,7 +130,7 @@ class MyController < ApplicationController
@user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
set_language_if_valid @user.language
- flash[:notice] = l(:notice_account_updated)
+ flash.now[:notice] = l(:notice_account_updated)
redirect_to user_path(@user)
return
else
@@ -160,7 +160,7 @@ class MyController < ApplicationController
@user.destroy
if @user.destroyed?
logout_user
- flash[:notice] = l(:notice_account_deleted)
+ flash.now[:notice] = l(:notice_account_deleted)
end
redirect_to home_path
end
@@ -170,7 +170,7 @@ class MyController < ApplicationController
def password
@user = User.current
unless @user.change_password_allowed?
- flash[:error] = l(:notice_can_t_change_password)
+ flash.now[:error] = l(:notice_can_t_change_password)
redirect_to my_account_path
return
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index d8ecb4ef7..638a883d2 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -226,7 +226,14 @@ class UsersController < ApplicationController
end
end
- membership = @user.coursememberships.all#@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
+ #@user.coursememberships.all(:conditions => Course.visible_condition(User.current))
+
+ if User.current == @user || User.current.admin?
+ membership = @user.coursememberships.all
+ else
+ membership = @user.coursememberships.all(:conditions => Course.visible_condition(User.current))
+ end
+
membership.sort! {|older, newer| newer.created_on <=> older.created_on }
@memberships = []
membership.collect { |e|
@@ -235,9 +242,9 @@ class UsersController < ApplicationController
## 判断课程是否过期 [需封装]
@memberships_doing = []
@memberships_done = []
- now_time = Time.now.year
+ #now_time = Time.now.year
@memberships.map { |e|
- end_time = e.course.get_time.year
+ #end_time = e.course.get_time.year
isDone = course_endTime_timeout?(e.course)
if isDone
@memberships_done.push e
diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index 26d61f94e..1139deb35 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -303,27 +303,27 @@ module WelcomeHelper
str << content_tag("span", "发表了") <<
content_tag("span", find_all_event_type(event)) <<
': '.html_safe <<
- link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url)
+ link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url)
when 'issue', 'message' , 'bid' , 'wiki-page' , 'document'
str << content_tag("span", "发表了") <<
content_tag("span", find_all_event_type(event)) <<
': '.html_safe <<
- link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url)
+ link_to(event.event_title, event.event_url)
when 'reply' ,'Reply', 'Memo'
str << content_tag("span", "发表了") <<
content_tag("span", find_all_event_type(event)) <<
': '.html_safe <<
- link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url)
+ link_to(strip_tags(event.event_description).gsub(/ /,''), event.event_url)
when 'attachment'
str << content_tag('span', '上传了') <<
content_tag('span', find_all_event_type(event)) <<
': '.html_safe <<
- link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) <<
+ link_to(event.event_title, event.event_url) <<
link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container.project), :class => "attachments_list_color")
else
str << content_tag("span", "更新了") <<
content_tag("span", find_all_event_type(event)) <<
- ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url)
+ ': '.html_safe << link_to(event.event_title, event.event_url)
end
str
rescue Exception => e
@@ -405,7 +405,8 @@ module WelcomeHelper
"show_bids" => true,
"show_contest" => true
}
- activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news', 'contestnotification'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
+ activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages', 'journals_for_messages', 'bids', 'news', 'contestnotification'].include?(t) ?
+ nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'})
end
diff --git a/app/views/bids/_history.html.erb b/app/views/bids/_history.html.erb
index 0961e3cf8..00a497e78 100644
--- a/app/views/bids/_history.html.erb
+++ b/app/views/bids/_history.html.erb
@@ -26,22 +26,20 @@
<%= link_to journal.user, user_path(journal.user)%>
<%= label %>
- <%= textilizable journal.notes%>
+ <%= textilizable journal.notes%>
<%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %>
- <% ids = 'project_respond_form_'+ journal.id.to_s%>
+ <% ids = 'project_respond_form_'+ journal.id.to_s%>
- <% if reply_allow %>
- <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
- :method => 'post', :title => l(:button_quote))%>
- <%= link_to l(:label_bid_respond_quote),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
- %>
- <% end %>
-<% if @user==User.current|| User.current.admin? %>
- <%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
- :remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
- <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
-<% end %>
+ <% if reply_allow %>
+ <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
+ :method => 'post', :title => l(:button_quote))%>
+ <%= link_to l(:label_bid_respond_quote),'',
+ {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
+ %>
+ <% end %>
+ <% if @user==User.current|| User.current.admin? %>
+ <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
+ <% end %>
diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb
index 9166974fa..65b740203 100644
--- a/app/views/calendars/show.html.erb
+++ b/app/views/calendars/show.html.erb
@@ -2,38 +2,35 @@
<%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project},
:method => :get, :id => 'query_form') do %>
-<%= hidden_field_tag 'set_filter', '1' %>
-">
- <%= l(:label_filter_plural) %>
- ">
- <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
-
-
-
-
- <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
-
-
-
-<%= label_tag('month', l(:label_month)) %>
-<%= select_month(@month, :prefix => "month", :discard_type => true) %>
-<%= label_tag('year', l(:label_year)) %>
-<%= select_year(@year, :prefix => "year", :discard_type => true) %>
-
-<%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
-<%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
-
+ <%= hidden_field_tag 'set_filter', '1' %>
+ ">
+ <%= l(:label_filter_plural) %>
+ ">
+ <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
+
+
+
+ <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
+
+
+ <%= label_tag('month', l(:label_month)) %>
+ <%= select_month(@month, :prefix => "month", :discard_type => true) %>
+ <%= label_tag('year', l(:label_year)) %>
+ <%= select_year(@year, :prefix => "year", :discard_type => true) %>
+
+ <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
+ <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
+
<% end %>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
-<%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
-
-
- <%= l(:text_tip_issue_begin_day) %>
- <%= l(:text_tip_issue_end_day) %>
- <%= l(:text_tip_issue_begin_end_day) %>
-
+ <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %>
+
+ <%= l(:text_tip_issue_begin_day) %>
+ <%= l(:text_tip_issue_end_day) %>
+ <%= l(:text_tip_issue_begin_end_day) %>
+
<% end %>
<% content_for :sidebar do %>
diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb
index 7951b68ce..83f8e217b 100644
--- a/app/views/common/_calendar.html.erb
+++ b/app/views/common/_calendar.html.erb
@@ -1,32 +1,38 @@
-
-
- <% 7.times do |i| %><%= day_name( (calendar.first_wday+i)%7 ) %> <% end %>
-
-
-
-<% day = calendar.startdt
-while day <= calendar.enddt %>
-<%= ("#{(day+(11-day.cwday)%7).cweek} ".html_safe) if day.cwday == calendar.first_wday %>
-
-<%= day.day %>
-<% calendar.events_on(day).each do |i| %>
- <% if i.is_a? Issue %>
-
- <%= h("#{i.project} -") unless @project && @project == i.project %>
- <%= link_to_issue i, :truncate => 30 %>
- <%= render_issue_tooltip i %>
-
- <% else %>
-
- <%= h("#{i.project} -") unless @project && @project == i.project %>
- <%= link_to_version i%>
-
- <% end %>
-<% end %>
-
-<%= ' '.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %>
-<% day = day + 1
-end %>
-
-
+
+
+
+
+ <% 7.times do |i| %>
+ <%= day_name( (calendar.first_wday+i)%7 ) %>
+ <% end %>
+
+
+
+
+ <% day = calendar.startdt
+ while day <= calendar.enddt %>
+ <%= ("#{(day+(11-day.cwday)%7).cweek} ".html_safe) if day.cwday == calendar.first_wday %>
+
+ <%= day.day %>
+ <% calendar.events_on(day).each do |i| %>
+ <% if i.is_a? Issue %>
+
+ <%= h("#{i.project} -") unless @project && @project == i.project %>
+ <%= link_to_issue i, :truncate => 30 %>
+ <%= render_issue_tooltip i %>
+
+ <% else %>
+
+ <%= h("#{i.project} -") unless @project && @project == i.project %>
+ <%= link_to_version i%>
+
+ <% end %>
+ <% end %>
+
+ <%= ' '.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %>
+ <% day = day + 1
+ end %>
+
+
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index a1feaf12a..a6575784d 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -9,7 +9,7 @@
- <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
+ <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
diff --git a/app/views/homework_attach/_comprehensive_evaluation.html.erb b/app/views/homework_attach/_comprehensive_evaluation.html.erb
index 59654c52c..ac1793271 100644
--- a/app/views/homework_attach/_comprehensive_evaluation.html.erb
+++ b/app/views/homework_attach/_comprehensive_evaluation.html.erb
@@ -1,55 +1,31 @@
<% is_teacher = is_course_teacher User.current,homework.bid.courses.first %>
-<% if comprehensive_evaluation != nil && comprehensive_evaluation.count > 0 %>
-
-
- 作业综评:
- <% if teaher_score != "0.00" %>
- <%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
- <% end %>
-
-
-
<%= comprehensive_evaluation.first.notes%>
+
+
+
+
<%= l(:lable_teacher_evaluation)%>:
+ <% if teaher_score != "0.00" %>
+ <%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
+ <% end %>
+
+
+ <%= comprehensive_evaluation.first.notes if !comprehensive_evaluation.nil? && comprehensive_evaluation.count > 0%>
- <% if is_teacher %>
- <%= render :partial => 'evaluation', :locals => {:homework => homework} %>
-
- <%= render :partial => 'evaluation_add_jour',
- :locals => {:homework_attach => homework,
- :sta => 0,
- :is_comprehensive_evaluation => 1,
- :comprehensive_evaluation => comprehensive_evaluation.first.notes} %>
-
- <% end %>
-<% else %>
- <% if is_teacher %>
-
-
- 作业综评:
- <% if teaher_score != "0.00" %>
- <%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
- <% end %>
-
- <%= render :partial => 'evaluation', :locals => {:homework => homework} %>
-
- <%= render :partial => 'evaluation_add_jour',
- :locals => {:homework_attach => homework,
- :sta => 0,
- :is_comprehensive_evaluation => 1,
- :comprehensive_evaluation => nil} %>
-
-
- <% else %>
-
-
- 作业综评:
- <% if teaher_score != "0.00" %>
- <%= render :partial => 'show_score', locals: {:stars => teaher_score} %>
- <% end %>
-
- <% if teaher_score == "0.00" %>
-
老师还未进行评价!
- <% end %>
-
+ <% if(teaher_score == "0.00" && !(!comprehensive_evaluation.nil? && comprehensive_evaluation.count > 0))%>
+ <% if is_teacher %>
+ <%#= render :partial => 'teacher_evaluation',
+ :locals => {:homework => homework, :comprehensive_evaluation => comprehensive_evaluation} %>
+ <% else %>
+
+ <%= l(:lable_teacher_evaluation_no) %>
+
+ <% end %>
<% end %>
-<% end %>
\ No newline at end of file
+
+
+
+
+ <% if is_teacher %>
+ <%= render :partial => 'teacher_evaluation',:locals => {:homework => homework} %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/homework_attach/_teacher_evaluation.html.erb b/app/views/homework_attach/_teacher_evaluation.html.erb
new file mode 100644
index 000000000..485238416
--- /dev/null
+++ b/app/views/homework_attach/_teacher_evaluation.html.erb
@@ -0,0 +1,8 @@
+<%= render :partial => 'evaluation', :locals => {:homework => homework} %>
+
+ <%= render :partial => 'evaluation_add_jour',
+ :locals => {:homework_attach => homework,
+ :sta => 0,
+ :is_comprehensive_evaluation => 1,
+ :comprehensive_evaluation => l(:label_leave_a_message)} %>
+
\ No newline at end of file
diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb
index a0876440c..fae1f97b5 100644
--- a/app/views/homework_attach/edit.html.erb
+++ b/app/views/homework_attach/edit.html.erb
@@ -44,7 +44,7 @@
<%= form_for(@homework) do |f|%>
标 题 * :
- <%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;"%>
+ <%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;", :maxlength => 254%>
提交项目 :
@@ -60,7 +60,7 @@
描 述 :
- <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
+ <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :maxlength => 65534, :style => "font-size:small;width:490px;margin-left:10px;" %>
diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb
index d05dfb735..29e606442 100644
--- a/app/views/homework_attach/new.html.erb
+++ b/app/views/homework_attach/new.html.erb
@@ -24,7 +24,7 @@
}) do |f|%>
标 题 * :
- <%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %>
+ <%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;", :maxlength => 254 %>
提交项目 :
@@ -39,7 +39,7 @@
<%#= f.text_area :description, :rows => 15, :class => 'wiki-edit', :id => 'editor01' %>
-->
- <%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
+ <%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => 65534 %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index e3c137fb4..91ab68fdf 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -189,7 +189,7 @@
- <% if @course.description && @course.description.size>0 %>
+ <% if @course.description && @course.description.lstrip.rstrip.size>0 %>