diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index af6fbd632..e6efca1e8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -94,7 +94,7 @@ class ApplicationController < ActionController::Base Setting.check_cache # Find the current user User.current = find_current_user - logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger + #logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger end # Returns the current user or nil if no user is logged in @@ -300,7 +300,7 @@ class ApplicationController < ActionController::Base render_404 end - #根据course_id找project + #锟斤拷锟絚ourse_id锟斤拷project def find_project_by_course_id @bid = Bid.find params[:course_id] @project = @bid.courses[0] @@ -354,7 +354,7 @@ class ApplicationController < ActionController::Base end #added by nwb - #获取课程 + #锟斤拷取锟轿筹拷 def find_course @course= Course.find(params[:id]) rescue ActiveRecord::RecordNotFound diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 94f8f7c95..53b2e9871 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -179,6 +179,7 @@ class Attachment < ActiveRecord::Base File.join(self.class.storage_path, disk_directory.to_s, disk_filename.to_s) end + #鏍囬 def title title = filename.to_s if description.present? diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 58880919e..f2b69da81 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -15,8 +15,8 @@ class JournalsForMessage < ActiveRecord::Base "m_reply_id" # 鍥炲鏌愮暀瑷鐨勭暀瑷id(a鐣欒█鍥炲浜哹鐣欒█锛岃繖鏄痓鐣欒█鐨刬d) acts_as_tree :foreign_key => 'm_parent_id', :counter_cache => :m_reply_count, :order => "#{JournalsForMessage.table_name}.created_on ASC" - belongs_to :project, - :foreign_key => 'jour_id', + belongs_to :project, + :foreign_key => 'jour_id', :conditions => "#{self.table_name}.jour_type = 'Project' " belongs_to :course, :foreign_key => 'jour_id', diff --git a/app/views/courses/finishcourse.js.erb b/app/views/courses/finishcourse.js.erb index e67426953..75c2b774d 100644 --- a/app/views/courses/finishcourse.js.erb +++ b/app/views/courses/finishcourse.js.erb @@ -4,7 +4,7 @@ console.debug('璇剧▼淇敼鎴愬姛锛氱粨鏉熸椂闂存敼涓<%=Course.find_by_extra(@c <% end %> $('#content-title-top-div').html("<%= j(render partial: 'users/my_course_ex', :locals => {:memberships => @memberships,:user=>@user, :memberships_doing=>@memberships_doing,:memberships_done=>@memberships_done} )%>") -//$('#finish_course_ <%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>") +$('#finish_course_<%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>") <% else %> alert('鏉冮檺涓嶈冻锛岃缃け璐ワ紝璇峰湪璁哄潧鎻愪氦闂锛岀瓑寰呯鐞嗗憳澶勭悊銆'); <% end %> diff --git a/app/views/users/_activity_new_score_index.html.erb b/app/views/users/_activity_new_score_index.html.erb new file mode 100644 index 000000000..0ceb8f157 --- /dev/null +++ b/app/views/users/_activity_new_score_index.html.erb @@ -0,0 +1,8 @@ +
鎶鏈緱鍒嗭細
+
    韪╁埆浜虹殑甯栧瓙 -2
+
    甯栧瓙琚竴绾т細鍛橀《 +4
+
    甯栧瓙琚簩绾т細鍛橀《 +6
+
    甯栧瓙琚笁绾т細鍛橀《 +8
+
    甯栧瓙琚竴绾т細鍛樿俯 -2
+
    甯栧瓙琚簩绾т細鍛樿俯 -4
+
    甯栧瓙琚笁绾т細鍛樿俯 -6
\ No newline at end of file diff --git a/app/views/users/_influence_new_score_index.html.erb b/app/views/users/_influence_new_score_index.html.erb new file mode 100644 index 000000000..9985d26cd --- /dev/null +++ b/app/views/users/_influence_new_score_index.html.erb @@ -0,0 +1,6 @@ +
椤圭洰璐$尞寰楀垎锛
+
    鎻愪氦浠g爜 +4
+
    鎻愪氦鏂囨。 +4
+
    鎻愪氦闄勪欢 +4
+
    鏇存柊缂洪櫡瀹屾垚搴 +2
+
    鍙戝竷缂洪櫡 +4
\ No newline at end of file diff --git a/app/views/users/_project_new_score_index.html.erb b/app/views/users/_project_new_score_index.html.erb new file mode 100644 index 000000000..45e0b0600 --- /dev/null +++ b/app/views/users/_project_new_score_index.html.erb @@ -0,0 +1,2 @@ +
褰卞搷鍔涘緱鍒嗭細
+
    琚叧娉ㄤ汉鏁 +2/浜
diff --git a/app/views/users/_show_new_score.html.erb b/app/views/users/_show_new_score.html.erb index 3fd5f1050..c5f15694e 100644 --- a/app/views/users/_show_new_score.html.erb +++ b/app/views/users/_show_new_score.html.erb @@ -48,23 +48,23 @@ - <%= l(:label_user_score) %> : + <%= link_to l(:label_user_score) , {:controller => 'users', :action => 'score_new_index', :remote => true} %> : <%= format("%.2f" , @user.user_score_attr.total_score).to_f %>
- <%= l(:label_user_score_of_collaboration) %> : + <%= link_to l(:label_user_score_of_collaboration), {:controller => 'users',:action => 'topic_new_score_index', :remote => true} %> : <%= format("%.2f" , @user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %>
- <%= l(:label_user_score_of_influence) %> : + <%= link_to l(:label_user_score_of_influence), {:controller => 'users',:action => 'project_new_score_index', :remote => true} %> : <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence).to_f %>
- <%= l(:label_user_score_of_skill) %> : + <%= link_to l(:label_user_score_of_skill), {:controller => 'users',:action => 'activity_new_score_index', :remote => true} %> : <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %>
- <%= l(:label_user_score_of_active) %> 锛 + <%= link_to l(:label_user_score_of_active), {:controller => 'users',:action => 'influence_new_score_index', :remote => true} %> 锛 <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %>
diff --git a/app/views/users/activity_new_score_index.js.erb b/app/views/users/activity_new_score_index.js.erb new file mode 100644 index 000000000..246d9161f --- /dev/null +++ b/app/views/users/activity_new_score_index.js.erb @@ -0,0 +1 @@ +$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/activity_new_score_index', :locals => {:index =>0 }) %>'); \ No newline at end of file diff --git a/app/views/users/influence_new_score_index.js.erb b/app/views/users/influence_new_score_index.js.erb new file mode 100644 index 000000000..9a9514372 --- /dev/null +++ b/app/views/users/influence_new_score_index.js.erb @@ -0,0 +1 @@ +$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/influence_new_score_index', :locals => {:index =>0 }) %>'); \ No newline at end of file diff --git a/app/views/users/project_new_score_index.js.erb b/app/views/users/project_new_score_index.js.erb new file mode 100644 index 000000000..493bd7fd0 --- /dev/null +++ b/app/views/users/project_new_score_index.js.erb @@ -0,0 +1 @@ +$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/project_new_score_index', :locals => {:index =>0 }) %>'); \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 2d7e2ba18..cc3d68cba 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 => 20140618155324) do +ActiveRecord::Schema.define(:version => 20140626012511) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -793,7 +793,7 @@ ActiveRecord::Schema.define(:version => 20140618155324) do end create_table "relative_memos", :force => true do |t| - t.integer "osp_id", :null => false + t.integer "osp_id" t.integer "parent_id" t.string "subject", :null => false t.text "content", :null => false