Skip to content

Commit

Permalink
refactor: shortened lines
Browse files Browse the repository at this point in the history
  • Loading branch information
sabinammm authored and khamui committed Dec 8, 2021
1 parent ab1a0b1 commit 18fa38d
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,30 @@
{% load static contrib_tags %}

{% if item.district %}
<a href="{% url 'meinberlin_plans:plan-list' %}?district={{ item.district.name }}" class="storefront__item storefront__district tile__md">
<h2 class="storefront__district-text">{% blocktrans with district=item.district %}What is happening in <strong>{{ district }}</strong>?{% endblocktrans %}</h2>
<a
href="{% url 'meinberlin_plans:plan-list' %}?district={{ item.district.name }}"
class="storefront__item storefront__district tile__md"
>
<h2 class="storefront__district-text">
{% blocktrans with district=item.district %}
What is happening in <strong>{{ district }}</strong>?
{% endblocktrans %}
</h2>
<h2 class="storefront__district-text">
{% blocktrans with district=item.district %}
What is happening in <strong>{{ district }}</strong>?
{% endblocktrans %}
</h2>
<button class="btn btn-primary">
{% blocktrans count counter=item.district_project_count %}display {{ counter }} project{% plural %}display {{ counter }} projects{% endblocktrans %}
{% blocktrans count counter=item.district_project_count %}
display {{ counter }} project{% plural %}display {{ counter }} projects
{% endblocktrans %}
</button>
</a>
{% elif item.project and not item.quote %}
<a href="{{ item.project_url }}" {% if item.item_type == 'external' %}target="_blank"{% endif %} class="storefront__item storefront__proj tile__md">
<a href="{{ item.project_url }}"
{% if item.item_type == 'external' %}target="_blank"{% endif %}
class="storefront__item storefront__proj tile__md">
{% if item.project.module_running_days_left < 3 %}
<div>
<div class="storefront__ending-icon">
Expand All @@ -25,16 +41,26 @@ <h2 class="storefront__district-text">{% blocktrans with district=item.district
{% endif %}
</div>
{% endif %}
<p class="storefront__sm-text">{% if item.project.administrative_district %}{{ item.project.administrative_district }}{% else %}{% trans 'City wide' %}{% endif %}</p>
<h2 class="storefront__proj-text {% if item.project.name|length > 95 %} storefront__proj-text-wide {% endif %}">{{ item.project.name }}</h2>
<p class="storefront__sm-text">
{% if item.project.administrative_district %}
{{ item.project.administrative_district }}
{% else %}
{% trans 'City wide' %}
{% endif %}
</p>
<h2 class="storefront__proj-text {% if item.project.name|length > 95 %} storefront__proj-text-wide {% endif %}">
{{ item.project.name }}
</h2>
{% if item.project.running_modules %}
<div class="status-item status-item__position-storefront status__active">
<div class="status-bar__active">
<span class="status-bar__active-fill" style="width:{{ item.project.module_running_progress }}%"></span>
</div>
<span class="status-bar__status"><i class="fas fa-clock"></i>
{% if item.project.module_running_days_left < 365 %}
{% blocktrans with time_left=item.project.module_running_time_left %} {{ time_left }} remaining {% endblocktrans %}
{% blocktrans with time_left=item.project.module_running_time_left %}
{{ time_left }} remaining
{% endblocktrans %}
{% else %}
<span>{% trans 'more than 1 year remaining' %}</span>
{% endif %}
Expand All @@ -56,11 +82,18 @@ <h2 class="storefront__proj-text {% if item.project.name|length > 95 %} storefro
{% endif %}
</a>
{% elif item.project and item.quote %}
<a href="{{ item.project_url }}" {% if item.item_type == 'external' %}target="_blank"{% endif %} class="storefront__item storefront__proj-quote tile__md">
<a href="{{ item.project_url }}"
{% if item.item_type == 'external' %}target="_blank"{% endif %}
class="storefront__item storefront__proj-quote tile__md"
>
<blockquote class="storefront__quote-text">
„{{ item.quote|truncatechars:150 }}“
</blockquote>
<div class="storefront__opinion-text">{% blocktrans with name=item.project.name|truncatechars:60 %} What is your opinion on this: {{ name }}?{% endblocktrans %}</div>
<div class="storefront__opinion-text">
{% blocktrans with name=item.project.name|truncatechars:60 %}
What is your opinion on this: {{ name }}?
{% endblocktrans %}
</div>
</a>
{% elif not item.project and item.quote %}
<div class="storefront__item storefront__quote tile__md">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,21 @@ <h3 class="list-item__title">
<span class="label label--big">{{ object.category }}</span>
{% endif %}
{% if object.point_label %}
<span class="label label--big"><i class="fas fa-map-marker-alt" aria-hidden="true"></i> {{ object.point_label }}</span>
<span class="label label--big">
<i class="fas fa-map-marker-alt" aria-hidden="true"></i>
{{ object.point_label }}
</span>
{% endif %}
{% if object.budget > 0 %}
<span class="label label--big">{{ object.budget|intcomma }}€</span>
{% endif %}
{% if object.moderator_feedback %}
<span class="label label--big label--{{object.moderator_feedback|classify|lower }} list-item__label--moderator-feedback">
<span class=
"label
label--big
label--{{object.moderator_feedback|classify|lower }}
list-item__label--moderator-feedback"
>
{{ object.get_moderator_feedback_display }}
</span>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ <h3 class="list-item__title">
<span class="label label--big">{{ object.category }}</span>
{% endif %}
{% if object.moderator_feedback %}
<span class="label label--big label--{{ object.moderator_feedback|classify|lower }} list-item__label--moderator-feedback">
<span class=
"label
label--big
label--{{ object.moderator_feedback|classify|lower }}
list-item__label--moderator-feedback"
>
{{ object.get_moderator_feedback_display }}
</span>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@ <h3 class="list-item__title">
<span class="label label--big">{{ object.category }}</span>
{% endif %}
{% if object.point_label %}
<span class="label label--big"><i class="fas fa-map-marker-alt" aria-hidden="true"></i> {{ object.point_label }}</span>
<span class="label label--big">
<i class="fas fa-map-marker-alt" aria-hidden="true"></i>
{{ object.point_label }}
</span>
{% endif %}
{% if object.moderator_feedback %}
<span class="label label--big label--{{ object.moderator_feedback|classify|lower }} list-item__label--moderator-feedback">
<span class=
"label
label--big
label--{{ object.moderator_feedback|classify|lower }}
list-item__label--moderator-feedback"
>
{{ object.get_moderator_feedback_display }}
</span>
{% endif %}
Expand Down
71 changes: 47 additions & 24 deletions meinberlin/apps/plans/templates/meinberlin_plans/plan_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ <h1 class="item-detail__title u-break-word">

{% if object.topic_names %}
<dl>
<dt>{% trans 'Topic' %}</dt><dd>{{ object.topic_names.0 }}{% if object.topic_names.1 %}, {{ object.topic_names.1 }}{% endif %}</dd>
<dt>{% trans 'Topic' %}</dt>
<dd>{{ object.topic_names.0 }}
{% if object.topic_names.1 %}
,{{ object.topic_names.1 }}
{% endif %}
</dd>
</dl>
{% endif %}

Expand All @@ -81,8 +86,11 @@ <h1 class="item-detail__title u-break-word">
<dl>
<dt>{% trans 'Participation' %}</dt>
<dd>
{{ object.get_participation_display }}{% if object.participation == object.PARTICIPATION_YES and object.published_projects.count %},
<a href='#participation-plans'>{% trans 'see participation plans' %}</a>
{{ object.get_participation_display }}
{% if object.participation == object.PARTICIPATION_YES and object.published_projects.count %},
<a href='#participation-plans'>
{% trans 'see participation plans' %}
</a>
{% endif%}
</dd>
</dl>
Expand All @@ -101,7 +109,9 @@ <h1 class="item-detail__title u-break-word">
{% if object.description_image %}
<div class="item-detail__background-image" style="background-image: url({% thumbnail object.description_image 'item_image' %})">
{% if object.description_image_copyright %}
<span class="item-detail__copyright copyright">© {{ object.description_image_copyright }}</span>
<span class="item-detail__copyright copyright">
© {{ object.description_image_copyright }}
</span>
{% endif %}
</div>
{% endif %}
Expand All @@ -114,29 +124,39 @@ <h1 class="item-detail__title u-break-word">
{% endif %}
</div>
</div>
{% if object.contact_name or object.contact_address_text or object.contact_email or object.contact_phone or object.contact_url or object.organisation.address or object.organisation.url %}
{% if object.contact_name or
object.contact_address_text or
object.contact_email or
object.contact_phone or
object.contact_url or
object.organisation.address or
object.organisation.url %}
<div class="l-tiles-2 u-spacer-bottom">
{% if object.contact_name or object.contact_address_text or object.contact_email or object.contact_phone or object.contact_url %}
{% if object.contact_name or
object.contact_address_text or
object.contact_email or
object.contact_phone or
object.contact_url %}
<div>
<h3>{% trans 'Contact for questions' %}</h3>
{% if object.contact_name %}
<p>{{ object.contact_name }}</p>
<p>{{ object.contact_name }}</p>
{% endif %}
{% if object.contact_address_text %}
<p>{{ object.contact_address_text|linebreaks }}</p>
<p>{{ object.contact_address_text|linebreaks }}</p>
{% endif %}
{% if object.contact_phone %}
<p><strong>{% trans 'Telephone' %}: </strong>{{ object.contact_phone }}</p>
<p><strong>{% trans 'Telephone' %}: </strong>{{ object.contact_phone }}</p>
{% endif %}
{% if object.contact_email %}
<a class="btn btn--secondary" href="mailto:{{ object.contact_email }}">
{% trans 'Email' %}
</a>
<a class="btn btn--secondary" href="mailto:{{ object.contact_email }}">
{% trans 'Email' %}
</a>
{% endif %}
{% if object.contact_url %}
<a class="btn btn--secondary" target="_blank" href="{{ object.contact_url }}">
{% trans 'Website' %}
</a>
<a class="btn btn--secondary" target="_blank" href="{{ object.contact_url }}">
{% trans 'Website' %}
</a>
{% endif %}
</div>
{% endif %}
Expand All @@ -145,13 +165,13 @@ <h3>{% trans 'Contact for questions' %}</h3>
<div>
<h3>{% trans 'Responsible body' %}</h3>
{% if object.organisation.address %}
<p>{{ object.organisation.name }}</p>
<p>{{ object.organisation.address|linebreaks }}</p>
<p>{{ object.organisation.name }}</p>
<p>{{ object.organisation.address|linebreaks }}</p>
{% endif %}
{% if object.organisation.url %}
<a class="btn btn--secondary" target="_blank" href="{{ object.organisation.url }}">
{% trans 'Website' %}
</a>
<a class="btn btn--secondary" target="_blank" href="{{ object.organisation.url }}">
{% trans 'Website' %}
</a>
{% endif %}
</div>
{% endif %}
Expand Down Expand Up @@ -181,7 +201,9 @@ <h3>{% trans 'Responsible body' %}</h3>
href="{% url 'a4dashboard:plan-update' organisation_slug=object.organisation.slug pk=object.pk %}"
class="dropdown-item"
data-embed-target="external"
>{% trans 'Edit' %}</a>
>
{% trans 'Edit' %}
</a>
</li>
</div>
</div>
Expand All @@ -196,11 +218,12 @@ <h3>{% trans 'Responsible body' %}</h3>
{% if object.published_projects %}
<div class="item-detail-2__project-list">
<div class="l-wrapper">
<h3 class="item-detail-2__project-title" id="participation-plans">{% trans "Participation projects" %}</h3>
<h3 class="item-detail-2__project-title" id="participation-plans">
{% trans "Participation projects" %}
</h3>
<ul class="u-list-reset participation-tile__list">
{% for project in object.published_projects %}

{% include "meinberlin_projects/includes/project_tile.html" with project=project %}
{% include "meinberlin_projects/includes/project_tile.html" with project=project %}
{% endfor %}
</ul>
</div>
Expand Down

0 comments on commit 18fa38d

Please sign in to comment.