scinote-web/app/views/projects/index/_project.html.erb

108 lines
4.5 KiB
Text
Raw Normal View History

<% active = !project.archived %>
<div id="<%= project.id %>"
class="panel panel-default panel-project <%= 'archived' unless active %>"
data-id="<%= project.id %>"
data-project-users-tab-url="<%= url_for project_user_projects_path(project_id: project.id, format: :json) %>">
2016-02-12 23:52:43 +08:00
<div class="panel-heading">
<%= render partial: "projects/index/project_actions_dropdown.html.erb", locals: { project: project, view: 'cards' } %>
2016-02-12 23:52:43 +08:00
<div class="pull-right">
<input class="project-card-selector" type="checkbox" name="project-<%= project.id %>">
</div>
2018-10-02 20:24:44 +08:00
<div class="panel-title">
<span class="fas <%= active ? 'fa-arrow-alt-circle-right' : 'fa-archive' %> "></span>
<% if active %>
<%= link_to project.name, project_path(project), id: "#{project.id}-project-canvas-link" %>
2016-02-12 23:52:43 +08:00
<% else %>
<%= project.name %>
<% end %>
2018-10-02 20:24:44 +08:00
</div>
2016-02-12 23:52:43 +08:00
</div>
<div class="panel-body">
<div class="row">
<% if project.hidden? %>
<div class="col-xs-1">
2018-10-02 20:24:44 +08:00
<i class="fas fa-lg fa-eye-slash" aria-hidden="true" title="<%= t("projects.index.hidden") %>"></i>
</div>
<div class="col-xs-10">
<span><%= t("projects.index.hidden") %></span>
</div>
<% else %>
<div class="col-xs-1">
2018-10-02 20:24:44 +08:00
<i class="fas fa-lg fa-eye" aria-hidden="true" title="<%= t("projects.index.visible") %>"></i>
</div>
<div class="col-xs-10">
<span><%= t("projects.index.visible") %></span>
</div>
<% end %>
</div>
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-10">
<%= t('projects.index.start_date') %>
<strong><%= l(project.created_at, format: :full_date) %></strong>
2016-02-12 23:52:43 +08:00
</div>
</div>
</div>
<div class="panel-footer panel-footer-scinote">
<!-- Nav tabs -->
<ul class="nav nav-tabs nav-tabs-less" role="tablist" data-hook="project-footer-icons">
<li role="presentation">
2018-10-02 20:24:44 +08:00
<a class="btn btn-link <%= 'disabled' unless active %>"
href="/global_activities?<%= Activity.url_search_query(
{subjects: {Project: [project.id]}}
) %>"
aria-controls="activities-<%= project.id %>" role="tab" >
<span class="fas fa-list"></span>
</a>
</li>
<li class="pull-right" role="presentation">
2018-10-02 20:24:44 +08:00
<a class="btn btn-link <%= 'disabled' unless active %>"
href="<%= url_for project_project_comments_path(project_id: project.id, format: :json) %>"
aria-controls="comments-<%= project.id %>" role="tab" data-remote="true">
<span class="fas fa-comment"></span>
<span id="comment-counter-<%= project.id %>" class="badge badge-indicator comments-badge-indicator <%= 'hidden' unless project.comment_count.positive? %>"
data-linked-id="<%= project.id %>">
<%= project.comment_count %>
</span>
</a>
</li>
<li class="pull-right" role="presentation">
2018-10-02 20:24:44 +08:00
<a class="btn btn-link <%= 'disabled' unless active %>"
href="<%= url_for notifications_project_path(id: project.id, format: :json) %>"
aria-controls="notifications-<%= project.id %>" role="tab" data-remote="true">
<span class="fas fa-calendar-check"></span>
<% if project.notification_count.positive? %>
<span class="badge badge-indicator"><%= project.notification_count %></span>
<% end %>
</a>
</li>
<li class="pull-right" role="presentation">
2018-10-02 20:24:44 +08:00
<a class="btn btn-link <%= 'disabled' unless active %>"
href="<%= url_for project_user_projects_path(project_id: project.id, format: :json) %>"
aria-controls="users-<%= project.id %>" role="tab" data-remote="true">
<span class="fas fa-users"></span>
<span class="badge badge-indicator users-badge-indicator <%= 'hidden' unless project.user_count.positive? %>"
data-linked-id="<%= project.id %>">
<%= project.user_count %>
</span>
</a>
</li>
2016-02-12 23:52:43 +08:00
</ul>
<!-- Tab panes -->
2018-06-01 22:46:27 +08:00
<div class="tab-content" data-hook="project-dropdown-panel">
<div role="tabpanel" class="tab-pane" id="activities-<%= project.id %>"></div>
<div role="tabpanel" class="tab-pane" id="users-<%= project.id %>"></div>
<div role="tabpanel" class="tab-pane over-due" id="notifications-<%= project.id %>"></div>
<div role="tabpanel" class="tab-pane" id="comments-<%= project.id %>"></div>
2016-02-12 23:52:43 +08:00
</div>
</div>
</div>