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| %><% end %> - - - -<% day = calendar.startdt -while day <= calendar.enddt %> -<%= ("".html_safe) if day.cwday == calendar.first_wday %> - -<%= ''.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %> -<% day = day + 1 -end %> - - +
<%= day_name( (calendar.first_wday+i)%7 ) %>
#{(day+(11-day.cwday)%7).cweek} -

<%= 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 %> -
+ + + + <% 7.times do |i| %> + + <% end %> + + + + + <% day = calendar.startdt + while day <= calendar.enddt %> + <%= ("".html_safe) if day.cwday == calendar.first_wday %> + + <%= ''.html_safe if day.cwday==calendar.last_wday and day!=calendar.enddt %> + <% day = day + 1 + end %> + +
<%= day_name( (calendar.first_wday+i)%7 ) %>
#{(day+(11-day.cwday)%7).cweek} +

<%= 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 %> +
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 %>
<%= textilizable @course.description %> diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index 0856da976..4eab5658c 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -6,11 +6,11 @@ <% unless replying %>


- <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject" %> + <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :maxlength => 254 %>

<% else %>


- <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %> + <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %>

<% end %>

diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index a57e35e65..3cb4fad80 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -12,8 +12,6 @@ ); - - - -

<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %> <%= call_hook(:view_my_account_contextual, :user => @user) %> @@ -39,9 +32,7 @@

<%= l(:label_my_account) %>

<%= error_messages_for 'user' %> -
- <%= labelled_form_for :user, @user, :url => {:action => "account"}, :html => {:id => 'my_account_form', @@ -70,7 +61,6 @@
@@ -95,10 +86,10 @@

<% else %> <% if @user.user_extensions.gender == 0 %> -

- <%= l(:label_gender) %>   - <%= select_tag 'gender', "".html_safe, :class => 'gender' %> -

+

+ <%= l(:label_gender) %>   + <%= select_tag 'gender', "".html_safe, :class => 'gender' %> +

<% else %>

<%= l(:label_gender) %>   @@ -107,12 +98,11 @@ <% end %> <% end %> - -

<% if User.current.user_extensions.school.nil? %> - <%= l(:field_occupation) %> * + <%= l(:field_occupation) %>  + * @@ -126,8 +116,7 @@

- -

学校列表

+

<%= l(:lable_school_list)%>

  
    @@ -234,39 +223,40 @@ <% unless @user.user_extensions.identity == 2 %> -

    - <%= l(:label_identity) %> - - - - <% end %> - - - <% else %> - - - -

    +

    + <%= l(:label_identity) %> + + + + <% end %> + + +

    + <% else %> +

    + + + +

    <% end %>
diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index f8bd9c638..ea94244d5 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -74,7 +74,6 @@ <%= labelled_form_for @news, :url => course_news_index_path(@course), :html => {:id => 'news-form', :multipart => true} do |f| %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %> - <%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %> <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>| <%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> | @@ -90,26 +89,48 @@

<% else %> <% @newss.each do |news| %> -
- + diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 03731373c..6e03e8e34 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -123,9 +123,10 @@ + + diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb index 35f76dfaa..75f33d1d3 100644 --- a/app/views/news/_project_news.html.erb +++ b/app/views/news/_project_news.html.erb @@ -101,21 +101,29 @@
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + <%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + + + <%= textilizable(news, :description) %> + + - - + +
- <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_notice) %><%= link_to h(news.title), news_path(news) %> - <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %> + + <%= link_to_user(news.author) if news.respond_to?(:author) %> + + + <%= l(:label_project_notice) %> + + + <%= link_to h(news.title), news_path(news) %> + + + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %> +
- <%= textilizable(news, :description) %>
<%= l :label_update_time %> - : <%= format_time(news.created_on) %><%= link_to l(:label_project_newother), news_path(news) %><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %> + + <%= l :label_update_time %> + :  + <%= format_time(news.created_on) %> + + + <%= link_to l(:label_project_newother), news_path(news) %> + <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %> +
-

+ <%= textilizable(comment.comments) %> -

