From 85a95262fed4d7bb10618398c6e90219b9f83d0c Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 21 Aug 2014 16:01:24 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BE=97=E5=88=86?= =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=B8=AD=E6=96=87=E6=A1=A3=E5=BE=97=E5=88=86?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/_file_score_index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/projects/_file_score_index.html.erb b/app/views/projects/_file_score_index.html.erb index ce80ddbd2..bfc87097e 100644 --- a/app/views/projects/_file_score_index.html.erb +++ b/app/views/projects/_file_score_index.html.erb @@ -1,4 +1,4 @@ -
<%= l(:label_file_number) %> * 4 = <%= document_num(@project) %> * 4 = <%= format("%.2f" , document_score(@project)).to_i %>
-
<%= l(:label_file_score) %> = <%= format("%.2f" , document_score(@project)).to_i %>
+
<%= l(:label_file_number) %> * 4 = <%= documents_num(@project) %> * 4 = <%= format("%.2f" , documents_score(@project)).to_i %>
+
<%= l(:label_file_score) %> = <%= format("%.2f" , documents_score(@project)).to_i %>
\ No newline at end of file From 9d23e6a8be9dc6c53b6a6ab68d3a1a1841c1bb82 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 21 Aug 2014 17:09:35 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=A0=87=E9=A2=98=E9=95=BF=E5=BA=A6=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 2 +- app/models/contest_notification.rb | 1 + app/views/welcome/contest.html.erb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index aac107cfb..c75b9f9bf 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -241,7 +241,7 @@ class AdminController < ApplicationController end else respond_to do |format| - flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}" + flash.now[:error] = "#{l :label_first_page_create_fail}: #{@first_page.errors.full_messages[0]}\n\t#{@contest_page.errors.full_messages[0]}\n\t#{@notification.errors.full_messages[0]}" format.html { render :action => 'contest_page_made' } diff --git a/app/models/contest_notification.rb b/app/models/contest_notification.rb index c1f2fde6f..d525b4b3a 100644 --- a/app/models/contest_notification.rb +++ b/app/models/contest_notification.rb @@ -1,3 +1,4 @@ class ContestNotification < ActiveRecord::Base attr_accessible :content, :title + validates_length_of :title, maximum: 30 end diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 8df19a280..30395aa6f 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -197,7 +197,7 @@ <%#= link_to l(:label_more_information), forums_path %>
-
<%= @contestNotification.title %>
+
<%= @contestNotification.title %>
From 1498f5c20b9c0d94b526be368a4f685db8b47a4e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 22 Aug 2014 08:57:00 +0800 Subject: [PATCH 03/10] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=97=B6=E6=8C=89=E9=92=AE=E7=8A=B6=E6=80=81?= =?UTF-8?q?=202.=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_show.html.erb | 6 +++--- config/locales/zh.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index c6661d9fe..b86cea93f 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -69,9 +69,9 @@ :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> <%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %> <%#= submit_tag l(:button_save) %> - <%= link_to l(:button_save), "#", :onclick => 'submitNews();' %> - <%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => ''} %> | - <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %> + <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:class => 'whiteButton m3p10' %> + <%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> | + <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %> <% end %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a73f9db56..4f0744d86 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1641,7 +1641,7 @@ zh: label_call_bonus: 奖金 label_bids_form_new_description: 企业可以在此发布一个软件开发任务或者一个技术方案需求:(1)获得价廉物美的解决方案;(2)发现对此项任务有贡献的大学生,获得可以招聘的人才。 label_bids_form_contest_new_description: 企业或者高校可以在此发布一个竞赛。 - label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式,在作业类型里面设置。 + label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式。 label_fork_form_new_description: 该需求将作为某课程的作业被发布,作业提交方式可以使附件或者项目形式,在作业类型里面设置。 label_bids_new_money: 输入奖励金额,如 500,2.5等 label_bids_new_credit: 输入该作业对应课程的学分,如 3,2.5等 From 589c6d37db19d7caef7796de1d799353d11e35bb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 22 Aug 2014 09:20:03 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86=E5=8F=AF=E6=89=8B=E5=8A=A8=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E9=97=AE=E9=A2=98=20#1045?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework_form.html.erb | 4 ++-- app/views/courses/_homework_form.html.erb | 2 +- app/views/memos/_form.html.erb | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index f7c753b45..463b2b621 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -26,9 +26,9 @@

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %>

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

