-
Notifications
You must be signed in to change notification settings - Fork 834
[bug 910884] [bug 910887] [bug 910886] Badges pages styled #1633
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b33c58f
[bug 910884] Style recent awards list page
rehandalal 6c22d0a
fixup
rehandalal 5d4cf88
fix test
rehandalal d3a9cee
fixup
rehandalal 91e9a9d
show date
rehandalal 50207cc
[bug 910887] Style badge details view page
rehandalal 82bb1ef
fixup
rehandalal e5aaf00
copy change
rehandalal 74700e1
[bug 910886] Style award details page
rehandalal eabadde
fixup
rehandalal e80d059
fix titles
rehandalal 9de7ed1
Add pagination to awards list page
rehandalal f4d9fa7
move setting
rehandalal 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| BADGER_BADGE_PAGE_SIZE = 12 |
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,54 +1,67 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% set styles=('badges',) %} | ||
|
|
||
| {% block content %} | ||
| <h1>Award detail</h1> | ||
| <div class="grid_6"> | ||
| <h2> | ||
| {% trans badge_name=_(badge.title, 'DB: badger.Badge.title') %} | ||
| Awarded badge: {{ badge_name }} | ||
| {% endtrans %} | ||
| </h2> | ||
|
|
||
| <section class="award"> | ||
| <dl class="award"> | ||
| <dt>Awarded to:</dt> | ||
| <dd class="awarded_to"><a href="{{ award.user.get_absolute_url() }}" | ||
| class="username">{{ award.user }}</a></dd> | ||
| <dl class="badge-details" data-slug="{{ badge.slug }}"> | ||
| {% if badge.image %} | ||
| <dt>{{ _('Image:') }}</dt> | ||
| <dd class="image"><a href="{{ badge.get_absolute_url() }}" class="image"><img src="{{ badge.image.url }}" width="256" height="256" /></a></dd> | ||
| {% endif %} | ||
|
|
||
| {% if award.description %} | ||
| <dt>Explanation:</dt> | ||
| <dd class="description">{{ award.description }}</dd> | ||
| {% if badge.description %} | ||
| <dt>{{ _('Description:') }}</dt> | ||
| <dd class="description">{{ _(badge.description, 'DB: badger.Badge.description') }}</dd> | ||
| {% endif %} | ||
|
|
||
| {% if award.creator %} | ||
| <dt>Awarded by:</dt> | ||
| <dd><a href="{{ award.creator.get_absolute_url() }}" | ||
| class="username">{{ award.creator }}</a></dd> | ||
| {% if badge.creator %} | ||
| <dt>{{ _('Creator:') }}</dt> | ||
| <dd><a href="{{ profile_url(badge.creator) }}">{{ badge.creator }}</a></dd> | ||
| {% endif %} | ||
|
|
||
| <dt>Issued on:</dt> | ||
| <dd>{{ award.created }}</dd> | ||
| </dl> | ||
| </section> | ||
| <dt>{{ _('Created:') }}</dt> | ||
| <dd>{{ datetimeformat(badge.created) }}</dd> | ||
|
|
||
| <section class="badge"> | ||
| <h2>Badge</h2> | ||
| <dt>{{ _('Modified:') }}</dt> | ||
| <dd>{{ datetimeformat(badge.modified) }}</dd> | ||
| </dl> | ||
| </div> | ||
|
|
||
| <dl class="badge" data-slug="{{ badge.slug }}"> | ||
| <dt>Title:</dt> | ||
| <dd class="title">{{ badge.title }}</dd> | ||
| <div class="grid_6"> | ||
| <h2>{{ _('Award details') }}</h2> | ||
| <dl class="badge-details"> | ||
| <dt>{{ _('Awarded to:') }}</dt> | ||
| <dd class="awarded_to"> | ||
| <a href="{{ profile_url(award.user) }}"> | ||
| <img src="{{ profile_avatar(award.user) }}" alt="" title="{{ award.user }}"> | ||
| <br>{{ award.user }} | ||
| </a> | ||
| </dd> | ||
|
|
||
| {% if award and award.image %} | ||
| <dt>Image:</dt> | ||
| <dd class="image"><a href="{{ badge.get_absolute_url() }}" class="image"><img src="{{ award.image.url }}" width="256" height="256" /></a></dd> | ||
| {% elif badge.image %} | ||
| <dt>Image:</dt> | ||
| <dd class="image"><a href="{{ badge.get_absolute_url() }}" class="image"><img src="{{ badge.image.url }}" width="256" height="256" /></a></dd> | ||
| {% if award.description %} | ||
| <dt>{{ _('Explanation:') }}</dt> | ||
| <dd class="description">{{ award.description }}</dd> | ||
| {% endif %} | ||
|
|
||
| {% if badge.description %} | ||
| <dt>Description:</dt> | ||
| <dd class="description">{{ badge.description }}</dd> | ||
| {% if award.creator %} | ||
| <dt>{{ _('Awarded by:') }}</dt> | ||
| <dd> | ||
| <a href="{{ profile_url(award.creator) }}"> | ||
| <img src="{{ profile_avatar(award.creator) }}" alt="" title="{{ award.creator }}"> | ||
| {{ award.creator }} | ||
| </a> | ||
| </dd> | ||
| {% endif %} | ||
|
|
||
| <dt>Created:</dt> | ||
| <dd>{{ badge.created }}</dd> | ||
|
|
||
| <dt>Modified:</dt> | ||
| <dd>{{ badge.modified }}</dd> | ||
| <dt>{{ _('Issued on:') }}</dt> | ||
| <dd>{{ datetimeformat(award.created) }}</dd> | ||
| </dl> | ||
| </section> | ||
| </div> | ||
| {% endblock %} | ||
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,37 +1,58 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% set styles=('badges',) %} | ||
|
|
||
| {% block content %} | ||
| <section class="awards_list"> | ||
| <div class="grid_12"> | ||
| {% if badge %} | ||
| <h2>Awards for {{ badge }}</h2> | ||
| {% trans badge_name=_(badge.title, 'DB: badger.Badge.title') %} | ||
| <h2>Recently awarded "{{ badge_name }}" badges</h2> | ||
| {% endtrans %} | ||
| {% else %} | ||
| <h2>Recent Awards</h2> | ||
| <h2>{{ _('Recently awarded badges') }}</h2> | ||
| {% endif %} | ||
| </div> | ||
|
|
||
| <ul> | ||
| {% for award in award_list %} | ||
| {% if award.image %} | ||
| {% set award_image = award.image.url %} | ||
| {% elif award.badge.image %} | ||
| {% set award_image = award.badge.image.url %} | ||
| {% else %} | ||
| {% set award_image = STATIC_URL + 'kbadge/img/default-badge.png' %} | ||
| {% endif %} | ||
| <li> | ||
| <a href="{{ award.get_absolute_url() }}"><img src="{{ award_image }}" | ||
| alt="{{ award.badge.title }}" width="128" height="128" /></a> | ||
| <ul class="cf" id="awards-list"> | ||
| {% for award in award_list %} | ||
| {% if award.image %} | ||
| {% set award_image = award.image.url %} | ||
| {% elif award.badge.image %} | ||
| {% set award_image = award.badge.image.url %} | ||
| {% else %} | ||
| {% set award_image = STATIC_URL + 'kbadge/img/default-badge.png' %} | ||
| {% endif %} | ||
| <li class="grid_4"> | ||
| <a class="cf" href="{{ award.get_absolute_url() }}"> | ||
| <div class="badge"> | ||
| <img src="{{ award_image }}" alt="" title="{{ _(award.badge.title, 'DB: badger.Badge.title') }}"> | ||
| <span>{{ _(award.badge.title, 'DB: badger.Badge.title') }}</span> | ||
| </div> | ||
| <div class="award"> | ||
| {{ _('awarded to') }} | ||
| <br><img src="{{ profile_avatar(award.user) }}" alt="" title="{{ award.user }}"> | ||
| <br>{{ award.user }} | ||
| </div> | ||
| <div class="meta"> | ||
| {{ datetimeformat(award.created) }} | ||
| </div> | ||
| </a> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
|
|
||
| <a href="{{ award.get_absolute_url() }}"> | ||
| {# TODO: This is bad l10n, but it's a mockup. #} | ||
| <span class="badge_title">{{ award.badge.title }}</span> | ||
| <span class="relation">awarded to</span> | ||
| <span class="user">{{ award.user }}</span> | ||
| {% if award.description %} | ||
| <span class="award_description">{{ award.description }}</span> | ||
| {% endif %} | ||
| </a> | ||
| {% if is_paginated %} | ||
| <ol class="pagination cf"> | ||
| {% if page_obj.has_previous %} | ||
| <li class="prev"> | ||
| <a href="{{ pagination_base_url }}?page={{ page_obj.previous_page_number }}&sort={{current_sort}}" class="btn-page btn-page-prev">{{_('Previous')}}</a> | ||
| </li> | ||
| {% endif %} | ||
| {% if page_obj.has_next %} | ||
| <li class="next"> | ||
| <a href="{{ pagination_base_url }}?page={{ page_obj.next_page_number }}&sort={{current_sort}}" class="btn-page btn-page-next">{{_('Next')}}</a> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| {# TODO: pagination here #} | ||
| </section> | ||
| {% endif %} | ||
| </ol> | ||
| {% endif %} | ||
| {% endblock %} |
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,45 +1,50 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block content %} | ||
| <section> | ||
| <h2>Badge detail</h2> | ||
|
|
||
| <dl class="badge" data-slug="{{ badge.slug }}"> | ||
| <dt>Title:</dt> | ||
| <dd class="title">{{ badge.title }}</dd> | ||
| {% set styles=('badges',) %} | ||
|
|
||
| {% block content %} | ||
| <div class="grid_6"> | ||
| <h2> | ||
| {% trans badge_name=_(badge.title, 'DB: badger.Badge.title') %} | ||
| Badge: {{ badge_name }} | ||
| {% endtrans %} | ||
| </h2> | ||
|
|
||
| <dl class="badge-details" data-slug="{{ badge.slug }}"> | ||
| {% if badge.image %} | ||
| <dt>Image:</dt> | ||
| <dt>{{ _('Image:') }}</dt> | ||
| <dd class="image"><a href="{{ badge.get_absolute_url() }}" class="image"><img src="{{ badge.image.url }}" width="256" height="256" /></a></dd> | ||
| {% endif %} | ||
|
|
||
| {% if badge.description %} | ||
| <dt>Description:</dt> | ||
| <dd class="description">{{ badge.description }}</dd> | ||
| <dt>{{ _('Description:') }}</dt> | ||
| <dd class="description">{{ _(badge.description, 'DB: badger.Badge.description') }}</dd> | ||
| {% endif %} | ||
|
|
||
| <dt>Creator:</dt> | ||
| <dd><a href="{{ badge.creator.get_absolute_url() }}">{{ badge.creator }}</a></dd> | ||
| {% if badge.creator %} | ||
| <dt>{{ _('Creator:') }}</dt> | ||
| <dd><a href="{{ profile_url(badge.creator) }}">{{ badge.creator }}</a></dd> | ||
| {% endif %} | ||
|
|
||
| <dt>Created:</dt> | ||
| <dd>{{ badge.created }}</dd> | ||
| <dt>{{ _('Created:') }}</dt> | ||
| <dd>{{ datetimeformat(badge.created) }}</dd> | ||
|
|
||
| <dt>Modified:</dt> | ||
| <dd>{{ badge.modified }}</dd> | ||
| <dt>{{ _('Modified:') }}</dt> | ||
| <dd>{{ datetimeformat(badge.modified) }}</dd> | ||
| </dl> | ||
| </section> | ||
| </div> | ||
|
|
||
| {% if award_list %} | ||
| <section> | ||
| <h2>Recent awards</h2> | ||
| <ul> | ||
| <div class="grid_6"> | ||
| <h2>{{ _('Recent awardees') }}</h2> | ||
| <ul class="awardees"> | ||
| {% for award in award_list %} | ||
| <li> | ||
| <a href="{{ award.get_absolute_url() }}">{{ award.user }}</a> | ||
| <a href="{{ award.get_absolute_url() }}"><img src="{{ profile_avatar(award.user) }}" alt="" title="{{ award.user }}"></a> | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| </section> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% endblock %} |
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
Oops, something went wrong.
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.
If the award doesn't have a description, should it fallback to the badge description?
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.
No it shouldn't. The award "description" (which I think is poorly named) is the reason the person was awarded the award. The badge "description" is what the badge is about. I don't think the two things are the same plus I'm pretty sure this page already shows the badge description.
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.
Oh, if it already shows the badge description then we are good to go. 👍
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.
and yes it does i see now... i just lost myself in my sea of comments.