-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meinberlin_contrib/item_detail.html: refactor and cleanup item_detail
- Loading branch information
Showing
6 changed files
with
129 additions
and
154 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,4 @@ | ||
### Changed | ||
|
||
- Cleaned up `meinberlin_contrib/item_detail.html` and `components/_item_detail.scss` | ||
- Separated dropdown into `item_detail_dropdown.html` for further refactoring. |
34 changes: 34 additions & 0 deletions
34
meinberlin/apps/contrib/templates/meinberlin_contrib/includes/item_detail_dropdown.html
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,34 @@ | ||
{% load i18n item_tags contrib_tags moderatorremark_tags react_reports %} | ||
|
||
<div class="dropdown"> | ||
<button title="{% translate 'Actions' %}" type="button" class="dropdown-toggle" aria-haspopup="true" aria-expanded="false" id="idea-{{ object.pk }}-actions"> | ||
<i class="fas fa-ellipsis-h" aria-label="{% translate 'Actions' %}"></i> | ||
</button> | ||
<nav class="dropdown-menu dropdown-menu-right" aria-labelledby="idea-{{ object.pk }}-actions"> | ||
<ul class="list--clean"> | ||
{% if user_may_change %} | ||
{% get_item_update_url object as change_url %} | ||
<li> | ||
<a class="dropdown-item" href="{{ change_url }}">{% translate 'edit' %}</a> | ||
</li> | ||
{% get_item_delete_url object as delete_url %} | ||
<li> | ||
<a class="dropdown-item" href="{{ delete_url }}">{% translate 'delete' %}</a> | ||
</li> | ||
{% endif %} | ||
{% get_item_url object 'moderate' False as moderate_url %} | ||
{% if is_moderator and moderate_url %} | ||
<li> | ||
<a class="dropdown-item" href="{{ moderate_url }}">{% translate 'moderate' %}</a> | ||
</li> | ||
{% endif %} | ||
|
||
{% block dropdown_items %}{% endblock dropdown_items %} | ||
|
||
<li> | ||
{% translate 'report' as report_text %} | ||
{% react_reports object text=report_text class='dropdown-item' %} | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> |
18 changes: 13 additions & 5 deletions
18
meinberlin/apps/contrib/templates/meinberlin_contrib/includes/item_detail_labels.html
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,12 +1,20 @@ | ||
{% load contrib_tags %} | ||
|
||
<div class="item-detail__labels"> | ||
{% for badge in object.item_badges_for_detail %} | ||
<span class="label label--big"> | ||
<ul class="pill__list"> | ||
{% for badge in object.item_badges_for_detail %} | ||
<li class="pill | ||
{% if badge.0 == 'category' %} | ||
pill--category | ||
{% endif %} | ||
{% if badge.0 == 'label' %} | ||
pill--label | ||
{% endif %} | ||
"> | ||
{% if badge.0 == 'point_label' %} | ||
<i class="fas fa-map-marker-alt" aria-hidden="true"></i> | ||
{% endif %} | ||
|
||
{{ badge.1 }} | ||
</span> | ||
</li> | ||
{% endfor %} | ||
</div> | ||
</ul> |
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,81 +1,27 @@ | ||
.item-detail { | ||
margin-bottom: $em-spacer; | ||
} | ||
|
||
.item-detail__title { | ||
font-size: $font-size-xl; | ||
padding: $spacer 0; | ||
margin: 0; | ||
} | ||
|
||
.item-detail__labels { | ||
margin-bottom: 1em; | ||
.item-detail__image { | ||
max-height: 490px; | ||
margin-top: -40px!important; | ||
overflow: hidden; | ||
} | ||
|
||
.item-detail__labels .label { | ||
display: inline-block; | ||
margin-bottom: 0.4em; | ||
.item-detail__user { | ||
padding-bottom: $spacer; | ||
} | ||
|
||
.item-detail__meta { | ||
padding-bottom: 0.5 * $padding; | ||
font-size: $font-size-sm; | ||
.item-detail .pill__list { | ||
margin-bottom: 0.8em; | ||
} | ||
|
||
.item-detail__actions { | ||
padding-top: $padding; | ||
border-top: 1px solid $border-color; | ||
} | ||
|
||
.item-detail__creator { | ||
margin-right: 0.5em; | ||
} | ||
|
||
.item-detail__ref { | ||
@media screen and (max-width: $breakpoint-xs-down) { | ||
float: left !important; // overwrite the l-bar-right for mobile | ||
margin-left: 0 !important; | ||
} | ||
} | ||
|
||
.item-detail__content { | ||
position: relative; | ||
z-index: 0; | ||
margin-bottom: 1em; | ||
} | ||
|
||
.item-detail__basic-content { | ||
@include clearfix; | ||
position: relative; | ||
margin-bottom: 1.5em; | ||
|
||
overflow-wrap: break-word; | ||
} | ||
|
||
.item-detail__hero-image { | ||
width: 100%; | ||
|
||
@media screen and (min-width: $breakpoint-xs) { | ||
display: inline-block; | ||
float: right; | ||
margin-left: 0.5em; | ||
width: auto; | ||
} | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.item-detail__background-image { | ||
position: relative; | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
background-position: center; | ||
width: 100%; | ||
padding-top: 60%; // this creates an aspect ratio in css, 100% = 1:1 ratio | ||
|
||
@media screen and (min-width: $breakpoint-xs) { | ||
margin: 3 * $spacer 0 2 * $spacer; | ||
} | ||
} | ||
|
||
.item-detail__copyright { | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
} | ||
.item-detail__reference { | ||
margin-bottom: $spacer; | ||
} |
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