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 %> -
- <%= get_user_roll @user %> -
- <% end%> -- <%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %> -
-+ <%= get_user_roll @user %> +
+ <% end%> ++ <%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %> +
+<%=(User.find project.user_id).show_name %>(组长)
-<%=time_from_now time %> <%= project.commits_count %>提交
-<%=(User.find project.user_id).show_name %>(组长)
+<%=time_from_now time %> <%= project.project_score.changeset_num %>提交
+添加成员
- <%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%> - - <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript org_member_autocomplete_org_member_index_path(:org=>@organization, :format => 'js') }')" %> -新增栏目
- <%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %> - -域名目录(用户自定义url,可选)
- <% if @organization.domain %> - <%= @organization.domain %>.trustie.net/ - <% else %> - 您还没有子域名,请先在左侧信息栏申请子域名 - <% end %> - -添加成员
+ <%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%> + + <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript org_member_autocomplete_org_member_index_path(:org=>@organization, :format => 'js') }')" %> +新增栏目
+ <%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %> + +域名目录(用户自定义url,可选)
+ <% if @organization.domain %> + <%= @organization.domain %>.trustie.net/ + <% else %> + 您还没有子域名,请先在左侧信息栏申请子域名 + <% end %> + +<%=(User.find project.user_id).show_name %>(组长)
-<%=time_from_now time %> <%= project.commits_count %>提交
+<%=time_from_now time %> <%= project.project_score.changeset_num %>提交
<%= user %>
+diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 802723936..980646c87 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -1,306 +1,306 @@ -<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %> -
<%=(User.find project.user_id).show_name %>(组长)
-<%=time_from_now time %> <%= project.commits_count %>提交
-<%=(User.find project.user_id).show_name %>(组长)
+<%=time_from_now time %> <%= project.project_score.changeset_num %>提交
+