我发布的Issue更换新HTML

This commit is contained in:
daiao 2017-03-02 15:09:33 +08:00
parent d75cf47079
commit 83e4a44062
4 changed files with 86 additions and 210 deletions

View File

@ -1,85 +1,59 @@
<% 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" style="width: 400px" target="_blank" title="<%= activity.subject.to_s %>"><%= activity.subject.to_s %></a>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<p class="fl issues_list_name" ><span class="mr5"><%= format_time(activity.created_on) %> </span>发布</p>
<p class="fl ml10"> <span class="mr5"><%= format_time(activity.updated_on) %> </span>更新</p>
</div>
</div>
<ul class="issues_list_txt fr">
<li class=" c_grey issues_list_max mr5">
<%= Project.find(activity.project_id).name %>
</li>
<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.assigned_to_id.nil? && activity.assigned_to_id != 0 %>
<% if activity.try(:assigned_to).try(:realname).blank? %>
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id)%>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id)%>
<% end %>
<% end %></li>
<li class="issues_list_min c_grey">
<%= activity.priority.name %>
</li>
<li class="c_grey issues_list_max" title="<%= activity.fixed_version %>"><%= activity.fixed_version %></li>
<li class="issues_list_min c_grey mr5" ><%= activity.status.name %></li>
<li class="<%= (activity.done_ratio == 100 ? 'c_green issues_list_min mr5' : 'c_red issues_list_min mr5') %>"><%= activity.done_ratio %>%</li>
<li class="issues_list_min">
<% if activity.journals.count > 0 %>
<span class="issues_icons_mes fl mr5 mt12"></span>
<span class="fl mr5"><%= activity.journals.count %></span>
<% end %>
</li>
</ul>
<tr>
<td>
<div class="issues_ciricons fl ml15">
<% 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">
<p class="fl issues_list_name" ><span class="mr5"><%= format_time(activity.created_on) %></span>发布</p>
<p class="fl ml10"> <span class="mr5"><%= format_time(activity.updated_on) %></span>更新</p>
</div>
</div>
</td>
<td><span class="w100"> <%= Project.find(activity.project_id).name %></span></td>
<td>
<% case activity.tracker_id %>
<% when 1 %>
缺陷
<% when 2 %>
功能
<% when 3 %>
支持
<% when 4 %>
任务
<% when 5 %>
周报
<% end %>
</td>
<td>
<% if !activity.assigned_to_id.nil? && activity.assigned_to_id != 0 %>
<% if activity.try(:assigned_to).try(:realname).blank? %>
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id)%>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id)%>
<% end %>
<% end %>
</td>
<td><%= activity.priority.name %></td>
<td title="<%= activity.fixed_version %>"><%= activity.fixed_version %></td>
<td><%= activity.status.name %></td>
<td><span class="<%= (activity.done_ratio == 100 ? 'c_green' : 'c_red') %>"><%= activity.done_ratio %>%</span></td>
<td>
<% if activity.journals.count > 0 %>
<a href="javascript:void(0);" class="issues_icons_mes fl mr5 ml5 "></a>
<a href="javascript:void(0);" class="fl mt2"><%= activity.journals.count %></a>
<% end %>
</td>
</tr>
<% end %>
<script>
$(".issues_list_box").mouseover(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(7).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(7).children().eq(iconOrder).show();
});
$(".issues_list_box").mouseout(function(){
var iconOrder;
var iconSize = $(this).children().eq(2).children().eq(7).children().size();
if(iconSize > 1){
iconOrder = 2;
} else{
iconOrder = 0;
}
$(this).children().eq(2).children().eq(7).children().eq(iconOrder).hide();
});
</script>

View File

@ -1,24 +1,3 @@
<% issue_list(issues) do |issue| -%>
<script>
$(function () {
sd_create_editor_from_data(<%= issue.id %>, null, "100%", "<%= issue.class.name %>");
});
</script>
<%= render :partial => 'users/my_manage_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
<div style="text-align:left;">
<div style="width:auto; display:inline-block;">
<ul>
<%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue ml10 mt10 mb10", :id => "sendexcel",
:onclick => "remote_function_export('#{User.current}')"%>
</ul>
</div>
<div class="pages fr" style="width:auto; display:inline-block;margin-top:10px">
<ul id="issue_list_pagination" class="fr">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<% end %>

View File

