添加留言提醒
This commit is contained in:
parent
89150e8930
commit
72b37a915a
|
@ -121,6 +121,9 @@ class UsersController < ApplicationController
|
||||||
# modified by fq
|
# modified by fq
|
||||||
def user_newfeedback
|
def user_newfeedback
|
||||||
@jours = @user.journals_for_messages.reverse
|
@jours = @user.journals_for_messages.reverse
|
||||||
|
@jours.each do |jour|
|
||||||
|
jour.update_attribute(:status, false)
|
||||||
|
end
|
||||||
@limit = 10
|
@limit = 10
|
||||||
@feedback_count = @jours.count
|
@feedback_count = @jours.count
|
||||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||||
|
|
|
@ -13,6 +13,7 @@ class WordsController < ApplicationController
|
||||||
refer_user_id = params[:new_form][:reference_user_id].to_i
|
refer_user_id = params[:new_form][:reference_user_id].to_i
|
||||||
|
|
||||||
@user.add_jour(User.current, message, refer_user_id)
|
@user.add_jour(User.current, message, refer_user_id)
|
||||||
|
@user.count_new_jour
|
||||||
# if a_message.size > 5
|
# if a_message.size > 5
|
||||||
# @message = a_message[-5, 5]
|
# @message = a_message[-5, 5]
|
||||||
# else
|
# else
|
||||||
|
@ -27,7 +28,7 @@ class WordsController < ApplicationController
|
||||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||||
@offset ||= @feedback_pages.offset
|
@offset ||= @feedback_pages.offset
|
||||||
@jour = @jours[@offset, @limit]
|
@jour = @jours[@offset, @limit]
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
|
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -81,6 +81,7 @@ class User < Principal
|
||||||
has_many :jours, :class_name => 'JournalsForMessage', :dependent => :destroy
|
has_many :jours, :class_name => 'JournalsForMessage', :dependent => :destroy
|
||||||
has_many :bids, :foreign_key => 'author_id', :dependent => :destroy
|
has_many :bids, :foreign_key => 'author_id', :dependent => :destroy
|
||||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||||
|
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
|
||||||
has_many :journal_replies
|
has_many :journal_replies
|
||||||
has_many :activities
|
has_many :activities
|
||||||
#####
|
#####
|
||||||
|
@ -141,7 +142,11 @@ class User < Principal
|
||||||
|
|
||||||
###添加留言 fq
|
###添加留言 fq
|
||||||
def add_jour(user, notes, reference_user_id = 0)
|
def add_jour(user, notes, reference_user_id = 0)
|
||||||
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
|
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id, :status => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
def count_new_jour
|
||||||
|
count = self.new_jours.count
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_mail_notification
|
def set_mail_notification
|
||||||
|
|
|
@ -7,6 +7,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
|
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
|
||||||
|
<%= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %>
|
||||||
|
<div align="center" style="float: right; margin-right: -32px; margin-top: 5px; background: #ed8924; width: 13px">
|
||||||
|
<%= User.current.count_new_jour%>
|
||||||
|
</div>
|
||||||
|
<!-- <%= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> -->
|
||||||
|
<!-- 消息#{link_to((User.current.count_new_jour), feedback_path(User.current))} -->
|
||||||
|
<!-- <%= content_tag('div', "消息(#{User.current.journals_for_messages.count})".html_safe, :id => 'loggedas')%> -->
|
||||||
<%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
|
<%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
|
||||||
</div>
|
</div>
|
||||||
<div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 5px;margin-top: -10px;"></div>
|
<div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 5px;margin-top: -10px;"></div>
|
||||||
|
|
|
@ -50,10 +50,14 @@
|
||||||
|
|
||||||
<table width="240" border="0">
|
<table width="240" border="0">
|
||||||
<tr align="center" width="80px">
|
<tr align="center" width="80px">
|
||||||
|
<% files_count = @project.attachments.count %>
|
||||||
|
<% @project.versions.each do |version| %>
|
||||||
|
<% files_count += version.attachments.count %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) %></td>
|
<td class="font_index"><%=link_to "#{@project.members.count}", project_member_path(@project) %></td>
|
||||||
<td class="font_index"><%=link_to "#{@project.issues.count}", project_issues_path(@project) %></td>
|
<td class="font_index"><%=link_to "#{@project.issues.count}", project_issues_path(@project) %></td>
|
||||||
<td class="font_index"><%=link_to "#{@project.attachments.count}", project_files_path(@project) %></td>
|
<td class="font_index"><%=link_to files_count, project_files_path(@project) %></td>
|
||||||
<tr class="font_aram">
|
<tr class="font_aram">
|
||||||
<td align="center" width="80px"> <%= l(:label_member) %></td>
|
<td align="center" width="80px"> <%= l(:label_member) %></td>
|
||||||
<td align="center" width="80px"> <%= l(:label_project_issues) %></td>
|
<td align="center" width="80px"> <%= l(:label_project_issues) %></td>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
Loading…
Reference in New Issue