2021-01-07 05:20:50 +08:00
|
|
|
<div class="card project-card"
|
|
|
|
data-id="<%= project.id %>"
|
|
|
|
data-edit-url="<%= edit_project_path(project) %>"
|
|
|
|
data-editable="<%= can_manage_project?(project) %>"
|
|
|
|
data-archivable="<%= project.active? && can_archive_project?(project) %>"
|
|
|
|
data-restorable="<%= project.archived? && can_restore_project?(project) %>">
|
2020-11-03 15:07:17 +08:00
|
|
|
<div class="checkbox-cell">
|
|
|
|
<div class="sci-checkbox-container">
|
2020-11-13 21:39:10 +08:00
|
|
|
<input value="1" type="checkbox" class="sci-checkbox project-card-selector">
|
2020-11-03 15:07:17 +08:00
|
|
|
<span class="sci-checkbox-label"></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="project-name-cell">
|
2021-01-07 21:58:56 +08:00
|
|
|
<% if project.archived? %>
|
|
|
|
<%= link_to experiment_archive_project_url(project) do %>
|
|
|
|
<h3 class="name" title="<%= project.name %>">
|
|
|
|
<%= project.name %>
|
|
|
|
</h3>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to project_url(project) do %>
|
|
|
|
<h3 class="name" title="<%= project.name %>">
|
|
|
|
<%= project.name %>
|
|
|
|
</h3>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2020-11-03 15:07:17 +08:00
|
|
|
</div>
|
2020-12-04 16:38:34 +08:00
|
|
|
<div class="actions actions-cell">
|
2020-12-11 20:07:12 +08:00
|
|
|
<%= render partial: 'projects/index/project_actions_dropdown.html.erb', locals: { project: project, view: 'cards' } %>
|
2020-12-04 16:38:34 +08:00
|
|
|
</div>
|
2020-11-03 15:07:17 +08:00
|
|
|
|
2020-12-18 20:05:23 +08:00
|
|
|
<div class="data-row start-date-cell">
|
|
|
|
<span class="card-label"><%= t('projects.index.card.start_date') %></span>
|
|
|
|
<span class="value card-value"> <%= l(project.created_at, format: :full_date) %></span>
|
|
|
|
<span class="value cell-value"> <%= l(project.created_at, format: :full_with_comma) %></span>
|
2020-11-03 15:07:17 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="data-row visibility-cell">
|
|
|
|
<span class="card-label"><%= t('projects.index.card.visibility') %></span>
|
|
|
|
<span class="value">
|
|
|
|
<% if project.hidden? %>
|
|
|
|
<%= t('projects.index.hidden') %>
|
|
|
|
<% else %>
|
|
|
|
<%= t('projects.index.visible') %>
|
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="data-row user-cell">
|
|
|
|
<span class="card-label"><%= t('projects.index.card.users') %></span>
|
|
|
|
<div class="value">
|
|
|
|
|
2021-01-06 01:31:33 +08:00
|
|
|
<% project.user_projects[0..3].each do |user_project| %>
|
2020-11-03 15:07:17 +08:00
|
|
|
<span class="global-avatar-container">
|
2021-01-04 23:44:31 +08:00
|
|
|
<%= image_tag(avatar_path(user_project.user, :icon_small), title: user_name_with_role(user_project)) %>
|
2020-11-03 15:07:17 +08:00
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
|
2021-01-06 01:31:33 +08:00
|
|
|
<% more_users = project.user_projects[4..-1].to_a %>
|
2021-01-04 23:44:31 +08:00
|
|
|
<% if more_users.any? %>
|
2021-01-06 01:31:33 +08:00
|
|
|
<a href="" class="more-users" title="<%= user_names_with_roles(more_users) %>">
|
|
|
|
+<%= more_users.size %>
|
2021-01-04 23:44:31 +08:00
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
|
2020-12-18 20:05:23 +08:00
|
|
|
<% if project.active? %>
|
|
|
|
<%= link_to project_users_edit_path(project),
|
|
|
|
class: 'manage-users-link',
|
|
|
|
remote: true,
|
|
|
|
data: { 'view-mode': 'active' } do %>
|
|
|
|
<span class="new-user">
|
|
|
|
<i class="fas fa-plus"></i>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2020-12-11 20:07:12 +08:00
|
|
|
<% end %>
|
2020-11-03 15:07:17 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-12-18 20:05:23 +08:00
|
|
|
|
|
|
|
<% if project.archived? %>
|
|
|
|
<div class="data-row archived-date-cell">
|
|
|
|
<span class="card-label"><%= t('projects.index.card.archived_date') %></span>
|
|
|
|
<span class="value card-value"> <%= l(project.archived_on, format: :full_date) %></span>
|
|
|
|
<span class="value cell-value"> <%= l(project.archived_on, format: :full_with_comma) %></span>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-11-03 15:07:17 +08:00
|
|
|
</div>
|