-
Notifications
You must be signed in to change notification settings - Fork 1
Star rating #159
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
Open
SavageWilliam
wants to merge
6
commits into
master
Choose a base branch
from
star-rating
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Star rating #159
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2e2f68a
wraps sections in dev to add flex styling
93dd0cc
adds star rating instead of number #150
4bcc029
gets type label from db and displays on resource view
5d24724
tidy styling and import star rating css file
8699f8d
removes console.log
3afe22d
adds reviews to db sql to test star rating #150
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,13 @@ | ||
| .rating-static { | ||
| width: 60px; | ||
| height: 16px; | ||
| display: block; | ||
| background: url('http://www.itsalif.info/blogfiles/rating/star-rating.png') 0 0 no-repeat; | ||
| } | ||
|
|
||
| .rating-5 { background-position: 0 0; } | ||
| .rating-4 { background-position: -12px 0; } | ||
| .rating-3 { background-position: -24px 0; } | ||
| .rating-2 { background-position: -36px 0; } | ||
| .rating-1 { background-position: -48px 0; } | ||
| .rating-0 { background-position: -60px 0; } |
This file contains hidden or 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 hidden or 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 hidden or 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,12 +1,24 @@ | ||
| {{#each resources}} | ||
| <section class="resources" style="display:inline-block"> | ||
| <h3 class="resource_title"><a href={{this.url}}>{{this.title}}</a></h3><br> | ||
| <p><a class="resource_btn" href='/{{this.topics_endpoint}}/{{this.endpoint}}'>{{this.reviews_count}} reviews</a>{{# if this.has_reviews}}, average rating {{this.reviews_avg}}{{/if}}</p> | ||
| {{# if ../credentials}} | ||
| <a class="resource_btn" href='/create-review/{{this.endpoint}}'>Write review</a><br> | ||
| <a class="resource_btn" href="/edit-resource/{{this.endpoint}}">Edit</a><br> | ||
| {{else}} | ||
| <p>Login/register to add a review</p> | ||
| {{/if}} | ||
| </section> | ||
| {{/each}} | ||
| <div class='resources'> | ||
| {{#each resources}} | ||
| <section class="resource"> | ||
| <h3 class="resource_title"><a href={{this.url}}>{{this.title}}</a></h3> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a few empty lines here, please remove |
||
| <p class='resource_type'> | ||
| {{this.type}} | ||
| </p> | ||
| <p><a class="resource_btn" href='/{{this.topics_endpoint}}/{{this.endpoint}}'> | ||
| {{this.reviews_count}} reviews</a> | ||
|
|
||
| {{# if this.has_reviews}} | ||
| <span class="rating-static rating-{{this.rating_avg}}"></span> | ||
| {{/if}} | ||
| </p> | ||
|
|
||
| {{# if ../credentials}} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. im just curious: what is this line saying? |
||
| <a class="resource_btn" href='/create-review/{{this.endpoint}}'>Write review</a><br> | ||
| <a class="resource_btn" href="/edit-resource/{{this.endpoint}}">Edit</a><br> | ||
| {{else}} | ||
| <p>Login/register to add a review</p> | ||
| {{/if}} | ||
| </section> | ||
| {{/each}} | ||
| </div> | ||
This file contains hidden or 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,8 +1,10 @@ | ||
| <h3 class="reviews_title">Reviews of: {{title}}</h3> | ||
|
|
||
| {{#each reviews}} | ||
| <section class="reviews"> | ||
| <p>Rating: {{this.rating}} stars</p><br> | ||
| <p>{{this.content}}</p> | ||
| </section> | ||
| {{/each}} | ||
| <div class='reviews'> | ||
| {{#each reviews}} | ||
| <section class="review"> | ||
| <p>Rating: {{this.rating}} stars</p><br> | ||
| <p>{{this.content}}</p> | ||
| </section> | ||
| {{/each}} | ||
| </div> |
This file contains hidden or 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 hidden or 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,11 +1,11 @@ | ||
| <!-- below is test code to test our server --> | ||
| {{#each topics}} | ||
|
|
||
| <section class="topics" style="background-image:url(/static/images/{{this.image_path}})"> | ||
| <h3 class = "topic_title">{{this.title}}</h3> | ||
| <form class="topic_btn" action = {{this.endpoint}} method="get"> | ||
| <input type="submit" value="Get Resources"> | ||
| </form> | ||
| </section> | ||
|
|
||
| {{/each}} | ||
| <div class='topics'> | ||
| {{#each topics}} | ||
| <section class="topic" style="background-image:url(/static/images/{{this.image_path}})"> | ||
| <h3 class = "topic_title">{{this.title}}</h3> | ||
| <form class="topic_btn" action = {{this.endpoint}} method="get"> | ||
| <input type="submit" value="Get Resources"> | ||
| </form> | ||
| </section> | ||
| {{/each}} | ||
| </div> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 space indentation here please :)