diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 474f199a2..aacb32990 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -21,6 +21,7 @@ class FilesController < ApplicationController menu_item :files before_filter :auth_login1, :only => [:index] + before_filter :logged_user_by_apptoken,:only => [:index] before_filter :find_project_by_project_id#, :except => [:getattachtype] before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search] diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index c0d3d2f83..09cc5d59d 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -382,7 +382,7 @@ class CoursesService end latest_bid_message = messages.first unless latest_bid_message.nil? - latest_course_dynamics << {:type => 2,:time => latest_bid_message.created_on,:message => '最近更新了留言'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)} + latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => '最近更新了作业'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)} end #每个作业中学生最后提交的作业 homeworks = [] diff --git a/app/views/admin/mobile_version.html.erb b/app/views/admin/mobile_version.html.erb index cc6490f90..2a03ac003 100644 --- a/app/views/admin/mobile_version.html.erb +++ b/app/views/admin/mobile_version.html.erb @@ -36,7 +36,7 @@ <% end %> -<% if @versions.first.attachments.any?%> +<% if !@versions.first.nil? && @versions.first.attachments.any?%> <% options = {:author => true, :deletable => true } %> <%= render :partial => 'attachments/links', :locals => {:attachments => @versions.first.attachments, :options => options, :is_float => true} %> <% end %> diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb index e0c39eb33..73a3a6f2a 100644 --- a/app/views/documents/index.html.erb +++ b/app/views/documents/index.html.erb @@ -28,7 +28,7 @@ <% if @grouped.empty? %> -
+
<%= l(:label_no_data) %>
<% end %> diff --git a/app/views/documents/show.html.erb b/app/views/documents/show.html.erb index 5632c9d63..531f68a08 100644 --- a/app/views/documents/show.html.erb +++ b/app/views/documents/show.html.erb @@ -1,38 +1,45 @@+ <%= h @document.title %> +
+
+ <%#=h @document.category.name %>
+
+ <%= format_date @document.created_on %>
+
<%#=h @document.category.name %>
-<%= format_date @document.created_on %>
<%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;", - :id => 'attach_files_link' %>
- <%= form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> -<%= render :partial => 'attachments/form' %>
-+ <%= link_to l(:label_attachment_new), {}, :onclick => "$('#add_attachment_form').show(); return false;", + :id => 'attach_files_link' %> +
+ <%= form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> ++ <%= render :partial => 'attachments/form' %> +
+-<%= select_tag "version_id", content_tag('option', '') + - options_from_collection_for_select(@versions, "id", "name") %>
+ <%= select_tag "version_id", content_tag('option', '') + options_from_collection_for_select(@versions, "id", "name") %> <% end %> -<%= render :partial => 'attachments/form' %>
+<%= render :partial => 'attachments/form' %>