-

<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>

diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index 41c059603..bfecb5304 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -30,7 +30,7 @@ <%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>

--> <% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> -

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}") %><%= calendar_for('bid_deadline')%> +

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}",:readonly => "readonly") %><%= calendar_for('bid_deadline')%>

<%= f.select :is_evaluation, is_evaluation_option %>

diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb index d4b517048..116f97149 100644 --- a/app/views/memos/_form.html.erb +++ b/app/views/memos/_form.html.erb @@ -2,12 +2,12 @@

<%= l(:label_homeworks_form_new_description) %>

+ <%# if @memo.safe_attribute? 'sticky' %> + <%#= f.check_box :sticky %> <%= l(:label_board_sticky) %> + <%# end %> + <%# if @memo.safe_attribute? 'locked' %> + <%#= f.check_box :locked %> <%#= label_tag 'memo_locked', l(:label_board_locked) %> + <%# end %> + <%# end %> -->

<%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %>

<%= hidden_field_tag 'subject', ||=@memo.subject %> \ No newline at end of file From 9da85bb5a3ea1dc6ba9b8945df66a68aeeb2d011 Mon Sep 17 00:00:00 2001 From: chenmin <19763783@qq.com> Date: Fri, 22 Aug 2014 10:40:43 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=92=8C=E7=BC=96=E8=BE=91=E9=A1=B9=E7=9B=AE=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E6=97=B6=E9=83=BD=E6=98=BE=E7=A4=BA=E5=B8=96=E5=AD=90=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84bug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 3 ++- app/views/attachments/_form.html.erb | 17 +++++++++++++++-- app/views/messages/_form.html.erb | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index cdeb17e54..44496c3d7 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -34,6 +34,7 @@ class MessagesController < ApplicationController # Show a topic and its replies def show + @isReply = true page = params[:page] # Find the page of the requested reply if params[:r] && page.nil? @@ -103,6 +104,7 @@ class MessagesController < ApplicationController # Edit a message def edit + @isReply = false if @project (render_403; return false) unless @message.editable_by?(User.current) else @@ -123,7 +125,6 @@ class MessagesController < ApplicationController } end end - end # Delete a messages diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 0677d324b..e5fbd3f82 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -1,6 +1,7 @@ - + <% if defined?(container) && container && container.saved_attachments %> - <% container.attachments.each_with_index do |attachment, i| %> + <% if isReply %> + <% container.saved_attachments.each_with_index do |attachment, i| %> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + @@ -10,6 +11,18 @@ <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <% end %> + <% else %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> + <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> + <% end %> <% end %> + +<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> + +<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()" %> +<%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description) + } %> +<%= l(:label_no_file_uploaded)%> +(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + +<% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> +<% end %> + + diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 7844cc6ec..c543601d3 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -156,8 +156,9 @@ -

- <%= textilizable message, :content, :attachments => message.attachments %> +
+ <%= textAreailizable message,:content,:attachments => message.attachments %> + <%#= message.content.html_safe %>
<%= link_to_attachments message, :author => false %> diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index 1e74cbf48..44d6dfbe4 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -42,7 +42,7 @@

<%= l(:label_attachment_plural) %>
-<%= render :partial => 'attachments/form', :locals => {:container => @message,:isReply => @isReply} %>

+<%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>

From d1d2dd0e4bf334df2ec66b98f58c1fb703698778 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 22 Aug 2014 11:58:12 +0800 Subject: [PATCH 10/10] =?UTF-8?q?undefined=20m=5Fcoumt=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/user_score_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index 376f676b7..c94763e31 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -864,7 +864,7 @@ FROM `users` where id = #{user.id}") users = Attachment.find_by_sql("SELECT COUNT(*) as m_count FROM #{Attachment.table_name} WHERE author_id = '#{user.id}' and container_type = 'Project' and container_id = #{project.id}") result = 0 if users.count > 0 - result = users.first.m_coumt + result = users.first.m_count end result end