-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename stories_table to project_table
- Loading branch information
1 parent
ac383bc
commit d8c0c5b
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<table class="project-table"> | ||
<thead class="table-header fixed-header"> | ||
<tr class="project-table__row project-table__row--header"> | ||
<th class="project-table__cell">Story Title</th> | ||
<th class="project-table__cell">Best Estimate</th> | ||
<th class="project-table__cell">Worst Estimate</th> | ||
<th class="project-table__cell"> | ||
<%= link_to "Add a Story", new_project_story_path(@project.id), class: "button magenta" %> | ||
<button id="bulk_delete" class="button magenta" aria-disabled="true" disabled>Bulk Delete</button> | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody id="stories" data-url="<%= sort_project_path(@project.id) %>"> | ||
<% if @stories.present? %> | ||
<% @stories.each do | story | %> | ||
<tr class="project-table__row project-table__row--story" id="<%= dom_id(story)%>" > | ||
<td class="project-table__cell"> | ||
<input type="checkbox" name="stories[]" value=<%= story.id %>> | ||
<%= link_to story.title, [story.project, story] %> | ||
</td> | ||
<td class="project-table__cell"><%= story.estimates.where(user: current_user)&.first&.best_case_points %></td> | ||
<td class="project-table__cell"><%= story.estimates.where(user: current_user)&.first&.worst_case_points %></td> | ||
<td class="project-table__cell"> | ||
<%= link_to 'Clone', new_project_story_path(@project.id, story_id: story.id), class: "button green clone" %> | ||
<%= link_to 'Edit', edit_project_story_path(@project.id, story), class: "button green edit" %> | ||
<% if estimated(story) %> | ||
<%= link_to 'Edit Estimate', edit_project_story_estimate_path(@project.id, story, @estimate_id), class: "button green edit-estimate", remote: true %> | ||
<% else %> | ||
<%= link_to 'Add Estimate', new_project_story_estimate_path(@project.id, story), class: "button green add-estimate", remote: true %> | ||
<% end %> | ||
<%= link_to 'Delete', project_story_path(@project.id, story, format: "json"), method: "delete", data: { confirm: 'Are you sure?', story_id: story.id }, class: "button green delete", remote: true %> | ||
<% if @siblings.any? %> | ||
<div class="move-story-wrapper"> | ||
<button class="button green">Move to</button> | ||
<div class="move-story-dropdown"> | ||
<% @siblings.each do |to_project| %> | ||
<%= button_to to_project.title, project_story_move_path(@project, story, to_project: to_project), method: :put, data: {confirm: "Are you sure?"} %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
<% else %> | ||
<p> You don't have any stories yet. </p> | ||
<% end %> | ||
</tbody> | ||
|
||
<tfoot> | ||
<tr class="project-table__row project-table__row--footer"> | ||
<td class="project-table__cell">Total estimates</td> | ||
<td class="project-table__cell"><%= @project.best_estimate_sum_per_user(current_user) %></td> | ||
<td class="project-table__cell"><%= @project.worst_estimate_sum_per_user(current_user) %></td> | ||
<td class="project-table__cell"></td> | ||
</tr> | ||
</tfoot> | ||
|
||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
$("#stories-table").html("<%= j render(partial: 'projects/stories_table', locals: { project: @project, stories: @stories }) %>") | ||
$("#project-table").html("<%= j render(partial: 'projects/project_table', locals: { project: @project, stories: @stories }) %>") |