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

Queues - Tehut - MediaRanker #28

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7b16fec
added welcome controller and completed app foundation
tehut Apr 10, 2017
049b684
created MediaRanker header image
tehut Apr 11, 2017
3a23f46
added validation tests for model and descriptions of relationship tests
tehut Apr 11, 2017
f1ce01f
created votes join table and wrote relationships on users, works and …
tehut Apr 11, 2017
353078f
completed relationship unit tests for work
tehut Apr 12, 2017
f001602
wrote works controller tests and config file
tehut Apr 12, 2017
1573c31
commiting deleted media files
tehut Apr 12, 2017
3930b7d
wrote crud controller methods on works controller and configured inde…
tehut Apr 12, 2017
c0b2700
formatted and styled views for works#index
tehut Apr 12, 2017
4c6acc1
added login functionality and view
tehut Apr 12, 2017
f14ee18
part of login funcationality
tehut Apr 12, 2017
07e85a9
created routes, controller methods and views for eah category show page
tehut Apr 12, 2017
eab7d05
edited belongs_to on vote model
tehut Apr 13, 2017
4453155
made header into link and made links on index items
tehut Apr 13, 2017
30957f2
added user_votes method to works model and created table to view vote…
tehut Apr 13, 2017
85578bf
added create media feature and added link to item show pages
tehut Apr 13, 2017
c74a38f
changed root, deployment debugging
tehut Apr 13, 2017
9dc7f91
changed root, deployment debugging
tehut Apr 13, 2017
40bffae
changed root, deployment debugging
tehut Apr 13, 2017
6799255
cleaning up routes for heroku debugging
tehut Apr 13, 2017
6898eda
model and controller tests on the works table
tehut Apr 14, 2017
94f7d7e
changed the controller to reflect things I learned during tests
tehut Apr 14, 2017
5f1ff0a
added foundation
tehut Apr 14, 2017
4b08971
added name validation to model
tehut Apr 14, 2017
a812cdc
added views and controller log to for join button
tehut Apr 14, 2017
13a8e98
added tests for index and creae on controller and all_votes on user m…
tehut Apr 14, 2017
4017b80
added tests for user_controller
tehut Apr 14, 2017
7b32ddf
updated user_votes method on work model
tehut Apr 14, 2017
69e9e1b
show all of a users votes and made views and links
tehut Apr 14, 2017
dbb6993
added uniqueness validation to votes
tehut Apr 14, 2017
2ffbe17
removed welcome controller and made works#index root
tehut Apr 14, 2017
9330490
completed media spotlight
tehut Apr 14, 2017
1f57f3c
fixed header to resize appropritely and removed unneccesary routes on…
tehut Apr 15, 2017
ac0e557
styled buttons and fixed spacing on all views
tehut Apr 15, 2017
3ba3201
fixed placement of count on#create test
tehut Apr 15, 2017
68e78f9
cleanup on abandoned model method
tehut Apr 15, 2017
65b62d6
fixed bug reported by jreynolds
tehut Apr 18, 2017
0be5e2e
modified method to show user votes
tehut Apr 18, 2017
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
styled buttons and fixed spacing on all views
tehut committed Apr 15, 2017
commit ac0e5576f95214f809fe3e12f195896aaa5187d8
3 changes: 3 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -50,3 +50,6 @@ border-bottom-color: grey;
font-family: sans-serif;
font-weight: 100;
}
main#row{padding:0px;margin:0px;}
#destroy {background-color: red;color: white; text-shadow:none;}
article {width: 50%;display:inline-block;}
6 changes: 1 addition & 5 deletions app/assets/stylesheets/works.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
body {
margin: 0px;
padding: 0px;

#top {
color: black;
font-weight: lighter;
font-family: sans-serif;
}

}
#books, #albums, #movies{
font-family: sans-serif;
display: inline-block;
width: 30%;
vertical-align: top;
margin-left: 5px;
margin-right: 5px;
5 changes: 3 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@
<%= csrf_meta_tags %>

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'foundation'%>'
<%= stylesheet_link_tag 'foundation'%>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

</head>
@@ -24,7 +25,7 @@
<section id="login" class="small-7">
<% if session[:user_id]%>
<em> <%= "You are logged in as #{User.find(session[:user_id]).username}"%></em>
<%=link_to "logout", logout_path, method: :delete %>
<%=link_to "Logout", logout_path, method: :delete %>
<%else%>
<%=link_to "Login", login_path %>