<%= format_time(comment.created_on) %>
- +
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + <%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + <% if @project.project_type == 1 %> <% else %> <% end %> diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 66580ddd5..665094cc8 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -80,7 +80,9 @@
- <%= textilizable(@news, :description) %> + + <%= textilizable(@news, :description) %> +
<%= link_to_attachments @news %>
@@ -115,22 +117,35 @@ <% next if comment.new_record? %>
- <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_notice) %><%= link_to h(news.title), news_path(news) %> + <%= link_to_user(news.author) if news.respond_to?(:author) %> + <%= l(:label_project_notice) %> + <%= link_to h(news.title), news_path(news) %> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
- <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_newshare) %> <%= link_to h(news.title), news_path(news) %> - <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> + <%= link_to_user(news.author) if news.respond_to?(:author) %> + <%= l(:label_project_newshare) %> + <%= link_to h(news.title), news_path(news) %> + + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> +
- + diff --git a/app/views/tags/_show_bids.html.erb b/app/views/tags/_show_bids.html.erb index e789979e1..ef6c5ad52 100644 --- a/app/views/tags/_show_bids.html.erb +++ b/app/views/tags/_show_bids.html.erb @@ -6,7 +6,7 @@ <%= l(:label_tags_bid) %>:<%= link_to "#{bid.name}", :controller => "bids",:action => "show",:id => bid.id %>
- <%= l(:label_tags_bid_description) %>:<%= bid.description %> + <%= l(:label_tags_bid_description) %>:<%= textilizable bid.description %> <%= bid.updated_on %>

diff --git a/app/views/tags/_show_contests.html.erb b/app/views/tags/_show_contests.html.erb index 4eded773a..c711a36ea 100644 --- a/app/views/tags/_show_contests.html.erb +++ b/app/views/tags/_show_contests.html.erb @@ -6,7 +6,7 @@ <%= l(:label_tags_contest) %>:<%= link_to "#{contest.name}", :controller => "contests",:action => "show_contest",:id => contest.id %>
- <%= l(:label_tags_contest_description) %>:<%= contest.description %> + <%= l(:label_tags_contest_description) %>:<%= textilizable contest.description %> <%= contest.updated_on %>

diff --git a/app/views/tags/_show_courses.html.erb b/app/views/tags/_show_courses.html.erb index c99e3e22d..1e118541b 100644 --- a/app/views/tags/_show_courses.html.erb +++ b/app/views/tags/_show_courses.html.erb @@ -5,7 +5,7 @@

<%= l(:label_course) %>:<%= link_to "#{course.name}",course_path(course) %>
- <%= l(:label_new_course_description) %>:<%= course.description %> + <%= l(:label_new_course_description) %>:<%= textilizable course.description %> <%= course.updated_at %>

diff --git a/app/views/tags/_show_issues.html.erb b/app/views/tags/_show_issues.html.erb index 399caf513..ea35dbff5 100644 --- a/app/views/tags/_show_issues.html.erb +++ b/app/views/tags/_show_issues.html.erb @@ -5,7 +5,7 @@

<%= l(:label_tags_issue) %><%= link_to "#{issue.subject}",:controller => "issues",:action => "show",:id => issue.id %>
- <%= l(:label_tags_issue_description) %>:<%= issue.description %> + <%= l(:label_tags_issue_description) %>:<%= textilizable issue.description %>

<% end %> diff --git a/app/views/tags/_show_open_source_projects.html.erb b/app/views/tags/_show_open_source_projects.html.erb index 8ea67f9a7..5f9dae299 100644 --- a/app/views/tags/_show_open_source_projects.html.erb +++ b/app/views/tags/_show_open_source_projects.html.erb @@ -6,7 +6,7 @@

<%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "open_source_projects",:action => "show",:id => prj.id %>
- <%= l(:label_tags_project_description) %><%= prj.short_description %> + <%= l(:label_tags_project_description) %><%= textilizable prj.short_description %>

diff --git a/app/views/tags/_show_projects.html.erb b/app/views/tags/_show_projects.html.erb index 5dade07ef..7ed32cba1 100644 --- a/app/views/tags/_show_projects.html.erb +++ b/app/views/tags/_show_projects.html.erb @@ -6,7 +6,7 @@

<%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %>
- <%= l(:label_tags_project_description) %><%= prj.description %> + <%= l(:label_tags_project_description) %><%= textilizable prj.description %>

diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index a5cda9944..bf2c8c31c 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -41,8 +41,8 @@ :show_flag => @obj_flag} %> - + - + <% end %> diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 51f082ae6..d28c89aa8 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -39,19 +39,20 @@
- <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> + + <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> <% else %> - <% if @school_id == "0" %> - <% else %> - <% if @school_id.nil? %> - <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> -
- <% else %> - <%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> -
- <% end %> + <% if @school_id == "0" %> + <% else %> + <% if @school_id.nil? %> + <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> +
+ <% else %> + <%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %> +
<% end %> <% end %> + <% end %>
<% unless @course_page.nil? %> <%= @course_page.title %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index c4f7f27a7..8b610bdbc 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -75,9 +75,7 @@
    - <% #projects = find_miracle_project(10, 3) %> <% @projects.map do |project| %> -
  • <%= image_tag(get_project_avatar(project), :class => "avatar-4") %> @@ -122,7 +120,7 @@ <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
    -
    +
    <%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 7ddff7d04..ce0222e52 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1634,7 +1634,7 @@ zh: label_issue_cancel_query: 取消查询 field_reward_type: 奖励类型 label_tags_no: 暂无标签! - label_course_description_no: 你还未对该课程添加描述! + label_course_description_no: 该课程未添加描述! label_bid_publish: 发布了 label_bid_project: 项目 label_project_no_follow: 该项目暂未被关注! @@ -2145,3 +2145,6 @@ zh: lable_sure_exit_project: 是否确认退出该项目 lable_input_class: 在此输入课时 lable_input_class_vilidate: 学时只能为整数 + lable_school_list: 学校列表 + lable_teacher_evaluation_no: 老师还未进行评价 + lable_teacher_evaluation: 作业综评 diff --git a/db/migrate/20141009055029_update_homeworkattach_description.rb b/db/migrate/20141009055029_update_homeworkattach_description.rb new file mode 100644 index 000000000..7f107077f --- /dev/null +++ b/db/migrate/20141009055029_update_homeworkattach_description.rb @@ -0,0 +1,5 @@ +class UpdateHomeworkattachDescription < ActiveRecord::Migration + def change + change_column :homework_attaches, :description, :text, default: nil + end +end diff --git a/db/schema.rb b/db/schema.rb index 172a11ec5..ea5c2107d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20141009010934) do +ActiveRecord::Schema.define(:version => 20141009055029) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -473,7 +473,7 @@ ActiveRecord::Schema.define(:version => 20141009010934) do t.datetime "updated_at", :null => false t.string "reward" t.string "name" - t.string "description" + t.text "description" t.integer "state" t.integer "project_id", :default => 0 end diff --git a/lib/redmine/activity/fetcher.rb b/lib/redmine/activity/fetcher.rb index 2caef48b8..ba2033775 100644 --- a/lib/redmine/activity/fetcher.rb +++ b/lib/redmine/activity/fetcher.rb @@ -109,12 +109,17 @@ module Redmine end if cur_objs cur_objs.each do |cur_obj| - if cur_obj.class == Issue - if cur_obj.project != nil && cur_obj.project.project_status != nil - e += [cur_obj] - end - else + #if cur_obj.class.to_s == 'Issue' + # if cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == 1 + # e += [cur_obj] + # end + #else + # e += [cur_obj] + #end + if cur_obj.project != nil && cur_obj.project.project_status != nil && cur_obj.project.is_public == true e += [cur_obj] + #else + # e += [cur_obj] end end end diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index a9b0ef4eb..50dc9393d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -749,9 +749,15 @@ ul.user_course_sort li{list-style-type:none; } .font_description{ font-size:14px; - line-height: 1.5em; - + line-height: 1.5em; + word-break:break-all; + word-wrap: break-word; } +.font_description img{ + max-width: 90%; + max-height: 90%; /* 设置最大宽度和高度 */ +} + .font_description2{ font-size:13px; line-height: 1.5em;
<%= image_tag(url_to_avatar(comment.author), :class => "avatar")%> + <%= image_tag(url_to_avatar(comment.author), :class => "avatar")%> + - + + + - - + +
<%= link_to_user(comment.author) if comment.respond_to?(:author) %> <%= l(:label_project_newadd) %><%= l(:label_comment_plural) %> + <%= link_to_user(comment.author) if comment.respond_to?(:author) %> + <%= l(:label_project_newadd) %> + <%= l(:label_comment_plural) %> +
-

+ <%= textilizable(comment.comments) %> -

<%= format_time(comment.created_on) %><%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> + <%= format_time(comment.created_on) %> + + <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :title => l(:button_delete) %> +