diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 4174f427e..d0f94b119 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -171,7 +171,6 @@ class AccountController < ApplicationController ue.location_city = params[:city] if params[:city] != nil ue.save end - #end end end diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index d55afbb31..91da700a1 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -62,7 +62,7 @@ class MyController < ApplicationController end end - @se = @user.user_extensions ||= UserExtensions.new + @se = @user.extensions @se.school_id = params[:occupation] if params[:occupation] @se.gender = params[:gender] @se.location = params[:province] if params[:province] diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 299c70156..ccbff8e50 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -369,22 +369,10 @@ class ProjectsController < ApplicationController #Added by young def homework @offset, @limit = api_offset_and_limit({:limit => 10}) - @bids = @project.homeworks.order('deadline DESC') + @bids = @project.homeworks.order('deadline') @bids = @bids.like(params[:name]) if params[:name].present? - @bid_count = @bids.count - @bid_pages = Paginator.new @bid_count, @limit, params['page'] - @offset ||= @bid_pages.reverse_offset - #@bids = @bids.offset(@offset).limit(@limit).all.reverse - unless @offset == 0 - @bids = @bids.offset(@offset).limit(@limit).all.reverse - else - limit = @bid_count % @limit - if limit == 0 - limit = 10 - end - @bids = @bids.offset(@offset).limit(limit).all.reverse - end + @bids = paginateHelper @bids render :layout => 'base_courses' end diff --git a/app/models/issue.rb b/app/models/issue.rb index 3ff2a142d..3a14d288d 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -138,10 +138,10 @@ class Issue < ActiveRecord::Base nil when 'default' user_ids = [user.id] + user.groups.map(&:id) - "(#{table_name}.is_private = #{connection.quoted_false}) OR (#{table_name}.author_id = #{user.id} OR #{table_name}.tracker_id IN (#{user_ids.join(',')}) OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" + "(#{table_name}.is_private = #{connection.quoted_false}) OR (#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" when 'own' user_ids = [user.id] + user.groups.map(&:id) - "(#{table_name}.author_id = #{user.id} OR #{table_name}.tracker_id IN (#{user_ids.join(',')}) OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" + "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" else '1=0' end @@ -159,9 +159,9 @@ class Issue < ActiveRecord::Base when 'all' true when 'default' - (!self.is_private? ||self.tracker == user) || (self.author == user || user.is_or_belongs_to?(assigned_to)) + !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to)) when 'own' - self.tracker == user || self.author == user || user.is_or_belongs_to?(assigned_to) + self.author == user || user.is_or_belongs_to?(assigned_to) else false end diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index a67cbd7e3..d452b6d53 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -95,9 +95,6 @@ <% end %> <% end %> - \ No newline at end of file diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb index 92fed47fe..9fb3fc7f1 100644 --- a/app/views/contests/_new_softapplication.html.erb +++ b/app/views/contests/_new_softapplication.html.erb @@ -12,7 +12,7 @@ $("#spane_name_notice").focus(); return false; } - else if(name.length < 25) + else if(name.length <= 25) { $("#spane_name_notice").text("填写正确"); $("#spane_name_notice").css('color','#008000'); @@ -37,7 +37,7 @@ $("#spane_workdescription_notice").css('color','#ff0000'); return false; } - if(workDescription.length < 125) + if(workDescription.length <= 125) { $("#spane_workdescription_notice").text("填写正确"); $("#spane_workdescription_notice").css('color','#008000'); @@ -61,7 +61,7 @@ $("#span_softapplication_application_developers").css('color','#ff0000'); return false; } - if(workDescription.length < 125) + if(workDescription.length <= 125) { $("#span_softapplication_application_developers").text("填写正确"); $("#span_softapplication_application_developers").css('color','#008000'); @@ -79,7 +79,6 @@ { if(regexName() && regexWorkdescription() && regexDevelopers()) { - alert("123123123123"); $("#new_softapplication").submit(); } } diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 96fac7677..799656f36 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -239,8 +239,9 @@
+ <% score = c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_f %> <%= l(:label_final_scores) %> - :<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %> + :<%= format("%.2f" , score) %> 分 diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 804b52d68..f5018fc94 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -37,26 +37,26 @@ + -->
<%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %> <%= link_to l(:label_issue_cancel_query), {:set_filter => 1, :project_id => @project}, :class => 'icon icon-reload' %> diff --git a/app/views/layouts/_base_enterprise_header.html.erb b/app/views/layouts/_base_enterprise_header.html.erb index 7fd21afe1..d98b94839 100644 --- a/app/views/layouts/_base_enterprise_header.html.erb +++ b/app/views/layouts/_base_enterprise_header.html.erb @@ -1,13 +1,13 @@ @@ -31,14 +31,14 @@ - + - + diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index 266bb8527..990a6d3c8 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -1,5 +1,4 @@ -<% cache "footer" do %>
-<% end %> diff --git a/app/views/layouts/_base_home_menu.html.erb b/app/views/layouts/_base_home_menu.html.erb index ca3e5c847..9327cae49 100644 --- a/app/views/layouts/_base_home_menu.html.erb +++ b/app/views/layouts/_base_home_menu.html.erb @@ -9,14 +9,14 @@ <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> - + - + <%= render_menu :top_home_menu if User.current.logged? || !Setting.login_required? -%>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 725e7fba9..01510865b 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -82,7 +82,7 @@ <%= join_in_course(@course, User.current) %> <% end %> <% unless User.current.member_of_course?(@course) %> - + <% end %> <% end %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 3ea5bad92..7b8ed310e 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -13,16 +13,15 @@
<%= h(e.project) if @project.nil? || @project.id != e.project.id %> - - <% if @canShowRealName %> - <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> - (<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>) - <% else %> - <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> - <% end %> - - <%= l(:label_new_activity) %> - + + <% if @canShowRealName %> + <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> + (<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>) + <% else %> + <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> + <% end %> + <%= l(:label_new_activity) %> + <%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index e41ecb842..b5e3e951c 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -79,9 +79,10 @@ <% end %>
-
-
<%=l(:label_final_scores)%>
-
<%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分
+
+
<%=l(:label_final_scores)%>
+ <% score = @softapplication.average(:quality).try(:avg).try(:round, 2).to_f %> +
<%= format("%.2f" , score) %>分
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb index adee55564..38b8ac85c 100644 --- a/app/views/tags/_tag_name.html.erb +++ b/app/views/tags/_tag_name.html.erb @@ -70,14 +70,13 @@ :taggable_id => obj.id, :taggable_type => object_flag %> <% end %> - <% when '5' %> - <% if Forum.find(params[:id]) %> - <% if Forum.find(params[:id]).creator_id == User.current.id %> + <% when '5' %> + <% test = Forum.find(obj.id) %> + <% if test && test.creator_id == User.current.id %> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, :taggable_id => obj.id, :taggable_type => object_flag %> - <% end %> - <% end %> + <% end %> <% when '6' %> <%# if (User.current.logged? && User.current.admin? diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 62c9b860f..d17f4c3bd 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -163,7 +163,7 @@ zh: notice_account_invalid_creditentials_new: 您还未到邮箱激活 notice_account_password_updated: 密码更新成功 notice_account_wrong_password: 密码错误 - notice_account_register_done: 帐号创建成功,请使用注册确认邮件中的链接来激活您的帐号。 + notice_account_register_done: 帐号创建成功,请使用注册确认邮件中的链接来激活您的帐号, 如果您的邮件没有在收件箱中可能在垃圾箱中,请您注意查收。 notice_account_unknown_email: 未知用户 notice_can_t_change_password: 该帐号使用了外部认证,因此无法更改密码。 notice_account_lost_email_sent: 系统已将引导您设置新密码的邮件发送给您。 @@ -1331,7 +1331,7 @@ zh: permission_add_documents: 新建文档 permission_edit_documents: 编辑文档 permission_delete_documents: 删除文档 - label_gantt_progress_line: Progress line + label_gantt_progress_line: 进度线 setting_jsonp_enabled: Enable JSONP support field_inherit_members: Inherit members field_closed_on: 已关闭 diff --git a/plugins/redmine_ckeditor/db/migrate/20130418001210_add_ckeditor_to_settings.rb b/plugins/redmine_ckeditor/db/migrate/20130418001210_add_ckeditor_to_settings.rb new file mode 100644 index 000000000..8fd452093 --- /dev/null +++ b/plugins/redmine_ckeditor/db/migrate/20130418001210_add_ckeditor_to_settings.rb @@ -0,0 +1,18 @@ +# This migration comes from rich (originally 20111201095829) +class AddCkeditorToSettings < ActiveRecord::Migration + def up + str = " +insert into `settings` (`name`, `value`, `updated_on`) values('plugin_redmine_ckeditor','--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nskin: kama\nui_color: ! \'#f4f4f4\'\nwidth: \'\'\nheight: \'400\'\nenter_mode: \'1\'\nshow_blocks: \'1\'\ntoolbar_can_collapse: \'0\'\ntoolbar_location: top\ntoolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor,Cut,Copy,Paste,BidiLtr,BidiRtl,PasteText,PasteFromWord,RemoveFormat,SelectAll\n','2014-07-24 11:24:50'); + " + ActiveRecord::Base.connection.execute( + "insert settings(name, value) values('plugin_redmine_ckeditor', '')" + ) + end + + def down + ss = Setting.where("name='plugin_redmine_ckeditor'") + ss.each do |s| + s.destroy + end + end +end