-
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: redesign moderator notes
- Loading branch information
Showing
6 changed files
with
163 additions
and
62 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 @@ | ||
## Added | ||
- Separated the moderator notes into its own template (templates/meinberlin_contrib/components/moderator_notes.html) for better organization. | ||
- Created a new stylesheet (scss/components_user_facing/_moderator_notes.scss) specifically for the moderator notes snippet for better maintainability. | ||
- Added extra variables for icon color on (scss/components_user_facing/_variables.scss) with `icon-` prefix |
73 changes: 73 additions & 0 deletions
73
meinberlin/apps/contrib/templates/meinberlin_contrib/components/moderator_notes.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,73 @@ | ||
{% load i18n item_tags contrib_tags moderatorremark_tags %} | ||
|
||
{% if is_moderator and module.blueprint_type in 'PB3,PB2,PB' %} | ||
<section class="moderator-notes"> | ||
<details class="moderator-notes__details" open> | ||
<summary class="moderator-notes__summary"> | ||
<h2 class="moderator-notes__title">{% translate 'Moderation' %}</h2> | ||
<span class="fas fa-chevron-down moderator-notes__summary-icon" aria-hidden="true"></span> | ||
</summary> | ||
|
||
{% if object.module.moderationtask_set or object.remark.remark %} | ||
<section> | ||
<h3>{% translate 'Moderation tasks' %}</h3> | ||
{% if object.module.moderationtask_set.count > 0 %} | ||
<ul class="moderator-notes__list"> | ||
{% for task in object.module.moderationtask_set.all %} | ||
<li class="moderator-notes__list-item"> | ||
{% if task in object.completed_tasks.all %} | ||
<span class="fas fa-check-circle moderator-notes__list-item--done" aria-label="{% translate 'Done' %}"></span> | ||
{{ task.name }} | ||
{% else %} | ||
<span class="far fa-check-circle moderator-notes__list-item--pending" aria-label="{% translate 'Pending' %}"></span> | ||
{{ task.name }} | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<p> | ||
{% translate 'If you want to add moderation tasks here, you can do so in the module settings.' %} | ||
</p> | ||
{% endif %} | ||
</section> | ||
|
||
<section> | ||
<h3>{% translate 'Remark' %}</h3> | ||
{% if object.remark.remark %} | ||
<div class="moderator-notes__content"> | ||
<p> | ||
{{ object.remark.remark }} | ||
</p> | ||
</div> | ||
|
||
<div class="moderator-notes__meta"> | ||
{{ object.module.project.organisation.name }} | ||
|
||
{% if object.remark.modified %} | ||
{% translate 'updated on ' %}{% html_date object.remark.modified %} | ||
{% else %} | ||
{% translate 'created on ' %}{% html_date object.remark.created %} | ||
{% endif %} | ||
</div> | ||
{% else %} | ||
<div class="moderator-notes__content"> | ||
<p> | ||
{% translate 'No moderation remark has been filled yet.' %} | ||
</p> | ||
</div> | ||
{% endif %} | ||
</section> | ||
|
||
{% endif %} | ||
|
||
{% get_item_url object 'moderate' False as moderate_url %} | ||
{% if moderate_url %} | ||
<a href="{{ moderate_url }}" data-embed-target="external"> | ||
{% translate 'Edit' %} | ||
</a> | ||
{% endif %} | ||
|
||
</details> | ||
</section> | ||
{% endif %} |
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
76 changes: 76 additions & 0 deletions
76
meinberlin/assets/scss/components_user_facing/_moderator_notes.scss
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,76 @@ | ||
.moderator-notes { | ||
background-color: $bg-secondary; | ||
padding: $spacer; | ||
} | ||
|
||
.moderator-notes__summary { | ||
display: flex; | ||
place-content: center space-between; | ||
|
||
&::marker { | ||
display: none; | ||
content: ""; | ||
} | ||
|
||
span { | ||
display: flex; | ||
} | ||
|
||
span:before { | ||
font-size: 22px; | ||
align-self: center; | ||
} | ||
} | ||
|
||
.moderator-notes__details { | ||
&[open] { | ||
.moderator-notes__summary > span:before { | ||
transform: rotate(180deg); | ||
} | ||
} | ||
} | ||
|
||
.moderator-notes__title { | ||
font-size: 1.375em; | ||
line-height: 1.5em; | ||
margin: 0; | ||
} | ||
|
||
.moderator-notes__content { | ||
p { | ||
margin-bottom: 0.7em; | ||
} | ||
} | ||
|
||
.moderator-notes__meta { | ||
font-size: 14px; | ||
color: $gray; | ||
margin-bottom: 0.7em; | ||
} | ||
|
||
.moderator-notes__list { | ||
margin-left: 0; | ||
padding-left: 0; | ||
list-style-type: none; | ||
} | ||
|
||
.moderator-notes__list-item { | ||
&::marker { | ||
display: none; | ||
content: ""; | ||
} | ||
|
||
span { | ||
font-size: 18px; | ||
} | ||
|
||
&--done { | ||
color: $icon-green; | ||
} | ||
|
||
&--pending { | ||
color: $icon-light-grey; | ||
background-color: $white; | ||
border-radius: 50%; | ||
} | ||
} |
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