From cc215e6c7b094b1d39f0b4815ee197006a174d04 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 28 Jul 2014 09:47:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/show.html.erb | 5 +++++ app/views/users/show.html.erb | 24 +++++++++++++++++++++--- db/schema.rb | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index db51eca1d..e299be182 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -25,6 +25,11 @@ <%= 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 %>
+
+
+ <%#= textilizable e.event_url,:description %> +
+
<%= h(truncate(strip_tags(e.event_description).gsub(/ /, ' '), length: 30, omission: '...')) %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 6270b5f50..e671f7617 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -252,17 +252,35 @@ <% if e.user == User.current %> - <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> + + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> +   + + <%= l(:label_i_new_activity) %> +   + <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> <% else %> - <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> + + <%= link_to(h(e.user), user_path(e.user_id)) %> +   + + <%= l(:label_new_activity) %> +   + <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %> <% end %> -

<%= textilizable(act.description) %>

+
+
+ <%= textilizable act, :description %> +
+
+ + diff --git a/db/schema.rb b/db/schema.rb index 2927e6fac..a6e36b1e2 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 => 20140725062302) do +ActiveRecord::Schema.define(:version => 20140725073357) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From a4ecccc048f9fdec1239cf61379ccd8f025d2156 Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 28 Jul 2014 13:53:39 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E6=98=B5=E7=A7=B0=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E8=A2=AB=E6=8C=A4=E5=88=B0=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E4=BD=8D=E7=BD=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 7dd1e751d..f8c7f880d 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -166,10 +166,10 @@ <%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %> - 楼主: <%= link_to_user(topic.author) %> + 楼主: <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %> - 最后回复:<%=link_to_user topic.last_reply.try(:author) %> + 最后回复:<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %> 回复(<%= link_to topic.try(:replies_count), topic.event_url %>) From 18ddb8604b48dd40a9d39e4c699d02d22d530f94 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 28 Jul 2014 14:58:01 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=8F=82=E8=B5=9B?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=90=8D=E7=A7=B0=E3=80=81=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=95=B0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 39 ++++--- .../contests/_new_softapplication.html.erb | 96 +++++++++++++++++ .../contests/show_attendingcontest.html.erb | 100 +----------------- config/locales/zh.yml | 1 + 4 files changed, 122 insertions(+), 114 deletions(-) create mode 100644 app/views/contests/_new_softapplication.html.erb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b6cd47924..dbc39f950 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -823,8 +823,11 @@ module ApplicationHelper def select_option_helper option tmp = Hash.new tmp={"" => ""} - option.each do |project| - tmp[project.name] = project.id + if option.nil? + else + option.each do |project| + tmp[project.name] = project.id + end end tmp end @@ -1168,25 +1171,27 @@ module ApplicationHelper objects = objects.first end # end - objects = objects.map {|o| o.is_a?(String) ? instance_variable_get("@#{o}") : o}.compact - errors = objects.map {|o| o.errors.full_messages}.flatten - if errors.any? - html << "
    \n" - errors.each do |error| + if objects != nil + objects = objects.map {|o| o.is_a?(String) ? instance_variable_get("@#{o}") : o}.compact + errors = objects.map {|o| o.errors.full_messages}.flatten + if errors.any? + html << "
      \n" + errors.each do |error| + ###by xianbo + if(error!=l(:label_repository_path_not_null)) + html << "
    • #{h error}
    • \n" + end + ###xianbo + end ###by xianbo - if(error!=l(:label_repository_path_not_null)) - html << "
    • #{h error}
    • \n" + unless params[:repository].nil? + if params[:repository][:upassword]=="" + html << "
    • "+ l(:label_password_not_null) +"
    • \n" + end end ###xianbo + html << "
    \n" end - ###by xianbo - unless params[:repository].nil? - if params[:repository][:upassword]=="" - html << "
  • "+ l(:label_password_not_null) +"
  • \n" - end - end - ###xianbo - html << "
\n" end html.html_safe end diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb new file mode 100644 index 000000000..830bcd314 --- /dev/null +++ b/app/views/contests/_new_softapplication.html.erb @@ -0,0 +1,96 @@ +<%#= error_messages_for 'softapplication' %> +<%= form_for Softapplication.new, :url => softapplications_path do |f| %> +
+ <%= hidden_field_tag 'contest_id', @contest.id %> + + <%= l(:label_work_name) %> + * : + <%= f.text_field :name, :required => true, :size => 60, :style => "width:350px;" %> + + +
+
+
+ + + <%= l(:label_running_platform) %> + * : + <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:350px;" %> + + +
+
+
+ + + <%= l(:label_work_type) %> + * : + + + <%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %> + + <%= f.select :app_type_name,work_type_opttion, {},{:style => "width:358px;",:onchange => "selectChange(this)"} %> + <%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> + + + +
+
+
+ + + <%= l(:label_work_description) %> + * : + <%= f.text_field :description, :required => true, :size => 60, :style => "width:350px;" %> + + +
+
+
+ + + <%= l(:label_softapplication_developers) %> + * : + <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:350px;" %> + + +
+
+
+ + + <%= l(:label_work_deposit_project) %>: + <%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2',:style => "width:358px;" %> + <%= link_to l(:label_create_new_projects),{:controller => 'projects',:action => 'new',course: 0, project_type: 0,host: Setting.project_domain}, :target => '_blank' %> + +
+
+
+ +
+ + <%= l(:label_upload_softworkpacket_photo) %> + + <%#= render_flash_messages %> +

+ <%= render :partial => 'attachments/form' %> +

+ +

+ 1、<%= l(:label_upload_softapplication_packets_mustpacketed) %>
+
+ 2、<%= l(:label_upload_softapplication_photo_condition) %> +

+ +
+

+
+ <%= submit_tag l(:button_create) %> + <%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();", + :type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'", + :onmouseover => "this.style.backgroundPosition = 'left -30px'" %> +
+<% end %> \ No newline at end of file diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index f6b684e5f..415897492 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -88,7 +88,7 @@
<%= l(:label_attending_contest) %>: - <%= link_to l(:label_new_attendingcontest_work), "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %> + <%= link_to l(:label_new_attendingcontest_work), "javascript:void(0);", onclick: "$('#put-project-form').slideToggle();" %>
<% else %> @@ -99,102 +99,8 @@ <% end %> -