diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 6ebe6b9eb..3332f1207 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -296,12 +296,12 @@ class ForumsController < ApplicationController #检查forum的名字 def check_forum_name - forum_name_exist = false - # if params[:forum_id] - # forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false - # else + forum_name_exist = true + if params[:forum_id] + forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false + else forum_name_exist = Forum.where("name = '#{params[:forum_name]}' ").count >= 1 ? true : false - # end + end render :text => forum_name_exist end diff --git a/app/views/files/_attachment_history_popub.html.erb b/app/views/files/_attachment_history_popub.html.erb index c0a833030..6fed80053 100644 --- a/app/views/files/_attachment_history_popub.html.erb +++ b/app/views/files/_attachment_history_popub.html.erb @@ -10,7 +10,7 @@ - + 当前版本 <%= @attachment.downloads %> <%= @attachment.try(:quotes).to_i %> <%= format_time(@attachment.created_on) %> diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index ee467067b..1d245b809 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -43,11 +43,12 @@ $(this).prev().css("color","#808080"); $(this).css("z-index", "1"); }); + //二级菜单滑动时箭头方向控制 $(".homepageLeftMenuMoreIcon").toggle(function(){ - $(this).css("background","url(/images/homepage_icon.png) -74px -240px no-repeat"); - },function(){ $(this).css("background","url(/images/homepage_icon.png) 100px -624px no-repeat"); + },function(){ + $(this).css("background","url(/images/homepage_icon.png) -74px -240px no-repeat"); }); }) @@ -55,7 +56,7 @@ <% organization.org_subfields.order("priority").each do |field| %> <% if is_default_field?(field) %> <% case field.name %> - <% when 'activity' %> +<% when 'activity' %>
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
@@ -102,15 +103,17 @@ <%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <% end %> <% else %> - <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> + + <%= field.name %> <% end %> <% if User.current.logged? and User.current.admin_of_org?(organization) %> <%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %> <% end %> -
+
+
@@ -136,7 +139,7 @@
<% elsif field.field_type == "Resource" %>
- <% if !field.subfield_subdomain_dir.nil? %> + <% if !field.subfield_subdomain_dir.nil? %> <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %> <%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden" %> <% else %> diff --git a/app/views/organizations/_org_subdomain.html.erb b/app/views/organizations/_org_subdomain.html.erb index 8b8807533..fe73cfa4e 100644 --- a/app/views/organizations/_org_subdomain.html.erb +++ b/app/views/organizations/_org_subdomain.html.erb @@ -3,10 +3,10 @@ <%= link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => org_subfield_id), :class => "coursesLineGrey hidden", :title => subdomain.name %> <% end %> -<% if subdomains.size == 5 %> -
  • - - -
  • -<% end%> +<%# if subdomains.size == 5 %> + + + + +<%# end%> diff --git a/db/migrate/20161015054820_update_homework_comment_status.rb b/db/migrate/20161015054820_update_homework_comment_status.rb new file mode 100644 index 000000000..7196c095a --- /dev/null +++ b/db/migrate/20161015054820_update_homework_comment_status.rb @@ -0,0 +1,20 @@ +class UpdateHomeworkCommentStatus < ActiveRecord::Migration + def up + homeworks = HomeworkCommon.joins(:homework_detail_manual).where("publish_time is not NULL and publish_time <= '#{Date.today}' and homework_detail_manuals.comment_status = 0") + homeworks.each do |homework| + hw_dm = homework.homework_detail_manual + if hw_dm && hw_dm.comment_status == 0 + if hw_dm.evaluation_end < Date.today && homework.anonymous_comment == 0 + hw_dm.update_column("comment_status", 3) + elsif homework.anonymous_comment == 0 && hw_dm.evaluation_end >= Date.today && hw_dm.evaluation_start <= Date.today + hw_dm.update_column("comment_status", 2) + else + hw_dm.update_column("comment_status", 1) + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 1f763c39e..66a6c1710 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 => 20161011012114) do +ActiveRecord::Schema.define(:version => 20161015054820) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -142,7 +142,7 @@ ActiveRecord::Schema.define(:version => 20161011012114) do t.integer "downloads", :default => 0 t.integer "author_id" t.datetime "created_on" - t.string "description" + t.text "description" t.string "disk_directory" t.integer "attachtype" t.integer "is_public" @@ -313,14 +313,16 @@ ActiveRecord::Schema.define(:version => 20161011012114) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" + t.integer "project_id" + t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" @@ -971,6 +973,10 @@ ActiveRecord::Schema.define(:version => 20161011012114) do t.datetime "updated_at", :null => false end + create_table "innodb_monitor", :id => false, :force => true do |t| + t.integer "a" + end + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" diff --git a/lib/tasks/homework_publishtime.rake b/lib/tasks/homework_publishtime.rake index 75e6a8912..df996ab9e 100644 --- a/lib/tasks/homework_publishtime.rake +++ b/lib/tasks/homework_publishtime.rake @@ -4,6 +4,7 @@ namespace :homework_publishtime do desc "start publish homework and end homework" task :publish => :environment do puts "--------------------------------homework_publish start" + Rails.logger.info("log--------------------------------homework_publish start") homework_commons = HomeworkCommon.where("publish_time = '#{Date.today}'") homework_commons.each do |homework| homework_detail_manual = homework.homework_detail_manual @@ -36,6 +37,7 @@ namespace :homework_publishtime do Mailer.run.homework_added(homework) end end + Rails.logger.info("log--------------------------------homework_publish end") puts "--------------------------------homework_publish end" end diff --git a/lib/tasks/resource_publish.rake b/lib/tasks/resource_publish.rake index ee39cfcc5..7584de4d3 100644 --- a/lib/tasks/resource_publish.rake +++ b/lib/tasks/resource_publish.rake @@ -4,10 +4,12 @@ namespace :resource_publish do desc "start publish resource" task :publish => :environment do puts "--------------------------------resource_publish start" + Rails.logger.info("log--------------------------------resource_publish start") attachments = Attachment.where("publish_time = '#{Date.today}'") attachments.each do |attachment| attachment.update_column('is_publish', 1) end + Rails.logger.info("log--------------------------------resource_publish end") puts "--------------------------------resource_publish end" end end \ No newline at end of file diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index ae4b09103..a96147bf0 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -660,6 +660,3 @@ a:hover.sy_btn_pink{ background: #e64c4c;} } .sy_class_titbox{margin-bottom:5px; padding-top:10px; } - -/*项目历史版本删除功能*/ -.popup_ziyuan_title{ display: block; margin-left: 10px; text-align: left;width:360px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 2acc0f454..a53d43097 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -1512,3 +1512,6 @@ a.syllabusbox_a_blue{ /*20160912问卷调查*/ .dash-block {border:1px dashed #ddd;} + +/*历史版本删除功能*/ +.popup_ziyuan_title{ display: block; margin-left: 10px; text-align: left;width:360px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}