Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
This commit is contained in:
commit
ee73191a19
|
@ -192,11 +192,13 @@ class UsersController < ApplicationController
|
|||
forge_querys = ForgeMessage.where("user_id =? and viewed =?", user, 0)
|
||||
user_querys = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0)
|
||||
forum_querys = MemoMessage.where("user_id =? and viewed =?", user, 0)
|
||||
org_querys = OrgMessage.where("user_id=? and viewed=0", user)
|
||||
if User.current.id == @user.id
|
||||
course_querys.update_all(:viewed => true)
|
||||
forge_querys.update_all(:viewed => true)
|
||||
user_querys.update_all(:viewed => true)
|
||||
forum_querys.update_all(:viewed => true)
|
||||
org_querys.update_all(:viewed => true)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -89,10 +89,11 @@ module UsersHelper
|
|||
def unviewed_message(user)
|
||||
course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
org_count = OrgMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
user_memo_count = MemoMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
at_count = user.at_messages.where(viewed: false).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + at_count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + at_count + org_count
|
||||
end
|
||||
|
||||
def user_mail_notification_options(user)
|
||||
|
|
|
@ -345,7 +345,8 @@ class User < Principal
|
|||
user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count
|
||||
at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count
|
||||
org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", User.current.id,0, User.current.onclick_time.onclick_time).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count
|
||||
end
|
||||
|
||||
# 查询指派给我的缺陷记录
|
||||
|
|
|
@ -57,8 +57,10 @@
|
|||
) if activity.org_subfield_editable_by?(User.current) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= delete_link(
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'messages', :action => 'destroy', :id => activity, :board_id => activity.board_id},
|
||||
:method => 'post',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if activity.org_subfield_editable_by?(User.current) %>
|
||||
|
|
|
@ -58,6 +58,11 @@
|
|||
<div class="w607 fr">http://
|
||||
<input type="text" name="organization[domain]" id="domain" value="<%= @organization.domain%>" class="orgUrlInput" />
|
||||
.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;" onclick="apply_subdomain(<%= @organization.id %>,$('#domain').val());">申请</a>
|
||||
<% if @organization.domain.present? %>
|
||||
<span>(已批准)</span>
|
||||
<% elsif OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).count > 0 %>
|
||||
<span>(您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准)</span>
|
||||
<% end %>
|
||||
<p class="c_green f12" id="apply_hint" ></p></div>
|
||||
<!--class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 -->
|
||||
</div>
|
||||
|
|
|
@ -46,6 +46,7 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
member do
|
||||
get 'edit'
|
||||
get 'setting'#, :action => 'settings', :as => 'settings'
|
||||
get 'clear_org_avatar_temp'
|
||||
put 'set_homepage'
|
||||
|
|
Loading…
Reference in New Issue