socialforge/app/views/issues/_project_issue.html.erb

100 lines
5.0 KiB
Plaintext

<% unless activity.author.nil? %>
<div class="issues_list_box clear" id="user_activity_<%= user_activity_id%>">
<div class="issues_ciricons fl ">
<% if activity.status_id.to_i == 5 %>
<span class="issues_ciricons_02"></span>
<% else %>
<span class="issues_ciricons_01"></span>
<% end %>
</div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="<%= issue_path(activity) %>" class="issues_list_title fl" target="_blank" title="<%= activity.subject.to_s %>"><%= activity.subject.to_s %></a>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "fl issues_list_name" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "fl issues_list_name" %>
<% end %>
<p class="fl ml10"> <span class="mr5"><%=format_time(activity.created_on) %></span>发布</p>
</div>
</div>
<ul class="issues_list_txt fr">
<li class="issues_list_min c_grey">
<% case activity.tracker_id %>
<% when 1%>
缺陷
<% when 2%>
功能
<% when 3%>
支持
<% when 4%>
任务
<% when 5%>
周报
<% end %>
</li>
<!--li class="c_grey">
<#% if activity.try(:author).try(:realname) == ' ' %>
<%#= link_to activity.try(:author), user_path(activity.author_id), :class => "c_grey" %>
<#% else %>
<%#= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "c_grey" %>
<%# end %>
</li-->
<li class="c_grey">
<% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname).empty? %>
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id), :class => "c_grey" %>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "c_grey" %>
<% end %>
<% end %></li>
<li class="c_grey" style="width: 60px; padding-right: 10px" title="<%= activity.fixed_version %>"><%= activity.fixed_version %></li>
<li class="issues_list_min c_grey" ><%= activity.status.name%></li>
<li class="<%=(activity.done_ratio == 100 ? 'c_red' : 'c_green') %>"><%= activity.done_ratio %>%</li>
<li class="issues_list_min pr">
<% if activity.journals.count > 0%>
<span class="issues_icons_mes fl mr5" style="margin-top:-3px;"></span>
<span class="fl mr5"><%= activity.journals.count %></span>
<% end %>
<div class="undis" style="position: absolute; <%= activity.journals.count >0 ? 'top:15px;' : 'top:-15px;' %>">
<%= link_to "", issue_path(activity.id, :edit => 'true'), :class => 'sy_icons_edit fl mt15', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
<% if !defined?(project_id) && !defined?(user_id) %>
<%= link_to "", issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(project_id) %>
<%= link_to "", issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(user_id) %>
<%= link_to "", issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% end %>
</div>
</li>
</ul>
</div>
<% end %>
<script>
$(".issues_list_box").mouseover(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(5).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(5).children().eq(iconOrder).show();
});
$(".issues_list_box").mouseout(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(5).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(5).children().eq(iconOrder).hide();
});
</script>