diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 75b87c6f0..3c815c7d8 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -56,6 +56,8 @@ class AttachmentsController < ApplicationController } format.api end + rescue Encoding::InvalidByteSequenceError => e + render :action => 'file' end def download diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2ba16c742..799316c47 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -460,6 +460,7 @@ module ApplicationHelper project_tree(projects) do |project, level| name_prefix = (level > 0 ? ' ' * 2 * level + '» ' : '').html_safe tag_options = {:value => project.id} + tag_options[:title] = project.name if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project)) tag_options[:selected] = 'selected' else @@ -1836,11 +1837,8 @@ module ApplicationHelper bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'} forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"} stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'} - - school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'} - #@nav_dispaly_project_label nav_list = Array.new nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1 diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 99b21d8cc..1afb94220 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -219,7 +219,7 @@ module CoursesHelper def render_course_hierarchy(courses) render_course_nested_lists(courses) do |course| - s = link_to_course(course, {}, :class => "#{course.css_classes} #{User.current.member_of?(course) ? 'my-course' : nil}").html_safe + s = link_to_course(course, {}, :class => "#{course.css_classes} #{User.current.member_of_course?(course) ? 'my-course' : nil}").html_safe s end end diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index 9298c253c..abcbbfe5b 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -15,7 +15,7 @@ <%= l(:label_private) %> <% end %> - <%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%> + <%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info #{User.current.member_of_course?(@course) ? 'my-project' : nil}"))%>

<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%> diff --git a/app/views/courses/join_private_courses.js.erb b/app/views/courses/join_private_courses.js.erb index 7bbb5ee99..0cf723f6b 100644 --- a/app/views/courses/join_private_courses.js.erb +++ b/app/views/courses/join_private_courses.js.erb @@ -1,4 +1,3 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>'); showModal('ajax-modal', '510px'); -$('#ajax-modal').addClass('new-watcher'); $('#ajax-modal').css('height','330px'); \ No newline at end of file diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 9d6d9f2b3..fcf54de75 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -54,7 +54,7 @@ if (textStatus == 'success') { eval(xhr.responseText); } else if (textStatus == 'error') { - alert('error'); +// alert('error'); } } diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index e121098f4..017a9a03c 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -51,7 +51,7 @@ style="word-break: break-all;word-wrap: break-word;"> <%= label_tag l(:field_subject) %>: <%=h @memo.subject %> -

+
<%= textAreailizable(@memo,:content) %>

<% if @memo.attachments.any?%> @@ -149,8 +149,17 @@ \ No newline at end of file diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index df7a1310b..57eaa93d1 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -14,9 +14,14 @@

-

- - <%= link_to l(:label_all_schol),school_index_path %>      - <% if User.current.logged? %> - <%= l(:label_my_school) %> - <% end %> -

-
    -
  • <%= l(:label_select_province) %>: - -
  • -
  • -
  • -
- +

+ <%= link_to l(:label_all_schol),school_index_path %>      + <% if User.current.logged? %> + + <%= l(:label_my_school) %> + + <% end %> +

+
    +
  • + <%= l(:label_select_province) %>: + +
  • +
  • + + +
  • +
-
    - -
+
    +
<% html_title(l(:label_school_all)) -%> diff --git a/app/views/wiki/_content.html.erb b/app/views/wiki/_content.html.erb index 96d358381..2554f5f2a 100644 --- a/app/views/wiki/_content.html.erb +++ b/app/views/wiki/_content.html.erb @@ -1,4 +1,4 @@ -
+
<%= textAreailizable content, :text, :attachments => content.page.attachments, :edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) %> <%#= content.text.html_safe %> diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb index b81091b7e..8ade60282 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -68,3 +68,15 @@ <%= render :partial => 'sidebar' %> <% end %> <% html_title @page.pretty_title %> + + diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 2aaaba9cf..e0ac3a9af 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2056,8 +2056,7 @@ zh: label_x_activity: zero: 个动态 one: 个动态 - other: 个动态 - label_school_all: 中国高校 + other: 个动态 label_upload_files: 上传资源 label_relation_files: 关联已有资源 label_contest_settings: 配置竞赛 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index aed928ebe..1410b2781 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2834,4 +2834,8 @@ div.repos_explain{ .list .tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;} .projects-index{min-height: 350px} -.school-index{min-height: 400px} \ No newline at end of file +.school-index{min-height: 400px} +#membership_project_id option +{ + width: 190px; +} \ No newline at end of file