diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c055d38ae..f9ad609cc 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -759,7 +759,7 @@ class CoursesController < ApplicationController def homework if @course.is_public != 0 || User.current.member_of_course?(@course) || User.current.admin? @offset, @limit = api_offset_and_limit({:limit => 10}) - @bids = @course.homeworks.order('deadline DESC') + @bids = @course.homeworks.order('deadline ASC') @bids = @bids.like(params[:name]) if params[:name].present? @bid_count = @bids.count @bid_pages = Paginator.new @bid_count, @limit, params['page'] diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index bff7831d1..294d895a5 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -284,7 +284,7 @@ module WatchersHelper def exit_project_link(project) link_to(l(:label_exit_project),exit_cur_project_path(project.id), :remote => true, :confirm => l(:lable_sure_exit_project), - :style => "color: #fff; display:block; padding: 0px 5px; margin-right: 10px; height: 21px; line-height: 22px; background: none repeat scroll 0% 0% #64BDD9; TES;padding-top:1px;" ) + :style => "color: #fff; display:block;font-size:12px; padding: 0px 5px; margin-right: 10px; height: 20px; line-height: 22px; background: none repeat scroll 0% 0% #64BDD9; TES;padding-top:1px;" ) end #项目关注、取消关注 @@ -293,14 +293,15 @@ module WatchersHelper return '' unless user && user.logged? objects = Array.wrap(objects) watched = objects.any? {|object| object.watched_by?(user)} - @watch_flag = objects.first.instance_of?(Project) - text = @watch_flag ? - (watched ? l(:button_unfollow) : l(:button_follow)) : (watched ? l(:button_unwatch) : l(:button_watch)) + @watch_flag = objects.first.instance_of?(Project) + id = watcher_css(objects) + text = @watch_flag ? + (watched ? l(:button_unfollow) : l(:label_button_following)) : (watched ? l(:button_unwatch) : l(:label_button_following)) url = watch_path(:object_type => objects.first.class.to_s.underscore, :object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)) - method = watched ? 'delete' : 'post' - link_to text, url, :remote => true, :method => method, - :class => "project_watch_new" + method = watched ? 'delete' : 'post' + link_to text, url, :remote => true, :method => method, + :class => "project_watch_new" ,:id=>id end #申请加入项目 @@ -312,12 +313,13 @@ module WatchersHelper if applied appliedid = applied.id end + id = applied_css(project) url = appliedproject_path( :id=>appliedid, :user_id => user.id, :project_id => project.id) method = applied ? 'delete' : 'post' - link_to text, url, :remote => true, :method => method , :class => "project_watch_new" + link_to text, url, :remote => true, :method => method , :class => "project_watch_new",:id => id end end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index b404ea531..e1c538fd0 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -125,7 +125,7 @@ class Mailer < ActionMailer::Base end - + # 公共讨论区发帖、回帖添加邮件发送信息 def forum_message_added(memo) @memo = memo redmine_headers 'Memo' => memo.id @@ -134,9 +134,11 @@ class Mailer < ActionMailer::Base @forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id) @issue_author_url = url_for(user_activities_url(@author)) recipients ||= [] - if @forum.author.mail_notification != 'day' && @forum.author.mail_notification != 'week' + #将帖子创建者邮箱地址加入数组 + if @forum.creator.mail_notification != 'day' && @forum.creator.mail_notification != 'week' recipients << @forum.creator.mail end + #回复人邮箱地址加入数组 if @author.mail_notification != 'day' && @author.mail_notification != 'week' recipients << @author.mail end diff --git a/app/models/memo.rb b/app/models/memo.rb index 052ca03db..b4e30dabe 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -42,7 +42,7 @@ class Memo < ActiveRecord::Base "parent_id", "replies_count" - after_create :add_author_as_watcher, :reset_counters! #, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分 + after_create :add_author_as_watcher, :reset_counters!, :sendmail # after_update :update_memos_forum after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分 # after_create :send_notification diff --git a/app/views/applied_project/_set_applied.js.erb b/app/views/applied_project/_set_applied.js.erb index 7403b963b..33d862d1c 100644 --- a/app/views/applied_project/_set_applied.js.erb +++ b/app/views/applied_project/_set_applied.js.erb @@ -1,5 +1,14 @@ <% selector = ".#{applied_css(@project)}" %> -$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript applied_link(@project, User.current) %>")}); +<% id_selector = "#{applied_css(@project)}" %> +if($("<%= selector %>").get(0) == undefined) +{ + $("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript join_in_project_link(@project, User.current) %>")}); +} +else +{ + $("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript applied_link(@project, User.current) %>")}); +} + if (window.Messenger) { Messenger.options = { extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right', diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 8913febd0..4c2ee0c8f 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -7,9 +7,9 @@ <% end%> <% if options[:length] %> - <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%> + <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%> <% else %> - <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%> + <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%> <% end %> <%if is_float%> diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 6b3f91587..9e086ef1b 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -165,7 +165,7 @@ - <%= textilizable bid, :description %> + <%=h sanitize(bid.description.html_safe) %> diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 8af369558..a90d47b5a 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -14,9 +14,10 @@

