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 %>