From 875249ba5821074b710e3ec41a6575e065ca3537 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 17 Sep 2014 16:05:30 +0800 Subject: [PATCH 1/9] Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh Conflicts: app/views/contests/index.html.erb Signed-off-by: alan <547533434@qq.com> --- app/views/contests/index.html.erb | 130 ++++++++++++------------------ 1 file changed, 53 insertions(+), 77 deletions(-) diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb index 998eabf80..293715c62 100644 --- a/app/views/contests/index.html.erb +++ b/app/views/contests/index.html.erb @@ -1,77 +1,53 @@ -
- <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> - - - - - - - - - - - -
<%= l(:label_contest_innovate) %><%= l(:label_user_location) %> : - <% if User.current.logged? %> - <% unless User.current.user_extensions.identity == 1 %> -<<<<<<< HEAD - - <%= link_to(l(:label_newtype_contest), - contest_new_contests_path, - :class => 'icon icon-add', - :target => "_blank") - %> -======= - <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %> ->>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc - - <% end %> - <% end %> - - -
- -<<<<<<< HEAD - -======= ->>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc - <%= link_to request.host()+"/contests", contests_path %> - - - - <%=link_to l(:field_homepage), home_path %> > -<<<<<<< HEAD - - <%=link_to l(:label_contest_innovate), contests_path %> -======= - <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> ->>>>>>> 5a14798290ec4fe5a5aeedb507e7f0077df96efc - -
- <% end %> -
-<% if @contests.size > 0%> -<%= sort_contest(@s_state)%> -
- <%= render :partial => 'contest_list', - :locals => {:contests => @contests, :contest_pages => @contest_pages} - %> -
-<% else %> - <%= render :partial => "layouts/no_content"%> -<% end %> - -<% html_title l(:label_contest_list)%> +
+ <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> + + + + + + + + + + + +
<%= l(:label_contest_innovate) %><%= l(:label_user_location) %> : + <% if User.current.logged? %> + <% unless User.current.user_extensions.identity == 1 %> + + <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %> + <% end %> + <% end %> + + +
+ + <%= link_to request.host()+"/contests", contests_path %> + + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_innovate), contests_path %> + <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> +
+ <% end %> +
+<% if @contests.size > 0%> +<%= sort_contest(@s_state)%> +
+ <%= render :partial => 'contest_list', + :locals => {:contests => @contests, :contest_pages => @contest_pages} + %> +
+<% else %> + <%= render :partial => "layouts/no_content"%> +<% end %> + +<% html_title l(:label_contest_list)%> +s \ No newline at end of file From c31b50421ef243598c14c0a2cd905113be290b23 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Wed, 17 Sep 2014 16:35:52 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=8F=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E3=80=81=E8=AF=BE=E7=A8=8B=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_header.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 37b8aa7e7..db275b90b 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -54,7 +54,7 @@ @@ -73,7 +73,7 @@ From 353f484bbe3a7ce86dbeef7a0667916e4993862c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 17 Sep 2014 17:07:18 +0800 Subject: [PATCH 3/9] =?UTF-8?q?course=E9=A6=96=E9=A1=B5=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/course.html.erb | 53 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index f57bc97d7..51f082ae6 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -39,30 +39,31 @@
- <% 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 == "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 %>
+ <% 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 %> + <%= @course_page.title %> - <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> - , <%= @course_page.description %> - <% else %> - <% if @school_id == "0" %> + <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> , <%= @course_page.description %> + <% else %> + <% if @school_id == "0" %> + , <%= @course_page.description %> + <% end %> <% end %> <% end %> - <% end %>
<% else %> - <% if school_course.count < 10 %> + <% if school_course.count < 9 %> <%= render :partial => 'more_course', :locals => {:school_id => nil}%> @@ -110,7 +111,7 @@
From 567d92978119044fff0884c609658fdd0041b1e9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 17 Sep 2014 17:36:37 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AF=BE=E7=A8=8B=E8=AF=BE=E7=A8=8B=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E9=95=BF=E5=BA=A6=E9=99=90=E5=AE=9A=E4=B8=BA?= =?UTF-8?q?100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_form.html.erb | 78 +++---------------------- 1 file changed, 8 insertions(+), 70 deletions(-) diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index 63c196cef..5ba7b9e34 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -22,60 +22,21 @@ } } - - - <% object = [] %> <% object << 'course' %> <%= error_messages_for object %> - - - <% unless @course.new_record? %>

<%= render :partial => "avatar/avatar_form", :locals => {source: @course} %>

<% end %> - -

+

+ +

- - - - <%= f.fields_for @course do |m| %> - - - - - <% unless @course.nil? %>

@@ -98,12 +59,9 @@ <%= text_field_tag :class_period, nil, :placeholder => "在此输入课时", :maxlength => 5 %><%= l(:label_class_hour) %> -

+ +

<% end %> - - - -

@@ -127,16 +85,6 @@

- - - - - - - - - -

<%= l(:text_command) %> <% end %> - -

- -

<%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_course_public_info) %>

<%= f.text_field :course_type, :value => 1 %>

- - <%= wikitoolbar_for 'course_description' %> - <% @course.custom_field_values.each do |value| %>

