diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e98220d26..d485e0924 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -170,6 +170,7 @@ class UsersController < ApplicationController render_404 return end + @message_alls = paginateHelper @message_alls,25 respond_to do |format| format.html{render :layout=>'new_base_user'} end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index a26d2661a..412c3f889 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -380,6 +380,22 @@ module IssuesHelper value = content_tag("i", h(value)) if value end end + # 缺陷更新结果在消息中显示样式 + if no_html == "message" + label = content_tag(:span, label, :class => "issue_update_message") + old_value = content_tag("span", h(old_value)) if detail.old_value + old_value = content_tag("del", old_value) if detail.old_value and detail.value.blank? + if detail.property == 'attachment' && !value.blank? && atta = Attachment.find_by_id(detail.prop_key) + # Link to the attachment if it has not been removed + if options[:token].nil? + value = atta.filename + else + value = atta.filename + end + else + value = content_tag(:span, h(value), :class => "issue_update_message_value") if value + end + end if detail.property == 'attr' && detail.prop_key == 'description' s = l(:text_journal_changed_no_detail, :label => label) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index ebfd9f881..e7ab001da 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -425,9 +425,13 @@ module UsersHelper return str.html_safe end + # journal.details 记录每个动作的新旧值 def get_issue_des_update(journal) - arr = details_to_strings(journal.details,true) - arr << journal.notes + no_html = "message" + arr = details_to_strings(journal.details, no_html) + unless journal.notes.empty? + arr << "留言内容:" + journal.notes + end str = '' arr.each { |item| str = str+item } return str diff --git a/app/models/journal.rb b/app/models/journal.rb index 3a9f5a89d..0d86d12ff 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -174,7 +174,7 @@ class Journal < ActiveRecord::Base if self.user_id != self.issue.author_id self.forge_messages << ForgeMessage.new(:user_id => self.issue.author_id, :project_id => self.issue.project_id, :viewed => false) end - if self.user_id != self.issue.assigned_to_id # 指派人不是自己的话,则给指派人发送 + if self.user_id != self.issue.assigned_to_id && self.issue.assigned_to_id != self.issue.author_id # 指派人不是自己的话,则给指派人发送 self.forge_messages << ForgeMessage.new(:user_id => self.issue.assigned_to_id, :project_id => self.issue.project_id, :viewed => false) end end diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 1f5f2e1a6..6f775e7a2 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -212,33 +212,11 @@ class JournalsForMessage < ActiveRecord::Base if self.user_id != self.reply_id # 添加我回复的那个人 receivers << reply_to end - if self.user_id != self.parent.jour_id # 给东家发信息 + if self.user_id != self.parent.jour_id && self.reply_id != self.parent.jour_id # 给东家发信息,如果回复的对象是东家则不发 receivers << self.parent.jour end - # if self.user_id != self.parent.user_id - # receivers << reply_to - # if self.reply_id != self.parent.user_id - # receivers << self.parent.user - # end - # else - # receivers << reply_to - # end - - # 添加留言回复人 - #reply_to = User.find(self.reply_id) - #if self.user_id != self.parent.user_id && self.user_id != self.parent.jour_id # 如果回帖人不是用户自己 - # receivers << self.parent.user - # if self.reply_id != self.parent.user_id - # receivers << reply_to - # end - #else # 用户自己回复别人的,别人收到消息通知 - # if self.user_id != self.reply_id # 过滤掉自己回复自己的 - # receivers << reply_to - # end - #end end if self.jour_type == 'Principal' - receivers.each do |r| self.user_feedback_messages << UserFeedbackMessage.new(:user_id => r.id, :journals_for_message_id => self.id, :journals_for_message_type => "Principal", :viewed => false) end diff --git a/app/models/user.rb b/app/models/user.rb index 61dd60eec..b08b29981 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -263,6 +263,7 @@ class User < Principal user_memo_count = MemoMessage.where("user_id =? and viewed =?", User.current.id, 0).count messages_count = course_count + forge_count + user_feedback_count + user_memo_count end + # 查询指派给我的缺陷记录 def issue_status_update self.status_updates diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index edc869a91..9c4bde60d 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -62,7 +62,7 @@ <%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>

