实训项目的列表页面
This commit is contained in:
parent
2aa025cf32
commit
8039f89d92
|
@ -1,12 +1,3 @@
|
|||
<% tasks.each do |task| -%>
|
||||
<%= render :partial => 'content_list', :locals => {:activity => task, :user_activity_id => task.id} %>
|
||||
<% end %>
|
||||
|
||||
<div style="text-align:left;">
|
||||
<div class="pages fr" style="width:auto; display:inline-block;">
|
||||
<ul id="issue_list_pagination" class="fr">
|
||||
<%= pagination_links_full @training_tasks_pages, @training_tasks_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,49 +1,36 @@
|
|||
<% unless activity.author.nil? %>
|
||||
<div class="issues_list_box clear" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="issues_ciricons fl ">
|
||||
<span class="issues_ciricons_01"></span>
|
||||
</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>
|
||||
<tr id="user_activity_<%= user_activity_id %>">
|
||||
<td>
|
||||
<% if activity.status == 0 %>
|
||||
<div class="issues_ciricons fl ml15 mt5"><i class="icon-flag fb " style="color:#49a547; font-size:15px;"></i></div>
|
||||
<% elsif activity.status == 1 %>
|
||||
<div class="issues_ciricons fl ml15"><span class="issues_ciricons_02 "></span></div>
|
||||
<% end %>
|
||||
<div class=" fl ml5">
|
||||
<div class="issues_list_titlebox clear">
|
||||
<a href="<%= training_task_path(activity)%>" class="issues_list_title fl" target="_blank" title="<%= activity.subject.to_s %>" >
|
||||
<span class="task-step mr5">step<%= activity.position %></span>
|
||||
<%= activity.subject.to_s %>
|
||||
</a>
|
||||
<% if activity.status == 0 %>
|
||||
<span class="task-linebtn-green fl ml5 mt3">正在解决中</span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="issues_list_small">
|
||||
<p class="fl issues_list_name" ><span class="mr5"><%= format_time(activity.created_at) %></span>发布</p>
|
||||
<p class="fl ml10"> <span class="mr5"><%= format_time(activity.updated_at) %></span>更新</p>
|
||||
</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-->
|
||||
<p class="fl" ><span class="mr5"><%= format_time(activity.created_at) %> </span>发布</p>
|
||||
<p class="fl ml10"> <span class="mr5"><%= format_time(activity.updated_at) %> </span>更新</p>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="issues_list_txt fr">
|
||||
<li class="c_grey">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id)%>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id)%>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li class="issues_list_min c_grey mr5">
|
||||
<% case activity.tracker_id %>
|
||||
<% when 1%>
|
||||
缺陷
|
||||
<% when 2%>
|
||||
功能
|
||||
<% when 3%>
|
||||
支持
|
||||
<% when 4%>
|
||||
任务
|
||||
<% when 5%>
|
||||
周报
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</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>
|
||||
<td><a href="javascript:void(0);" class="btn btn-blue">提交评测</a></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -202,6 +202,58 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<!--实训任务列表开始-->
|
||||
<div class="myissues_con mb10">
|
||||
<% if is_project_manager?(User.current, @project) || User.current.admin? %>
|
||||
<a href="<%= new_project_training_task_path(@project) %>" class="btn btn-green fr mb10">新建</a>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<div class="pro_new_prompt mb10">
|
||||
<p>完成任务后提交代码,若通过系统测试,将为你发送下一个任务,祝你早日通关,加油!</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @training_tasks.empty? %>
|
||||
<%= render :partial => "projects/no_data" %>
|
||||
<% else %>
|
||||
<div class="issues_con_list" >
|
||||
<div >
|
||||
<table class="issues-table" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><p class="text-left">所有<span class="issues_nav_tag ml5" style=" font-weight: normal;"><%= @training_tasks_count %></span></p></th>
|
||||
<th class="w50"> </th>
|
||||
<th class="w100"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="issue_list">
|
||||
<%= render :partial => 'all_list', :locals => {:tasks => @training_tasks} %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="text-align:left;">
|
||||
<div style="width:auto; display:inline-block;">
|
||||
<ul>
|
||||
<a href="javascript:void(0);" id="sendexcel" class="fl ml15 mt15" style="<%= @training_tasks_count > 10 ? 'height:24px;line-height:0;' : 'height:0;line-height:0;' %>"></a>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pages fr" style="width:auto; display:inline-block;">
|
||||
<ul id="issue_list_pagination" class="fr">
|
||||
<%= pagination_links_full @training_tasks_pages, @training_tasks_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<!--实训任务结束-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<% if false %>
|
||||
<!--缺陷列表开始-->
|
||||
<div id="myissues_con" class="myissues_con mb10">
|
||||
<div class="clear mb5">
|
||||
|
@ -230,3 +282,4 @@
|
|||
<div id="issues_list_content_3" class="undis">
|
||||
</div><!--issues_list_content_3 end-->
|
||||
<!--issues_con_list end-->
|
||||
<% end %>
|
|
@ -0,0 +1,3 @@
|
|||
$("#issue_list").html("<%= escape_javascript(render :partial => 'training_tasks/all_list',:locals => {:tasks => @training_tasks, :project=> @project})%>");
|
||||
$("#issue_list_pagination").html('<%= pagination_links_full @training_tasks_pages, @training_tasks_count, :training_tasks => @training_tasks, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
||||
|
|
@ -2304,7 +2304,7 @@ ActiveRecord::Schema.define(:version => 20170219025424) do
|
|||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "author_id"
|
||||
t.integer "status", :limit => 1, :default => 1
|
||||
t.integer "status", :limit => 1, :default => 0
|
||||
end
|
||||
|
||||
create_table "user_actions", :force => true do |t|
|
||||
|
|
Loading…
Reference in New Issue