<%= custom_field_tag_with_label :course, value %>

<% end %> <%= call_hook(:view_courses_form, :course => @course, :form => f) %> - - - <% unless @course.extra_frozen? %> From e1675c40091b026a935f2e01421a00a1b5ffcad6 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 17 Sep 2014 17:53:19 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/show.html.erb | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index ff0a3e6e1..a1feaf12a 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -1,8 +1,6 @@ <% if @events_by_day != nil && @events_by_day.size >0 %>
-

- <%#= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>

<% @events_by_day.keys.sort.reverse.each do |day| %> @@ -13,23 +11,21 @@ <%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %> - +
- @@ -53,7 +49,6 @@
+ <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.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) %> - - - <%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url,:style => "word-break:break-all;word-wrap: break-word;" %> + + <% 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, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url%>
- <% end %> From f78be4ea5158e377fb0ed4a4077c26fbe8fe0433 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 17 Sep 2014 19:57:26 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=8F=90=E4=BA=A4=E4=B8=8D=E4=BA=86bug=20Sig?= =?UTF-8?q?ned-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/_new_softapplication.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb index 7bb8c76a8..ebea41b43 100644 --- a/app/views/contests/_new_softapplication.html.erb +++ b/app/views/contests/_new_softapplication.html.erb @@ -221,8 +221,8 @@
- - <%#= submit_tag l(:button_create) %> + + <%= submit_tag l(:button_create) %> <%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();", From a8237003009c8418b4c607601ce969cee6783b9e Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 18 Sep 2014 10:10:14 +0800 Subject: [PATCH 7/9] Signed-off-by: alan <547533434@qq.com> --- app/views/contests/index.html.erb | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 app/views/contests/index.html.erb diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb new file mode 100644 index 000000000..115b154e6 --- /dev/null +++ b/app/views/contests/index.html.erb @@ -0,0 +1,48 @@ +
+ <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> + + + + + + + + + + + +
<%= l(:label_contest_innovate) %><%= l(:label_user_location) %> : + <% if User.current.logged? %> + <% unless User.current.user_extensions.identity == 1 %> + <%= link_to(l(:label_newtype_contest), new_contest_contests_path, :class => 'icon icon-add', :target => "_blank") %> + + <% end %> + <% end %> + + +
+ + <%= link_to request.host()+"/contests", contests_path %> + + + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> + +
+ <% end %> +
+<% if @contests.size > 0%> + <%= sort_contest(@s_state)%> +
+ <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> +
+<% else %> + <%= render :partial => "layouts/no_content"%> +<% end %> + +<% html_title l(:label_contest_list)%> From ef78066f3ebed1be0b8182d5ce0cc3deae6f66e4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Sep 2014 11:00:15 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E5=A4=8D=E5=B8=96=E5=AD=90=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=97=B6=E5=9B=9E=E5=A4=8D=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AE=8C=E6=95=B4:=E8=BF=98?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E7=82=B9=E7=82=B9=E8=A2=AB=E9=81=AE=E4=BD=8F?= =?UTF-8?q?=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f976918d8..cdb71170d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -127,7 +127,7 @@ module ApplicationHelper # * :text - Link text (default to attachment filename) # * :download - Force download (default: false) def link_to_short_attachment(attachment, options={}) - text = h(truncate(options.delete(:text) || attachment.filename, length: 25, omission: '...')) + text = h(truncate(options.delete(:text) || attachment.filename, length: 23, omission: '...')) route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path html_options = options.slice!(:only_path) url = send(route_method, attachment, attachment.filename, options) From 0a6364f6696b57811a42df67f652221ae4ef56fe Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 18 Sep 2014 13:54:03 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E5=93=81=E6=8C=89=E9=92=AE=E6=97=A0?= =?UTF-8?q?=E5=8F=8D=E5=BA=94=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/_new_softapplication.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb index ebea41b43..5fdefd955 100644 --- a/app/views/contests/_new_softapplication.html.erb +++ b/app/views/contests/_new_softapplication.html.erb @@ -57,19 +57,19 @@ var workDescription = $("#softapplication_application_developers").val(); if(workDescription.length ==0) { - $("#span_softapplication_application_developers").text(<%= l(:label_no_softapplication_developers) %>); + $("#span_softapplication_application_developers").text("<%= l(:label_no_softapplication_developers) %>"); $("#span_softapplication_application_developers").css('color','#ff0000'); return false; } if(workDescription.length <= 125) { - $("#span_softapplication_application_developers").text(<%= l(:label_field_correct) %>); + $("#span_softapplication_application_developers").text("<%= l(:label_field_correct) %>"); $("#span_softapplication_application_developers").css('color','#008000'); return true; } else { - $("#span_softapplication_application_developers").text(<%= l(:label_softapplication_developers_condition) %>); + $("#span_softapplication_application_developers").text("<%= l(:label_softapplication_developers_condition) %>"); $("#span_softapplication_application_developers").css('color','#ff0000'); return false; } @@ -221,8 +221,8 @@
- - <%= submit_tag l(:button_create) %> + + <%#= submit_tag l(:button_create) %> <%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",