socialforge/app/views/users/user_messages.html.erb

118 lines
4.2 KiB
Plaintext
Raw Normal View History

2015-08-13 22:33:08 +08:00
<div class="top_new">
<span class=" top_newcourses_bg fl"></span>
新建课程
<div class="cl"></div>
<div id="TopUser" class="fr">
<div id="menu">
<ul class="menu">
<li id="current_message_li">
<%= link_to "#{l(:label_forge_message)}<span class='pic_triangle'></span>".html_safe %>
<ul id="message_sub_menu" style="right: 0px;display: none;left: 10px;">
<% if @show_course == 1 %>
<% user_course = get_user_course User.current%>
<% unless user_course.empty? %>
<li id="my_courses_message_li">
<%=link_to l(:label_course_message), {:controller => 'users', :action => 'user_courses', id: User.current.id},target:"_blank", :class => "parent" %>
<ul id="my_courses_message_ul">
<% user_course.reverse.each do |course| %>
<li title="<%=course.name%>">
<%= link_to course.name, {:controller => 'courses',:action => 'show',:id => course.id},target:"_blank" %>
</li>
<% end %>
</ul>
</li>
<% end %>
<% end %>
<% unless User.current.projects.empty? %>
<li id="my_projects_message_li">
<%= "#{l(:label_project_message)}"+"("+User.current.count_new_issue_assign_to.count.to_s+")" %>
<ul id="my_projects_message_ul" >
<% User.current.count_new_issue_assign_to.reverse.each do |issue_assign| %>
<li title="<%= issue_assign.forge_message %>">
<%= link_to issue_assign.forge_message, {:controller => 'issues', :action => 'show',id: issue_assign.forge_message_id, host: Setting.host_name }, target:"_blank" %>
</li>
<% end %>
<% User.current.issue_status_update.reverse.each do |issue_update| %>
<li title="<%= issue_update.forge_message %>">
<%= link_to issue_update.forge_message.issue, {:controller => 'issues', :action => 'show',id: issue_update.forge_message_id, host: Setting.host_name }, target:"_blank" %>
</li>
<% end %>
</ul>
</li>
<% end %>
<li>
<%=link_to "...", {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
</li>
</ul>
</li>
</ul>
</div><!--topuser_nav end-->
</div>
</div>
<script type="text/javascript">
function setMessageCount () {
var mes = $('#loggedas .my-message');
mes.html(mes.html()+ '(' + <%=User.current.count_new_jour.to_s%> + ")");
}
//消息提醒
function MessageAddSlipMenu () {
var loggedas = $('#current_message_li a:first');
var sub_menu = $('#message_sub_menu');
loggedas.mouseenter(function() {
sub_menu.show();
$('#my_projects_message_ul').hide();
$('#my_courses_message_ul').hide();
});
sub_menu.mouseleave(function() {
sub_menu.hide();
$('#my_projects_message_ul').hide();
$('#my_courses_message_ul').hide();
});
}
function MessageAddProjectSlipMenu () {
var loggedas = $('#my_projects_message_li');
var project_sub_menu = $('#my_projects_message_ul');
var course_sub_menu = $('#my_courses_message_ul');
loggedas.mouseenter(function() {
course_sub_menu.hide();
project_sub_menu.show();
});
loggedas.mouseleave(function() {
project_sub_menu.hide();
course_sub_menu.hide();
});
}
function MessageAddCourseSlipMenu () {
var loggedas = $('#my_courses_message_li');
var project_sub_menu = $('#my_projects_message_ul');
var course_sub_menu = $('#my_courses_message_ul');
loggedas.mouseenter(function() {
project_sub_menu.hide();
course_sub_menu.show();
});
loggedas.mouseleave(function() {
course_sub_menu.hide();
project_sub_menu.hide();
});
}
$(document).ready(function () {
MessageAddSlipMenu();
MessageAddProjectSlipMenu ();
MessageAddCourseSlipMenu();
});
</script>