From 6b7ce68e4a0c4622e8d62d5c73c1f7a77382c821 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 14 Jan 2016 17:52:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=84=E7=A7=8Dbug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_subfields_controller.rb | 1 + app/controllers/organizations_controller.rb | 1 + .../attachments/update_file_dense.js.erb | 4 +- app/views/courses/private_or_public.js.erb | 2 + app/views/layouts/_user_courses.html.erb | 2 +- app/views/org_subfields/show.html.erb | 60 +++++++++++++++++++ .../organizations/_subfield_list.html.erb | 4 +- app/views/projects/_attachment_acts.html.erb | 1 + app/views/projects/_project_create.html.erb | 1 + app/views/projects/_project_news.html.erb | 1 + app/views/users/_course_attachment.html.erb | 1 + .../users/_course_journalsformessage.html.erb | 1 + .../users/_resource_share_for_orgs.html.erb | 2 +- app/views/users/_show_detail_info.html.erb | 2 +- config/routes.rb | 16 ++--- db/schema.rb | 9 ++- public/stylesheets/org.css | 11 ++-- 17 files changed, 98 insertions(+), 21 deletions(-) diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 5850629f0..9f1d964ef 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -1,5 +1,6 @@ class OrgSubfieldsController < ApplicationController helper :attachments + include FilesHelper layout 'base_org' def create if OrgSubfield.where("organization_id=#{params[:organization_id]} and name=?",params[:name]).count == 0 diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 25ee3dc48..b431678af 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -311,6 +311,7 @@ class OrganizationsController < ApplicationController def agree_apply_subdomain @organization = Organization.find(params[:organization_id]) + OrgMessage.find(params[:act_id]).update_attribute(:viewed, 1) @organization.update_attribute(:domain, params[:org_domain]) if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=?",params[:org_domain]).count == 0 OrgMessage.create(:user_id => params[:user_id], :organization_id => @organization.id, :message_type => 'AgreeApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain]) diff --git a/app/views/attachments/update_file_dense.js.erb b/app/views/attachments/update_file_dense.js.erb index 0a3124e83..7709ee288 100644 --- a/app/views/attachments/update_file_dense.js.erb +++ b/app/views/attachments/update_file_dense.js.erb @@ -6,8 +6,8 @@ $("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@atta :remote => true, :class => "postOptionLink", :method => :post) %>"); <% else %> -$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), - :remote=>true,:class=>"f_l re_open",:method => :post) %>"); +$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), + :remote=>true,:class=>"postOptionLink",:method => :post) %>"); <% end %> <% if @attachment.is_public? %> $("#image_private_<%= @attachment.id%>").html('') diff --git a/app/views/courses/private_or_public.js.erb b/app/views/courses/private_or_public.js.erb index 2f222fdfb..10b787dd4 100644 --- a/app/views/courses/private_or_public.js.erb +++ b/app/views/courses/private_or_public.js.erb @@ -10,7 +10,9 @@ <% else %> <% if @course.is_public? %> $("#set_course_public_<%= @course.id %>").text("设为私有"); + $("#show_course_<%= @course.id %>").attr("title","公开课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)"); <% else %> $("#set_course_public_<%= @course.id %>").text("设为公开"); + $("#show_course_<%= @course.id %>").attr("title","私有课程:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)"); <% end %> <% end %> \ No newline at end of file diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb index cc07950e3..1d69306de 100644 --- a/app/views/layouts/_user_courses.html.erb +++ b/app/views/layouts/_user_courses.html.erb @@ -2,7 +2,7 @@
  • <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", - :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+course.time.to_s+course.term+")"%> + :id => "show_course_#{course.id}",:title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+"("+course.time.to_s+course.term+")"%> <% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>