Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leah - Water #52

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
26bf60e
Initial Rails Setup
scottzec Nov 11, 2020
b76497e
validations
scottzec Nov 15, 2020
78bcd84
views
scottzec Nov 15, 2020
fd197ff
validation tests added and passing
scottzec Nov 15, 2020
634df9d
prep for layout template
scottzec Nov 15, 2020
ec5c551
app and works#index html
scottzec Nov 15, 2020
bdacb6c
homepages#index html framework
scottzec Nov 15, 2020
c75a27b
works#index html framework
scottzec Nov 15, 2020
de97ac5
works form works show user show html base
scottzec Nov 15, 2020
66fefc5
css
scottzec Nov 15, 2020
48453dd
works listed by cat
scottzec Nov 16, 2020
052aa61
change works index html buttons to erb
scottzec Nov 16, 2020
4726c3c
works show
scottzec Nov 16, 2020
d568689
form with css new work
scottzec Nov 16, 2020
2e85acd
spotlight finally working
scottzec Nov 16, 2020
2096d79
css works on top 10
scottzec Nov 16, 2020
809618e
spotlight tests, 1 still not passing
scottzec Nov 16, 2020
91f3115
top 10 testing
scottzec Nov 16, 2020
99a1cef
added fixtures
scottzec Nov 16, 2020
e02eb02
rollback successful after migration disaster, saving schema
scottzec Nov 16, 2020
73cb04a
after updating fixtures to correct data type for publication_year, te…
scottzec Nov 16, 2020
1c68da9
edit with flash blank page
scottzec Nov 16, 2020
318c71e
delete with flash, same 404
scottzec Nov 16, 2020
e78f30c
edit and delete functioning again, flash to be resolved
scottzec Nov 16, 2020
3ca8905
added flash to view
scottzec Nov 16, 2020
3f04e2e
votes nested route
scottzec Nov 17, 2020
7109e8a
added session routes
scottzec Nov 17, 2020
e33113b
login routes, actions and views setup. still need logout button
scottzec Nov 17, 2020
13c6e8e
logout and current views all setup and running
scottzec Nov 17, 2020
16428bf
vote create action
scottzec Nov 17, 2020
75a7e20
migrations relating votes to user and work
scottzec Nov 17, 2020
07e59e8
upvote functionality working
scottzec Nov 17, 2020
b3f5485
added votes for views
scottzec Nov 17, 2020
862bfed
added filters to controllers
scottzec Nov 17, 2020
da23f4a
only 1 vote per user per work
scottzec Nov 17, 2020
f1be597
top 10, spotlight and works index all sorted by votes descending
scottzec Nov 17, 2020
7680e3e
current user tests
scottzec Nov 17, 2020
72e4aa6
vote fixtures
scottzec Nov 18, 2020
3b026ad
vote fixtures
scottzec Nov 18, 2020
8c34218
find_work controller working
scottzec Nov 18, 2020
0bb9076
relationship tests
scottzec Nov 18, 2020
5f3947d
user views complete with relation has many works thru votes
scottzec Nov 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added votes for views
scottzec committed Nov 17, 2020
commit b3f548592aa8b2733e032affd84897dd98c3057f
6 changes: 3 additions & 3 deletions app/views/homepages/index.html.erb
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
<%= link_to top_movie.title, work_path(top_movie.id) %>
<small class="top-ten__creator">by <%= top_movie.creator %></small>
</h4>
<p> <%= top_movie.votes %> votes </p>
<p> <%= top_movie.votes.count %> votes </p>
</li>
<% end %>
</ul>
@@ -48,7 +48,7 @@
<%= link_to top_book.title, work_path(top_book.id) %>
<small class="top-ten__creator">by <%= top_book.creator %></small>
</h4>
<!-- Come back to when added votes <p>15 votes</p>-->
<p> <%= top_book.votes.count %> votes </p>
</li>
<% end %>
</ul>
@@ -66,7 +66,7 @@
<%= link_to top_album.title, work_path(top_album.id) %>
<small class="top-ten__creator">by <%= top_album.creator %></small>
</h4>
<!-- Come back to when added votes <p>15 votes</p>-->
<p> <%= top_album.votes.count %> votes </p>
</li>
<% end %>
</ul>
19 changes: 8 additions & 11 deletions app/views/works/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<main>
<h2>List of Works</h2>

<!-- Albums Table Example. Add custom method-->
<section class="media-table">
<% works = @works.where(category: "album") %>
<h4>Albums</h4>
<table class="table">
<thead>
<tr>
<!-- <th width="80">Votes</th>-->
<th width="80">Votes</th>
<th>Title</th>
<th>Created By</th>
<th width="100">Published</th>
@@ -18,7 +17,7 @@
<tbody>
<% works.each do |work| %>
<tr>
<!-- <td> <%#= work.votes.count %> </td>-->
<td> <%= work.votes.count %> </td>
<td> <%= link_to work.title, work_path(work.id) %> </td>
<td> <%= work.creator %> </td>
<td> <%= work.publication_year %> </td>
@@ -35,7 +34,7 @@
<table class="table">
<thead>
<tr>
<!-- <th width="80">Votes</th>-->
<th width="80">Votes</th>
<th>Title</th>
<th>Created By</th>
<th width="100">Published</th>
@@ -45,12 +44,11 @@
<tbody>
<% works.each do |work| %>
<tr>
<!-- <td> <%#= work.votes.count %> </td>-->
<td> <%= work.votes.count %> </td>
<td> <%= link_to work.title, work_path(work.id) %> </td>
<td> <%= work.creator %> </td>
<td> <%= work.publication_year %> </td>
<!-- <td> <%#= link_to "Upvote", class: "btn btn-primary" %> </td>-->
<!-- Insert path for Upvote when creating this functionality-->
<td> <%= link_to "Upvote", work_votes_path(work.id), method: :post, class: "btn btn-primary" %> </td>
</tr>
<% end %>
</tbody>
@@ -63,7 +61,7 @@
<table class="table">
<thead>
<tr>
<!-- <th width="80">Votes</th>-->
<th width="80">Votes</th>
<th>Title</th>
<th>Created By</th>
<th width="100">Published</th>
@@ -73,12 +71,11 @@
<tbody>
<% works.each do |work| %>
<tr>
<!-- <td> <%#= work.votes.count %> </td>-->
<td> <%= work.votes.count %> </td>
<td> <%= link_to work.title, work_path(work.id) %> </td>
<td> <%= work.creator %> </td>
<td> <%= work.publication_year %> </td>
<!-- <td> <%#= link_to "Upvote", class: "btn btn-primary" %> </td>-->
<!-- Insert path for Upvote when creating this functionality-->
<td> <%= link_to "Upvote", work_votes_path(work.id), method: :post, class: "btn btn-primary" %> </td>
</tr>
<% end %>
</tbody>