diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 8fc13c83c..af8990f37 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -55,6 +55,7 @@ class IssuesController < ApplicationController helper :timelog include Redmine::Export::PDF helper :project_score + include ApplicationHelper def index retrieve_query 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/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 63f152eb2..e0afc38ae 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1,6 +1,7 @@ class StudentWorkController < ApplicationController layout "base_courses" include StudentWorkHelper + include ApplicationHelper require 'bigdecimal' require "base64" before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,:search_course_students] diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 2c99b6870..ea9ad2cc0 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -643,7 +643,7 @@ class Attachment < ActiveRecord::Base def decrease_attchments_count if self.container_type == "Project" && !self.project.project_score.nil? - aatach_count = self.container.project_score.attach_num - 1+ + aatach_count = self.container.project_score.attach_num - 1 self.container.project_score.update_attribute(:attach_num, aatach_count) end end 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/_org_courses.html.erb b/app/views/layouts/_org_courses.html.erb index 4085cce22..648f62ecf 100644 --- a/app/views/layouts/_org_courses.html.erb +++ b/app/views/layouts/_org_courses.html.erb @@ -1,31 +1,31 @@ -<% courses.each do |course|%> - <%# pro = Project.find course.course_id %> -
  • - <%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%> - - - - - - - - - - - - - - - - - - - -
  • -<% end %> -<% if courses.size == 5%> -
  • - - -
  • +<% courses.each do |course|%> + <%# pro = Project.find course.course_id %> +
  • + <%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%> + + + + + + + + + + + + + + + + + + + +
  • +<% end %> +<% if courses.size == 5%> +
  • + + +
  • <% end%> \ No newline at end of file diff --git a/app/views/layouts/_org_projects.html.erb b/app/views/layouts/_org_projects.html.erb index 7df93e40b..2e5041d20 100644 --- a/app/views/layouts/_org_projects.html.erb +++ b/app/views/layouts/_org_projects.html.erb @@ -1,30 +1,30 @@ -<% projects.each do |project|%> - <%# pro = Project.find project.project_id %> -
  • - <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%> - - - - - - - - - - - - - - - - - - -
  • -<% end %> -<% if projects.size == 5%> -
  • - - -
  • +<% projects.each do |project|%> + <%# pro = Project.find project.project_id %> +
  • + <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%> + + + + + + + + + + + + + + + + + + +
  • +<% end %> +<% if projects.size == 5%> +
  • + + +
  • <% 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..1ba7e9483 100644 --- a/app/views/layouts/_user_courses.html.erb +++ b/app/views/layouts/_user_courses.html.erb @@ -1,75 +1,75 @@ -<% courses.each do |course|%> -
  • - <% 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+")"%> - <% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %> - -
  • -<% end %> - -<% if courses.size == 5%> -
  • - - -
  • +<% courses.each do |course|%> +
  • + <% 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' : ''}", + :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 %> + +
  • +<% end %> + +<% if courses.size == 5%> +
  • + + +
  • <% end%> \ No newline at end of file diff --git a/app/views/layouts/_user_projects.html.erb b/app/views/layouts/_user_projects.html.erb index b103118ba..e249a0f37 100644 --- a/app/views/layouts/_user_projects.html.erb +++ b/app/views/layouts/_user_projects.html.erb @@ -1,7 +1,7 @@ <% projects.each do |project|%>
  • <% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %> - <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%> + <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>