20 changes: 11 additions & 9 deletions app/views/works/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
<head>
<%= stylesheet_link_tag 'foundation'%>'
</head>
<body>

<section id = "top">
<h2> Media Spotlight </h2>
<p>
<%@highest.each do |id, count| %>
<%="#{Work.find(id).title} by "%>
<%=link_to Work.find(id).title, work_path(Work.find(id))%> by
<%="#{Work.find(id).created_by}"%>
<%="#{Work.find(id).description}"%> <br>
<%="#{Work.find(id).votes.length} votes"%>

<% break%>
<%end%>
</p>
</section>
<section id = "albums" class = "small-12 medium-12 large-4">

<section id = "albums" class = "top-ten columns large-3 small-12 ">
<h2> Top Albums </h2>
<% @albums.each do |item| %>
<%=render partial: 'list' , locals:{item:item}%>

<%end%>
<%= link_to "View More Albums", albums_path%>
</section>

<section id = "books" class = "small-12 medium-12 large-4">
<section id = "books" class = "top-ten columns large-3 small-12 ">
<h2> Top Books </h2>
<% @books.each do |item| %>
<%=render partial: 'list', locals:{item:item} %>
<%end%>
<%= link_to "View More Books", books_path%>
</section>

<section id = "movies" class = "small-12 medium-12 large-4">
<section id = "movies" class = "top-ten columns large-5 small-12 ">
<h2> Top Movies</h2>
<% @movies.each do |item| %>
<%=render partial: 'list' , locals:{item:item}%>
<%end%>
<%= link_to "View More Movies", movies_path%>
</section>
</body>
47 changes: 28 additions & 19 deletions app/views/works/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<section id = "show">
<main class = "row">
<article id = "show" class= "top-ten columns large-7 medium-4 small-12">
<!-- Display item details -->
<h2> <%[email protected]%></h2>
<br>
@@ -11,33 +11,41 @@ Published:<%= @work.published%>

<!-- Vote Link -->
<%if session[:user_id]%>
<%= link_to " Upvote ", vote_path(@work.id), method: :post%>
<%= flash[:success]%>
<em class= "button"> <%= link_to " Upvote ", vote_path(@work.id), method: :post%></em>
<%end%>


<!-- Add Media -->

<em class= "button">
<%= link_to "Add new media", new_work_path%> </em>


<!-- Edit Link -->
<em class= "button"><%= link_to "Edit #{@work.category.capitalize}", edit_work_path%></em>

<!-- Destroy Link -->
<em class= "button" id= "destroy"> <%= link_to "Delete #{@work.category.capitalize}", works_path(@work.id), method: :delete, data:{confirm: "Are you sure?"} %></em>


<!-- Logic to display appropriate "back to" for each category -->

<br>
<% case @work.category%>
<% when "book" %>
<%= link_to "Back to #{@work.category.capitalize}s", books_path%>
<em class= "button"><%= link_to "Back to #{@work.category.capitalize}s", books_path%></em>
<% when "album" %>
<%= link_to "Back to #{@work.category.capitalize}s", albums_path%>
<em class= "button"><%= link_to "Back to #{@work.category.capitalize}s", albums_path%></em>
<% when "movie" %>
<%= link_to "Back to #{@work.category.capitalize}s", movies_path%>
<em class= "button"><%= link_to "Back to #{@work.category.capitalize}s", movies_path%></em
<%end%>

<!-- Edit Link -->
<%= link_to "Edit #{@work.category.capitalize}", edit_work_path%>

<!-- Destroy Link -->
<%= link_to "Delete #{@work.category.capitalize}", works_path(@work.id), method: :delete, data:{confirm: "Are you sure?"} %>
</section>

<!-- Add Media -->
<%= link_to "Add new media", new_work_path%>

</article>
<!-- Display each vote for displayed item-->
<section id = "vote_display">
<table>
<article id = "vote_display" class= "top-ten columns large-4 medium-4 small-12">
<h3><%[email protected]%> Votes for this <%[email protected]%></h3>
<table >
<%counter = 0 %>
<%@votes.each do |vote|%>
<tr>
@@ -47,4 +55,5 @@ Published:<%= @work.published%>
</tr>
<%end%>
</table>
</section>
</article>
</main>