Skip to content

Commit

Permalink
Project card buttons are now side by side. All cards on project index…
Browse files Browse the repository at this point in the history
… are clickable anywhere within their borders. (#3888)
  • Loading branch information
euler-room authored Oct 21, 2024
1 parent 4d47b5d commit 539649d
Showing 1 changed file with 41 additions and 26 deletions.
67 changes: 41 additions & 26 deletions apps/dashboard/app/views/projects/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,28 @@
<div class="row">
<% @projects.each do |project| %>
<div id="<%= project.id %>" class="col-md-3 project-icon project-card">
<div class="text-center d-flex justify-content-center">
<%= link_to(project_path(project.id), class: 'text-dark') do %>
<%= icon_tag(URI.parse(project.icon)) %>
<%= content_tag(:p, project.title) %>
<% end %>
</div>

<%= button_to 'Delete', project_path(project.id), class: 'btn btn-danger w-80 mb-1', method: 'delete',
form: { class: 'button_to d-flex justify-content-center' },
data: { confirm: I18n.t('dashboard.jobs_project_delete_project_confirmation') }
%>
<%= button_to 'Edit', edit_project_path(project.id), class: 'btn btn-info w-80', method: 'get',
form: { class: 'd-flex justify-content-center' },
title: 'Edit project directory'
%>
<%= link_to(project_path(project.id), class: 'text-dark') do %>
<div class="text-center d-flex justify-content-center">
<strong>
<%= icon_tag(URI.parse(project.icon)) %>
<%= content_tag(:p, project.title) %>
</strong>
</div>
<div class="row">
<div class="col">
<%= button_to 'Delete', project_path(project.id), class: 'btn btn-danger w-100 mb-1', method: 'delete',
form: { class: 'button_to d-flex justify-content-center' },
data: { confirm: I18n.t('dashboard.jobs_project_delete_project_confirmation') }
%>
</div>
<div class="col">
<%= button_to 'Edit', edit_project_path(project.id), class: 'btn btn-info w-100', method: 'get',
form: { class: 'd-flex justify-content-center' },
title: 'Edit project directory'
%>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
Expand All @@ -34,21 +41,29 @@
title: I18n.t('dashboard.jobs_create_blank_project'),
class: 'text-dark btn btn-link') do
%>
<%= icon_tag(URI.parse("fas://plus")) %><br>
<%= I18n.t('dashboard.jobs_create_blank_project') %>
<div class="text-center d-flex justify-content-center">
<strong>
<%= icon_tag(URI.parse("fas://file-medical")) %><br>
<%= I18n.t('dashboard.jobs_create_blank_project') %>
</strong>
</div>
<% end %>
</div>

<%- if @templates.size.positive? -%>
<div class="mt-5 justify-content-center text-center project-icon">
<%= link_to(new_project_path({template: true}),
title: I18n.t('dashboard.jobs_create_template_project'),
class: 'text-dark btn btn-link') do
%>
<%= icon_tag(URI.parse("fas://plus")) %><br>
<%= I18n.t('dashboard.jobs_create_template_project') %>
<% end %>
</div>
<div class="mt-5 justify-content-center text-center project-icon">
<%= link_to(new_project_path({template: true}),
title: I18n.t('dashboard.jobs_create_template_project'),
class: 'text-dark btn btn-link') do
%>
<div class="text-center d-flex justify-content-center">
<strong>
<%= icon_tag(URI.parse("fas://copy")) %><br>
<%= I18n.t('dashboard.jobs_create_template_project') %>
</strong>
</div>
<% end %>
</div>
<%- end -%>

</div>
Expand Down

0 comments on commit 539649d

Please sign in to comment.