diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 8eb6a6860..1674055ac 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -31,8 +31,8 @@ class RepositoriesController < ApplicationController default_search_scope :changesets before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo] - before_filter :find_repository, :only => [:edit, :update, :destroy, :committers, :forked] - before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo,:to_gitlab] + before_filter :find_repository, :only => [:edit, :update, :destroy, :committers] + before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked] accept_rss_auth :revisions @@ -64,6 +64,8 @@ class RepositoriesController < ApplicationController end def forked + @project = Project.find(params[:id]) + @repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab") # 如果当前用户已经fork过该项目,不会新fork项目,则跳至已fork的项 unless has_forked?(@project, User.current) project = project_from_current_project(@project.id, User.current.id) @@ -76,7 +78,11 @@ class RepositoriesController < ApplicationController else g = Gitlab.client if User.current.gid.nil? - g.sync_user(User.current) + begin + g.sync_user(User.current) + ensure + logger.error "Synv user failed ==>#{User.current.id}" + end end gproject = g.fork(@project.gpid, User.current.gid) if gproject @@ -351,7 +357,7 @@ update @changesets = g.commits(@project.gpid, :ref_name => @rev) # @changesets = @repository.latest_changesets(@path, @rev) # @changesets_count = @repository.latest_changesets(@path, @rev).count - @changesets_all_count = 0 + @changesets_all_count = @project.gpid.nil? ? 0 : g.commits_total_count(@project.gpid).count @changesets_latest_coimmit = @changesets[0] @properties = @repository.properties(@path, @rev) @repositories = @project.repositories @@ -383,10 +389,10 @@ update @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s) #add by hx - rep_count = commit_count(@project) + #rep_count = commit_count(@project) #页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化 - @commits_count = rep_count + @commits_count = params[:commit_count].to_i @commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page] @commit = g.commit(@project.gpid,@rev) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c4bbc4ebb..4bdffb9dc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -253,8 +253,10 @@ module ApplicationHelper subject = truncate(subject, :length => 60) end end - if issue.status_id == 5 + if issue.status_id == 3 s = link_to text, issue_path(issue), :class => "text_line_s", :title => title + elsif issue.status_id == 5 + s = link_to text, issue_path(issue), :class => "text_line_s del_line", :title => title else s = link_to text, issue_path(issue), :class => "c_blue", :title => title end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 551ddd616..1cbe7421c 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -394,7 +394,7 @@ class Mailer < ActionMailer::Base @issue = issue user = User.find_by_mail(recipients) @user = user - @token = Token.get_token_from_user(user, 'autologin') + # @token = Token.get_token_from_user(user, 'autologin') @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id) # edit @@ -436,15 +436,15 @@ class Mailer < ActionMailer::Base user = User.find_by_mail(recipients) @user = user - @token = Token.get_token_from_user(user, 'autologin') + # @token = Token.get_token_from_user(user, 'autologin') # edit - @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value) - @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) - @user_url = url_for(my_account_url(user,:token => @token.value)) + @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id) + @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id) + @user_url = url_for(my_account_url(user)) - @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}", :token => @token.value) + @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :anchor => "change-#{journal.id}") s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] " s << "(#{issue.status.name}) " if journal.new_value_for('status_id') s << issue.subject diff --git a/app/views/mailer/issue_add.html.erb b/app/views/mailer/issue_add.html.erb index d77149831..0d8bb0007 100644 --- a/app/views/mailer/issue_add.html.erb +++ b/app/views/mailer/issue_add.html.erb @@ -6,7 +6,7 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/issue_add.text.erb b/app/views/mailer/issue_add.text.erb index cc2eb814f..1793fb22d 100644 --- a/app/views/mailer/issue_add.text.erb +++ b/app/views/mailer/issue_add.text.erb @@ -4,6 +4,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index a02fe47f5..16e0967c2 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -9,7 +9,7 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/issue_edit.text.erb b/app/views/mailer/issue_edit.text.erb index d1d625cec..8730d8a16 100644 --- a/app/views/mailer/issue_edit.text.erb +++ b/app/views/mailer/issue_edit.text.erb @@ -9,6 +9,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb index ae5604099..7fdd737e3 100644 --- a/app/views/mailer/send_for_user_activities.html.erb +++ b/app/views/mailer/send_for_user_activities.html.erb @@ -16,16 +16,16 @@
  • [ - <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value), + <%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value), :class => "wmail_name", + <%= link_to course_new.author, user_activities_url(course_new.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_notice) %> - <%= link_to truncate(course_new.title.html_safe,length: 30,omission: '...'), news_url(course_new,:token => @token.value), + <%= link_to truncate(course_new.title.html_safe,length: 30,omission: '...'), news_url(course_new), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -39,17 +39,17 @@ [ <% unless course_news_comment.commented.nil? %> - <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value), + <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value), :class => "wmail_name", + <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_notice_reply) %> - <%= link_to truncate(l(:label_course_notice_point),length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value), + <%= link_to truncate(l(:label_course_notice_point),length: 30,omission: '...'), news_url(course_news_comment.commented), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -72,16 +72,16 @@ [ - <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course, :token => @token.value), + <%= link_to truncate(bid.course.name,length: 30,omission: '...'), course_url(bid.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value), :class => "wmail_name", + <%= link_to bid.user, user_activities_url(bid.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_course_homework) %> - <%= link_to truncate(bid.name.html_safe,length: 30,omission: '...'), student_work_index_url(:homework => bid.id,:token => @token.value), + <%= link_to truncate(bid.name.html_safe,length: 30,omission: '...'), student_work_index_url(:homework => bid.id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -105,16 +105,16 @@ [ - <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value), + <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value), :class => "wmail_name", + <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value), + <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -135,14 +135,14 @@
  • [ - <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value), + <%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value), :class => "wmail_name", + <%= link_to course_message.author, user_activities_url(course_message.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_messages) %> - <%= link_to truncate(course_message.subject.html_safe,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value), + <%= link_to truncate(course_message.subject.html_safe,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(course_message.created_on) %> @@ -163,16 +163,16 @@ [ - <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value), + <%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value), :class => "wmail_name", + <%= link_to attachment.author, user_activities_url(attachment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_course_file_upload) %> - <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value), + <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -199,14 +199,14 @@
  • [ - <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value), + <%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value), :class => "wmail_name", + <%= link_to issue.author, user_activities_url(issue.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_issue) %> - <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value), + <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue), :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(issue.created_on) %> @@ -217,14 +217,14 @@
  • [ - <%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value), + <%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value), :class => "wmail_name", + <%= link_to issues_journal.user, user_activities_url(issues_journal.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_issue_update) %> - <%= link_to truncate(issues_journal.issue.subject, length:30,omission:'...'),issue_url(issues_journal.issue, :token => @token.value), + <%= link_to truncate(issues_journal.issue.subject, length:30,omission:'...'),issue_url(issues_journal.issue), :style => "color:#2E8DD7;float:left;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" @@ -251,16 +251,16 @@ [ - <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value), + <%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_message.author, user_activities_url(project_message.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_messages) %> - <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value), + <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -283,16 +283,16 @@ [ <% unless wikicontent.page.nil? %> - <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value), + <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value), :class => "wmail_name", + <%= link_to wikicontent.author, user_activities_url(wikicontent.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_wiki_mail_notification) %> <% unless wikicontent.page.nil? %> - <%= link_to wikicontent.text.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_wiki_url(wikicontent.page.wiki,:token => @token.value), + <%= link_to wikicontent.text.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_wiki_url(wikicontent.page.wiki), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px;height:23px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> @@ -314,15 +314,15 @@ [ - <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value), + <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_new.author, user_activities_url(project_new.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_mail_notice) %> - <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value), + <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(project_new.created_on) %> @@ -336,16 +336,16 @@ [ <% unless project_news_comment.commented.nil? %> - <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value), + <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <% end %> ] - <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:lable_project_mail_notice_reply) %> - <%= link_to truncate(l(:lable_project_notice_point),length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value), + <%= link_to truncate(l(:lable_project_notice_point),length: 30,omission: '...'), news_url(project_news_comment.commented), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= format_time(project_news_comment.created_on) %> @@ -366,16 +366,16 @@ [ - <%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value), + <%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value), :class => "wmail_name", + <%= link_to project_attachment.author, user_activities_url(project_attachment.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_project_mail_upload) %> - <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'), project_files_url(project_attachment.project,:token => @token.value), + <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'), project_files_url(project_attachment.project), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -398,16 +398,16 @@ [ - <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value), + <%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project), :class=> "wmail_column", :style=> " font-weight: bold; display:block; float:left; color:#666;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> ] - <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value), :class => "wmail_name", + <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to project_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_feedback_url(project_journal_message.project,:token => @token.value), + <%= link_to project_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe, project_feedback_url(project_journal_message.project), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -434,12 +434,12 @@
  • - <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value), + <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= l(:label_show_your_message) %> - <%= link_to user_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe,feedback_url(@user,:token => @token.value), + <%= link_to user_journal_message.notes.gsub("

    ","").gsub("

    ","").gsub("
    ","").html_safe,feedback_url(@user), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -466,12 +466,12 @@
  • - <%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value), + <%= link_to forum.creator, user_activities_url(forum.creator), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= l(:label_forum_new) %> - <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum,:token => @token.value), + <%= link_to truncate(forum.name,length: 30,omission: '...'),forum_url(forum), :class => 'wmail_info', :style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> @@ -492,7 +492,7 @@
  • - <%= link_to memo.author, user_activities_url(memo.author,:token => @token.value), + <%= link_to memo.author, user_activities_url(memo.author), :class => "wmail_name", :style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %> <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %> @@ -516,7 +516,7 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/mailer/send_for_user_activities.text.erb b/app/views/mailer/send_for_user_activities.text.erb index f86dec62d..f4c354790 100644 --- a/app/views/mailer/send_for_user_activities.text.erb +++ b/app/views/mailer/send_for_user_activities.text.erb @@ -6,11 +6,11 @@ <%= l(:label_course_news) %> <% @course_news.each do |course_new|%> - ▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%> ] + ▪[<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course)%> ] - <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value) %> + <%= link_to course_new.author, user_activities_url(course_new.author) %> <%= l(:label_project_notice) %> - <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value) %> + <%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new) %> <%= format_time(course_new.created_on) %> <% end %> <% end %> @@ -19,12 +19,12 @@ <%= l(:label_course_news) %> <% @course_news_comments.each do |course_news_comment|%> ▪[ <% unless course_news_comment.commented.nil? %> - <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course, :token => @token.value) %> + <%= link_to truncate(course_news_comment.commented.course.name,length: 30,omission: '...'), course_url(course_news_comment.commented.course) %> <% end %> ] - <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author,:token => @token.value) %> + <%= link_to course_news_comment.author, user_activities_url(course_news_comment.author) %> <%= l(:label_project_notice_reply) %> - <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented,:token => @token.value) %> + <%= link_to truncate(course_news_comment.comments,length: 30,omission: '...'), news_url(course_news_comment.commented) %> <%= format_time(course_news_comment.created_on) %> <% end %> <% end %> @@ -33,10 +33,10 @@ <%= l(:label_homework_overview) %> <% unless @bids.first.nil?%> <% @bids.each do |bid| %> - ▪[<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value) %>] - <%= link_to bid.user, user_activities_url(bid.user,:token => @token.value) %> + ▪[<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course) %>] + <%= link_to bid.user, user_activities_url(bid.user) %> <%= l(:label_course_homework) %> - <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value) %> + <%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id) %> <%= format_time(bid.created_at) %> <% end %> <% end %> @@ -46,10 +46,10 @@ <% unless @course_journal_messages.first.nil? %> <%= l(:view_course_journals_for_messages) %> <% @course_journal_messages.each do |course_journal_message|%> - [ <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value) %>] - <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value) %> + [ <%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course) %>] + <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user) %> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value) %> + <%= link_to truncate(course_journal_message.notes.html_safe,length: 30,omission: '...'), course_feedback_url(course_journal_message.course) %> <%= format_time(course_journal_message.created_on) %> <% end %> <% end %> @@ -57,10 +57,10 @@ <% unless @course_messages.first.nil? %> <%= l(:view_borad_course) %> <% @course_messages.each do |course_message|%> - ▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)%>] - <%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value) %> + ▪[<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course)%>] + <%= link_to course_message.author, user_activities_url(course_message.author) %> <%= l(:label_send_course_messages) %> - <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value) %> + <%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id) %> <%= format_time(course_message.created_on) %> <% end %> <% end %> @@ -68,10 +68,10 @@ <% unless @attachments.first.nil? %> <%= l(:label_course_mail_files) %> <% @attachments.each do |attachment|%> - ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value) %>] - <%= link_to attachment.author, user_activities_url(attachment.author,:token => @token.value) %> + ▪[<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course) %>] + <%= link_to attachment.author, user_activities_url(attachment.author) %> <%= l(:label_course_file_upload) %> - <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value) %> + <%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course) %> <%= format_time(attachment.created_on) %> <% end %> @@ -86,10 +86,10 @@ <% unless @issues.first.nil? %> <%= l(:label_issue_tracking) %> <% @issues.each do |issue|%> - ▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value) %>] - <%= link_to issue.author, user_activities_url(issue.author,:token => @token.value) %> + ▪[<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project) %>] + <%= link_to issue.author, user_activities_url(issue.author) %> <%= l(:label_project_issue) %> - <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %> + <%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue) %> <%= format_time(issue.created_on) %> <% end %> @@ -99,13 +99,13 @@ <% unless @issues_journals.first.nil? %> <%= l(:label_issue_tracking) %> <% @issues_journals.each do |issues_journal| %> - ▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project, :token => @token.value) %>] - <%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value) %> + ▪[<%= link_to truncate(issues_journal.issue.project.name,length: 30,omission: '...'), project_url(issues_journal.issue.project) %>] + <%= link_to issues_journal.user, user_activities_url(issues_journal.user) %> <%= l(:label_project_issue_update) %> <% if issues_journal.notes.nil? %> - <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value) %> + <%= link_to truncate(issues_journal.issue.subject,length: 30,omission: '...'),issue_url(issue) %> <% else %> - <%= link_to truncate(issues_journal.notes.html_safe,length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value) %> + <%= link_to truncate(issues_journal.notes.html_safe,length: 30,omission: '...'),issue_url(issues_journal.issue) %> <% end %> <%= format_time(issues_journal.created_on) %> <% end %> @@ -115,10 +115,10 @@ <% unless @project_messages.first.nil? %> <%= l(:project_moule_boards_show) %> <% @project_messages.each do |project_message|%> - ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value) %>] - <%= link_to project_message.author, user_activities_url(project_message.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project) %>] + <%= link_to project_message.author, user_activities_url(project_message.author) %> <%= l(:label_send_course_messages) %> - <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value) %> + <%= link_to truncate(project_message.subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id) %> <%= format_time(project_message.created_on) %> <% end %> @@ -129,13 +129,13 @@ <%= l(:label_wiki) %> <% @wiki_contents.each do |wikicontent|%> ▪[<% unless wikicontent.page.nil? %> - <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project, :token => @token.value) %> + <%= link_to truncate(wikicontent.page.wiki.project.name,length: 30,omission: '...'), project_url(wikicontent.page.wiki.project) %> <% end %> ] - <%= link_to wikicontent.author, user_activities_url(wikicontent.author,:token => @token.value) %> + <%= link_to wikicontent.author, user_activities_url(wikicontent.author) %> <%= l(:label_wiki_mail_notification) %> <% unless wikicontent.page.nil? %> - <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value) %> + <%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki) %> <% end %> <%= format_time(wikicontent.updated_on) %> <% end %> @@ -145,10 +145,10 @@ <% unless @project_news.first.nil? %> <%= l(:label_project_news) %> <% @project_news.each do |project_new|%> - ▪[<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value) %> ] - <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project) %> ] + <%= link_to project_new.author, user_activities_url(project_new.author) %> <%= l(:label_project_mail_notice) %> - <%= link_to truncate(project_new.title.html_safe,length: 30,omission: '...'), news_url(project_new,:token => @token.value) %> + <%= link_to truncate(project_new.title.html_safe,length: 30,omission: '...'), news_url(project_new) %> <%= format_time(project_new.created_on) %> <% end %> <% end %> @@ -158,11 +158,11 @@ <%= l(:label_project_news) %> <% @project_news_comments.each do |project_news_comment|%> ▪[ <% unless project_news_comment.commented.nil? %> - <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project, :token => @token.value) %> + <%= link_to truncate(project_news_comment.commented.project.name,length: 30,omission: '...'), project_url(project_news_comment.commented.project) %> <% end %>] - <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author,:token => @token.value) %> + <%= link_to project_news_comment.author, user_activities_url(project_news_comment.author) %> <%= l(:lable_project_mail_notice_reply) %> - <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented,:token => @token.value) %> + <%= link_to truncate(project_news_comment.comments.html_safe,length: 30,omission: '...'), news_url(project_news_comment.commented) %> <%= format_time(project_news_comment.created_on) %> <% end %> @@ -172,10 +172,10 @@ <% unless @project_attachments.first.nil? %> <%= l(:label_project_mail_attachments) %> <% @project_attachments.each do |project_attachment|%> - ▪[<%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project, :token => @token.value) %>] - <%= link_to project_attachment.author, user_activities_url(project_attachment.author,:token => @token.value) %> + ▪[<%= link_to truncate(project_attachment.project.name,length: 30,omission: '...'), project_url(project_attachment.project) %>] + <%= link_to project_attachment.author, user_activities_url(project_attachment.author) %> <%= l(:label_project_mail_upload) %> - <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'),project_files_url(project_attachment.project,:token => @token.value) %> + <%= link_to truncate(project_attachment.filename,length: 30,omission: '...'),project_files_url(project_attachment.project) %> <%= format_time(project_attachment.created_on) %> <% end %> <% end %> @@ -184,10 +184,10 @@ <% unless @project_journal_messages.first.nil? %> <%= l(:label_project_mail_feedback) %> <% @project_journal_messages.each do |project_journal_message|%> - ▪[<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project, :token => @token.value) %> ] - <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user,:token => @token.value) %> + ▪[<%= link_to truncate(project_journal_message.project.name,length: 30,omission: '...'), project_url(project_journal_message.project) %> ] + <%= link_to project_journal_message.user, user_activities_url(project_journal_message.user) %> <%= l(:label_send_course_journals_for_messages) %> - <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value) %> + <%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project) %> <%= format_time(project_journal_message.created_on) %> <% end %> @@ -202,9 +202,9 @@ <%= l(:label_user_message) %> (<%= @user_journal_messages.count %>) <% @user_journal_messages.each do |user_journal_message|%> - ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)%> + ▪ <%= link_to user_journal_message.user, user_activities_url(user_journal_message.user)%> <%= l(:label_show_your_message) %> - <%= link_to truncate(user_journal_message.notes.html_safe,length: 30,omission: '...'), feedback_url(@user,:token => @token.value) %> + <%= link_to truncate(user_journal_message.notes.html_safe,length: 30,omission: '...'), feedback_url(@user) %> <%= format_time(user_journal_message.created_on) %> <% end %> <% end %> @@ -214,9 +214,9 @@ <% unless @forums.first.nil? %> <%= l(:label_user_forum) %> <% @forums.each do |forum|%> - ▪<%= link_to forum.creator, user_activities_url(forum.creator,:token => @token.value) %> + ▪<%= link_to forum.creator, user_activities_url(forum.creator) %> <%= l(:label_forum_new) %> - <%= link_to truncate(forum.name.html_safe,length: 30,omission: '...'),forum_url(forum,:token => @token.value) %> + <%= link_to truncate(forum.name.html_safe,length: 30,omission: '...'),forum_url(forum) %> <%= format_time(forum.created_at) %> <% end %> @@ -224,7 +224,7 @@ <% unless @memos.first.nil? %> <%= l(:label_user_message_forum) %> <% @memos.each do |memo|%> - ▪<%= link_to memo.author, user_activities_url(memo.author,:token => @token.value)%> + ▪<%= link_to memo.author, user_activities_url(memo.author)%> <%= memo.parent_id.nil? ? l(:label_memo_new_from_forum) : l(:label_reply) %> <%= link_to truncate(memo.subject.html_safe,length: 30,omission: '...'),forum_memo_url(memo.forum, (memo.parent_id.nil? ? memo : memo.parent_id))%> <%= format_time(memo.created_at) %> @@ -238,6 +238,6 @@ <% if Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten][@user.mail_notification] == mail_option %> <%= l(mail_option) %> <% else %> - <%= link_to l(mail_option), my_change_mail_notification_url(token: @token.value,mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> + <%= link_to l(mail_option), my_change_mail_notification_url(mail_notification: Hash[*User::MAIL_NOTIFICATION_OPTIONS.flatten].invert[mail_option]), :style => "margin-top:20px;color:#2775d2; margin-left:10px;" %> <% end %> <% end %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index da7f79dd8..afe4740eb 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -41,7 +41,7 @@
    <%= @changesets_latest_coimmit.message %>
    <% else %> -
    <%=@changesets_latest_coimmit.author_email %>
    +
    <%=@changesets_latest_coimmit.author_email %>
    提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
    <%= @changesets_latest_coimmit.message %>
    @@ -51,9 +51,8 @@ <%= @repository.branches.count %> 个分支
    - - - <%=link_to"提交明细", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %> + + <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %> 提交 diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 0258b3b83..052443155 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -1,9 +1,10 @@ -<%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id)) do |f|%> +<%= form_for('new_form', :remote => true, :method => :post,:url => add_score_student_work_path(work.id),:id=>'add_score_'+work.id.to_s) do |f|%>
  • 评价: - <%= f.text_area 'user_message', :class => 'hwork_ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %> + <%= f.text_area 'user_message', :class => 'hwork_ping_text', :id => 'score_comment_'+work.id.to_s, :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
  • +

  • 评分: @@ -16,7 +17,19 @@ <%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %> <%end%> - 提交 + 提交
  • -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb index 5bd2a9f3c..99c119a0c 100644 --- a/app/views/words/_new_respond_course.html.erb +++ b/app/views/words/_new_respond_course.html.erb @@ -1,9 +1,9 @@ -<%= form_tag(words_create_reply_path, :remote => true,:id=>"form_#{journal.id}") do %> +<%= form_tag(words_create_reply_path, :remote => true) do %> <%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5', :style => "resize: none;overflow: hidden;",:rows => 4, :placeholder => l(:label_feedback_respond_content)#, - #:maxlength => 250 + #:maxlength => 250 %>

    <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> @@ -13,20 +13,6 @@
    <%= submit_tag l(:button_feedback_respond), :name => nil , - :class => "reply_btn" ,:onclick=>"form_sub_#{ journal.id}($(this),event)"%> + :class => "reply_btn"%> -<% end %> - +<% end %> \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 03424bd5a..10241b4b3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -703,6 +703,7 @@ zh: label_search_by_login: 登录名 label_search_by_name: 名字 label_search_by_email: 邮箱 + label_search_by_occupation: 单位 label_result_plural: 结果 label_all_words: 所有单词 label_wiki: Wiki diff --git a/db/schema.rb b/db/schema.rb index 8e946c493..52c7755e9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1569,6 +1569,7 @@ ActiveRecord::Schema.define(:version => 20151218110033) do end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + add_index "student_works", ["homework_common_id"], :name => "index" create_table "student_works_evaluation_distributions", :force => true do |t| t.integer "student_work_id" diff --git a/lib/tasks/hjq_test.rake b/lib/tasks/hjq_test.rake new file mode 100644 index 000000000..f0be77fe6 --- /dev/null +++ b/lib/tasks/hjq_test.rake @@ -0,0 +1,18 @@ +namespace :hjq do + namespace :news do + desc "news order" + task :users => :environment do + a = [] + # news = News.where("course_id =?", 122) + course.news.each do |new| + unless new.comments.blank? + latest_comment = new.comments.sort! { |a,b| a.created_on <=> b.created_on}.last + end + a << latest_comment + end + comments = a.map(&:commented_id).detect{|a.b| a.created_on <=> b.created_on} + # comments = a.sort!{|a.b| a.created_on <=> b.created_on} + news = News.where("id in (?)", comments) + end + end +end diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d9f370c7d..7047316c6 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -916,4 +916,5 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r .list_style ul li{list-style-type: disc;margin-left: 20px;} /* @功能 定义 */ -span.at {color:#269ac9;} \ No newline at end of file +span.at {color:#269ac9;} +.del_line{text-decoration:line-through !important;} \ No newline at end of file diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 2e084d61c..baf57c4b1 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -286,4 +286,5 @@ li.commit .commit-row-info .committed_ago { } .rep_history_grey{ color: #7F7F7F; -} \ No newline at end of file +} +.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;} \ No newline at end of file