- +
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb index 7bd1b0bc2..0233f7a42 100644 --- a/app/views/mailer/send_for_user_activities.html.erb +++ b/app/views/mailer/send_for_user_activities.html.erb @@ -327,6 +327,7 @@ <% end %>
+ <% @project_news_comments.each do |project_news_comment|%>
  • diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 7e42d8332..73c1d2a72 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -1,5 +1,4 @@ - -
    +
    消息
      @@ -29,6 +28,8 @@
    +
    +
    <% if @new_message_count >0 %> <%# 课程消息 %> @@ -38,8 +39,7 @@ <% if ma.course_message_type == "News" %>
    • <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %>
    • -
    • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %>
    • -
    • ">发布了通知
    • +
    • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">发布了通知
    • <%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id }, :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", @@ -50,8 +50,7 @@ <% if ma.course_message_type == "Comment" %>
      • <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
      • -
      • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %>
      • -
      • ">评论了通知
      • +
      • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">评论了通知
      • <%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id }, :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", @@ -62,8 +61,7 @@ <% if ma.course_message_type == "HomeworkCommon" %>
        • <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
        • -
        • <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %>
        • -
        • ">发布了作业
        • +
        • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">发布了作业
        • <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %>
        • <%= time_tag(ma.course_message.created_at).html_safe %>
        • @@ -72,8 +70,7 @@ <% if ma.course_message_type == "Poll" %>
          • <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
          • -
          • <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %>
          • -
          • ">发布了问卷
          • +
          • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">发布了问卷
          • <%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id), :class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", @@ -86,14 +83,14 @@
          • <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
          • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %>
          • <% if ma.course_message.parent_id.nil? %> -
          • ">发布了帖子
          • +
          • ">发布了课程帖子
          • <%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", :title => "#{ma.course_message.subject.html_safe}" %>
          • <%= time_tag(ma.course_message.created_on).html_safe %>
          • <% else %> -
          • ">回复了帖子
          • +
          • ">评论了课程帖子
          • <%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", @@ -117,8 +114,7 @@ <% if ma.course_message_type == "JournalsForMessage" %> @@ -165,7 +161,7 @@
          • <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
          • <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
          • -
          • "><%= ma.forge_message.parent_id.nil? ? "发布了帖子" : "回复了帖子" %>
          • +
          • "><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子" : "评论了项目帖子" %>
          • <%=link_to ma.forge_message.subject.html_safe, project_boards_path(ma.forge_message.project, :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id, @@ -193,7 +189,7 @@
            • <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
            • <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
            • -
            • ">回复了新闻
            • +
            • ">评论了新闻
            • <%= link_to "#{ma.forge_message.comments.html_safe}", {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%>
            • @@ -238,7 +234,11 @@ <% end %> <% end %> <% end %> +
                + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
              <% end %> + <% else %>
              您目前还没有相关消息!
              diff --git a/config/locales/en.yml b/config/locales/en.yml index f532f5cbc..2071529f0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -51,7 +51,7 @@ en: error_session_expired: "Your session has expired. Please login again." warning_attachments_not_saved: "%{count} file(s) could not be saved." - mail_subject_lost_password: "Your %{value} password" + mail_subject_lost_password: "%{value} Your password" mail_body_lost_password: 'To change your password, click on the following link:' mail_subject_register: "Your %{value} account activation" mail_body_register: 'To activate your account, click on the following link:' diff --git a/config/locales/zh.yml b/config/locales/zh.yml index f3d6df6cc..48502f014 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -85,7 +85,7 @@ zh: error_unable_to_connect: "无法连接 (%{value})" warning_attachments_not_saved: "%{count} 个文件保存失败" - mail_subject_lost_password: "您的 %{value} 密码" + mail_subject_lost_password: "%{value} 您的密码" mail_body_lost_password: '请点击以下链接来修改您的密码:' mail_subject_register: "%{value}帐号激活" mail_body_register: '请点击以下链接来激活您的帐号:' diff --git a/public/stylesheets/header.css b/public/stylesheets/header.css index 19b87224e..33c92809b 100644 --- a/public/stylesheets/header.css +++ b/public/stylesheets/header.css @@ -1,17 +1,16 @@ /*新个人主页框架css*/ -.navContainer {width:100%; background-color:#15bccf;} +.navContainer {width:100%; background-color:#269ac9;} .homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;} .homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;} -.navHomepage {width:1000px; height:54px; background-color:#15bccf; margin:0 auto;} +.navHomepage {width:1000px; height:54px; background-color:#269ac9; margin:0 auto;} .navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;} .navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle; padding:0px 10px;} -.navHomepageMenu:hover {background-color:#0ea6b7;} +.navHomepageMenu:hover {background-color:#297fb8;} .navHomepageSearchBoxcontainer {margin-top:11px; } .navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; margin-top:11px; background-color:#ffffff;} .navHomepageSearchInput {width:345px; height:32px; outline:none; border:none !important; float:left;padding: 0 0 0 5px !important; margin:0;} .homepageSearchIcon {width:30px; height:32px; background:url(../images/nav_icon.png) -8px 3px no-repeat; float:left;} a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-repeat;} -.navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} #navSearchAlert {display:none;} .navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} @@ -76,7 +75,7 @@ a.newsBlue {color:#15bccf;} a.newsBlue:hover {color:#0781b4;} a.menuGrey {color:#808080;} a.menuGrey:hover {color:#fe7d68;} -.navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} +.navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #e1e1e1; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} #navSearchAlert {display:none;} /*myctrip*/ @@ -110,5 +109,5 @@ a.f_grey:hover {color:#000000 !important;} /*注册登陆页面*/ #loginSignButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;} #loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;} -#loginSignButton:hover {background-color:#0ea6b7;} -#loginInButton:hover {background-color:#0ea6b7;} +#loginSignButton:hover {background-color:#297fb8;} +#loginInButton:hover {background-color:#297fb8;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index de471ea5a..93ef2bd54 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -11,7 +11,7 @@ a:hover,a:active{color:#000;} /*常用*/ /*#RSide{ background:#fff;}*/ -#users_setting{clear:both;width:730px;background: #fff;padding: 10px;/*滑动门的宽度*/} +#users_setting{clear:both;width:728px;background: #fff;padding: 10px;/*滑动门的宽度*/} /*上传图片处理*/ .upload_img img{max-width: 100%;} blockquote img{max-width: 100%;} @@ -411,7 +411,7 @@ a.replyGrey:hover {color:#4b4b4b;} /*上传资源弹窗*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} -.uploadDialogText {font-size:16px; color:#.uploadDialogText; line-height:16px; padding-top:20px; width:140px; display:inline-block;} +.uploadDialogText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block; font-weight: bold;} .uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative} .uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#269ac9; border-radius:3px; float:left; margin-right:12px;} a.uploadBoxIcon {background:url(images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:81px; height:30px; padding-left:22px; font-size:14px; color:#ffffff;} @@ -427,7 +427,7 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; /*.resourceShareContainer {width:100%; height:100%; background:#666; filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5; position:absolute; left:0; top:0; z-index:-999;}*/ /*.resourceSharePopup {width:300px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;}*/ .resourceSharePopup {width:300px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;} -.sendText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:100px; display:inline-block;} +.sendText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:100px; display:inline-block; font-weight: bold;} .resourcesSendTo {float:left; height:20px; margin-top:15px;} .resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;} .resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;} @@ -441,8 +441,9 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .courseSendSubmit {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#269ac9; margin-right:25px; float:left;cursor: pointer;} .courseSendSubmit:hover {background-color:#297fb8;} .courseSendCancel {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#c1c1c1; float:left} +.courseSendCancel:hover {background-color: #717171;} a.sendSourceText {font-size:14px; color:#ffffff;} -input.sendSourceText {font-size:14px;color:#ffffff;background-color:#269ac9;cursor: pointer;} +input.sendSourceText {font-size:14px;color:#ffffff;background-color:#269ac9;cursor: pointer; outline: none; border: none; width: 50px; height: 25px;} input.sendSourceText:hover {background-color:#297fb8;} /*input.sendSourceText:hover {font-size:14px; color:#ffffff;}*/ .resourcesSendTo {float:left; height:20px; margin-top:15px;} @@ -526,8 +527,9 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} .newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;} .homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;} .homepageNewsPortrait {width:40px; display:block; margin-top:7px;} -.homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } -.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;} +.homepageNewsPublisher {width:80px; max-width:80px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.homepageNewsType {width:90px; padding-left: 5px; font-size:12px; color:#888888; display:block;} +.homepageNewsPubType {width:175px; font-size:12px; color:#888888; display: block;} .homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} a.homepageWhite {color:#ffffff;} @@ -919,7 +921,9 @@ img.ui-datepicker-trigger { .homepageNewsTypeNotRead {width:95px; font-size:12px; color:#888888; display:block;} .calendar_input{border-left:none !important;border-bottom: none!important; border-top: none!important; border-right: 1px solid #d9d9d9;} .calendar_div{border: 1px solid #d9d9d9;} - +/*缺陷更新动态在消息中显示样式*/ +.issue_update_message{padding-left: 2px; margin-right: 3px;} +.issue_update_message_value{margin-right: 8px;} #attachments_fields input.filename { border: 0; height: 1.8em;