@ -214,10 +214,10 @@
});
});
$(document).ready(function(){
if($.browser.webkit){
if($.browser.webkit){
$("#issues_filter_por").css("padding-left","5px");
$("#issue_filter_status").css("padding-left","15px");
}
}
});
</script>
@ -257,13 +257,12 @@
<table class="issues-table mb10" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th ><p class="text-left">搜索结果<span class="issues_nav_tag ml5" style=" font-weight: normal;">210</span></p></th>
<th ><p class="text-left">搜索结果<span class="issues_nav_tag ml5" style=" font-weight: normal;" id="issue_filter_all"><%= @issue_count %></span></p></th>
<th class="w100">
<select>
<option>来源</option>
<option>TrustieTrustieTrustie</option>
<option>UI教程</option>
</select>
<%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
{ :include_blank => false, :selected => @project_id ? @project_id : 0 },
{ :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id" }
)%>
</th>
<th class="w50">类型</th>
<th class="w50">指派给</th>
@ -274,107 +273,28 @@
<th class="w50">&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="issues_ciricons fl ml15"><span class="issues_ciricons_01 "></span></div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="javascript:void(0);" class="issues_list_title fl">管理员页面:用户列表中显示如图用户工作单位为空</a>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<p class="fl issues_list_name" ><span class="mr5">2016-09-01 12:12 </span>发布</p>
<p class="fl ml10"> <span class="mr5">2016-09-16 12:12 </span>更新</p>
</div>
</div>
</td>
<td><span class="w100">TrustieTrustieTrustie</span></td>
<td>缺陷</td>
<td>&nbsp;</td>
<td>正常</td>
<td>&nbsp;</td>
<td>新增</td>
<td ><span class="c_red">0%</span></td>
<td >
<a href="javascript:void(0);" class="issues_icons_mes fl mr5 ml5 "></a>
<a href="javascript:void(0);" class="fl mt2">3</a>
</td>
</tr>
<tr>
<td>
<div class="issues_ciricons fl ml15"><span class="issues_ciricons_01 "></span></div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="javascript:void(0);" class="issues_list_title fl">管理员页面:用户列表中显示如图用户工作单位为空示如图用户工作单位为空示如图用户工作单位为空示如图用户工作单位为空</a>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<p class="fl issues_list_name" ><span class="mr5">2016-09-01 12:12 </span>发布</p>
<p class="fl ml10"> <span class="mr5">2016-09-16 12:12 </span>更新</p>
</div>
</div>
</td>
<td><span class="w100">TrustieTrustieTrustie</span></td>
<td>缺陷</td>
<td>&nbsp;</td>
<td>正常</td>
<td>&nbsp;</td>
<td>新增</td>
<td ><span class="c_red">0%</span></td>
<td >
<a href="javascript:void(0);" class="issues_icons_mes fl mr5 ml5 "></a>
<a href="javascript:void(0);" class="fl mt2">3</a>
</td>
</tr>
<tbody id="issue_list">
<% if @issues.empty? %>
<p class="nodata mt10"><%= l(:label_no_data) %></p>
<% else %>
<%= render :partial => 'users/user_manage_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %>
<% end %>
</tbody>
</table>
<div style="text-align:left;">
<div style="width:auto; display:inline-block;">
<ul>
<%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue mb10", :id => "sendexcel",
:onclick => "remote_function_export('#{User.current}')"%>
</ul>
<div class="issues_con_list" style="position: relative;">
<ul id="issues_list_nav" >
<li id="issues_list_nav_1" class="issues_nav_hover" onclick="HoverLi(1);all_reset_form();">
<a href="javascript:void(0);" id="issues_type_1" onclick="all_reset_form();" >搜索结果</a>
<span id="issue_filter_all"><%= render :partial => "users/my_issue_filter_all" %></span>
</li>
<div class="cl"></div>
</ul>
<div class="issues_filter">
<div class="my_issues_form_filter mt5">
<%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
{ :include_blank => false,:selected => @project_id ? @project_id : 0 },
{ :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style => "margin: 0 15px;text-align: left;"}
)%>
<select class="my_issues_filter" disabled="disabled" style="width: 50px;;padding-left: 10px;text-align: left;">
<option value="0" selected="selected">类型</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 65px;padding-left: 10px;text-align: left;">
<option value="0" selected="selected">指派给</option>
</select>
<%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["指派给",0]),
{ :include_blank => false, :selected => @assigned_to ? @assigned_to : 0},
{:onchange=>"remote_function();add_style();",:id => "assigned_to_id",:name => "assigned_to_id", :class => "fl", :style => "visibility:hidden; width:0px;margin:0px;padding:0px;"} )
%>
<select class="my_issues_filter" disabled="disabled" style="width: 50px;text-align: left;" id="issues_filter_por">
<option value="0" selected="selected">优先度</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 80px;padding-left: 20px;text-align: left;">
<option value="0" selected="selected">里程碑</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 55px;margin-left:5px;text-align:center;" id="issue_filter_status">
<option value="0" selected="selected">状态</option>
</select>
<select class="my_issues_filter" disabled="disabled" style="width: 50px;text-align: left;">
<option value="0" selected="selected">完成度</option>
</select>
</div>
</div>
<div class="pages fr" style="width:auto; display:inline-block;margin-top:0px;margin-right:0px;">
<ul id="issue_list_pagination" class="fr">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
<% end %>
<% if @issues.empty? %>
<p class="nodata mt10"><%= l(:label_no_data) %></p>
<% else %>
<div id="issue_list">
<%= render :partial => 'users/user_manage_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %>
</div>
<% end %>
</div>

View File

@ -1,3 +1,6 @@
$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'users/my_issue_filter_all') %>");
$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_manage_issue_list',:locals => {:issues => @issues, :issue_pages=> @issue_pages, :issue_count => @issue_count })%>");
$("#issue_filter_all").html("<%= @issue_count %>");
$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_manage_issue_list',
:locals => {:issues => @issues,
:issue_pages=> @issue_pages,
:issue_count => @issue_count })%>");
$("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');