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) diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb index 7bb8c76a8..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; } 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? %> 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 %> 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 @@ 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 @@