+
<% curse_attachments.each do |file| %>
-
+
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> @@ -50,6 +51,7 @@
<% end %> +
diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb index 90215c16c..69ea896c9 100644 --- a/app/views/files/create.js.erb +++ b/app/views/files/create.js.erb @@ -31,4 +31,5 @@ closeModal(); $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>'); <%end%> <% end %> +$(document).ready(img_thumbnails); diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 4b282aa8f..012178ae2 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,5 +1,5 @@
-

问题跟踪

+

<%= l(:label_issue_tracking) %>

<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> @@ -12,7 +12,7 @@ :onclick => '$("#custom_query").slideToggle(400); ' if true || User.current.logged? %> <% end %> - 问题总数:<%= @project.issues.count %> 未解决:<%= @project.issues.where('status_id in (1,2,4,6)').count %> + <%= l(:label_issues_sum) %>:<%= @project.issues.count %> <%= l(:lable_issues_undo) %> <%= @project.issues.where('status_id in (1,2,4,6)').count %>
<% if !@query.new_record? && @query.editable_by?(User.current) %> diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 2172af8de..d964b788f 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -121,15 +121,15 @@ function cookiesave(n, v, mins, dn, path) { if(n) { - + if(!mins) mins = 365 * 24 * 60; if(!path) path = "/"; var date = new Date(); - + date.setTime(date.getTime() + (mins * 60 * 1000)); - + var expires = "; expires=" + date.toGMTString(); - + if(dn) dn = "domain=" + dn + "; "; document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path; @@ -170,8 +170,8 @@ function cookieget(n) <%= f.hidden_field :content, :required => true , :value => l(:label_feedback_value) %> <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %> <%= l(:label_submit)%> - <% end %> -
+ <% end %> +
<%= l(:label_technical_support) %>黄井泉 <%= l(:label_technical_support) %>白   羽 diff --git a/app/views/layouts/_point_browser.html.erb b/app/views/layouts/_point_browser.html.erb new file mode 100644 index 000000000..d9a46d5d6 --- /dev/null +++ b/app/views/layouts/_point_browser.html.erb @@ -0,0 +1,46 @@ + + + + + 升级浏览器 + + + + + + +
+ 您当前使用的是IE8浏览器,建议升级您的浏览器。 + + +
+
+ + + + <%=h html_title %> + <%= render :partial => "layouts/point_browser" %> <%= csrf_meta_tag %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 9c999aa05..e69d92694 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -153,7 +153,7 @@ (<%= @project.issues.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px !important;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> <% end %>
<% end %> @@ -164,7 +164,7 @@ (<%= @project.boards.first.topics.count %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:0px 3px 3px 3px;height:16px;margin-top:5px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px !important;color:#fff; padding:0px 3px 3px 3px;height:16px;margin-top:5px;background:#28be6c;float:right;line-height:20px;" %> <% end %>
<% end%> @@ -175,7 +175,7 @@ (<%= attaments_num %>) <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> + <%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true),:style => "font-size:12px !important;color:#fff; padding:1px 3px 3px 3px;height:16px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %> <% end %> <% end%> diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 995529fe9..7c32e801d 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -7,7 +7,7 @@
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> -
+
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
@@ -30,7 +30,7 @@ :remote => true, :method => 'get', :title => l(:button_quote) - )if !@memo.locked? && User.current.logged? %> + )if !@memo.locked? && User.current.logged? %> <%= link_to( #image_tag('edit.png'), @@ -64,7 +64,7 @@
<%= textAreailizable(@memo,:content) %> -

+

<% if @memo.attachments.any?%> <% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %> <%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %> @@ -100,7 +100,7 @@ :method => 'get', :title => l(:button_quote) )if !@memo.locked? && User.current.logged? %> - + <%= link_to( #image_tag('edit.png'), l(:button_edit), @@ -120,7 +120,7 @@ :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) - ) if reply.destroyable_by?(User.current) %> + ) if reply.destroyable_by?(User.current) %>


@@ -146,7 +146,7 @@ <%= authoring reply.created_at, reply.author %> - +
<% end %>