Skip to content

Commit

Permalink
Extract partials and add ids we'll need for the stream actions approach
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemanrubia committed Nov 26, 2023
1 parent 90840b3 commit 944ad5d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/helpers/projects_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module ProjectsHelper
def project_progress_bar_for(project)
tag.progress "#{project.completion_ratio * 100}%", value: project.tasks.completed.count, max: project.tasks.count, class: "progress is-primary"
tag.progress "#{project.completion_ratio * 100}%", id: dom_id(project, :progress_bar),
value: project.tasks.completed.count, max: project.tasks.count, class: "progress is-primary"
end
end
1 change: 1 addition & 0 deletions app/views/projects/_complete_count.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span id="<%= dom_id(project, :complete_count) %>" class="tag is-info"><%= project.tasks.completed.count %> / <%= project.tasks.count %> </span>
6 changes: 2 additions & 4 deletions app/views/projects/_tasks.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

<table class="table is-fullwidth is-stripped">
<table id="tasks" class="table is-fullwidth is-stripped">
<thead>
<tr>
<th style="width: 4rem;"></th>
Expand All @@ -13,8 +12,7 @@
<tfoot>
<tr>
<th>
<span class="tag is-info"><%= tasks.completed.count %>
/ <%= tasks.count %> </span>
<%= render "projects/complete_count", project: project %>
</th>
<th>
</th>
Expand Down

0 comments on commit 944ad5d

Please sign in to comment.