Skip to content

Commit

Permalink
Merge branch 'v2.6.0' into 'v2.x.x' (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
slavanga authored Jun 17, 2020
1 parent 26803dc commit 0edd32c
Show file tree
Hide file tree
Showing 23 changed files with 166 additions and 90 deletions.
32 changes: 27 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@ new features or plugins
#### FIXES
general bugfixes


## v2.6.0

#### IMPORTANT
- Moved browser check logo to container [#67](https://github.com/allink/allink-core/pull/67)
- Adjust browser-suggestion template to be column ready [#88](https://github.com/allink/allink-core/pull/88)

#### NEW
- Used link partial for all links [#66](https://github.com/allink/allink-core/pull/66)
- Grouped content in teaser tile item [#74](https://github.com/allink/allink-core/pull/74)
- Added variable to settings.py to overwrite allowed children of CMSAllinkSEOAccordionPlugin [#76](https://github.com/allink/allink-core/pull/76)
- add ```ALLINK_SEOACCORDION_PLUGIN_CHILD_CLASSES = []``` to settings.py
- Used button partial in form base [#81](https://github.com/allink/allink-core/pull/81)
- Removed logo and menu from lockdown page [#82](https://github.com/allink/allink-core/pull/82)
- Disabled image lazyload in menu [#84](https://github.com/allink/allink-core/pull/84)

#### FIXES
- Moved spaceless to link partial [#71](https://github.com/allink/allink-core/pull/71)
- Fixed locations opening_hours property [#79](https://github.com/allink/allink-core/pull/79)
- Fixed email translation [#80](https://github.com/allink/allink-core/pull/80)
- Set gallery-plugin autostart to false | set teaser-image ratio default to 16-9 [#87](https://github.com/allink/allink-core/pull/87)

## v2.5.5
#### IMPORTANT
###### TEMPLATES
Expand All @@ -26,24 +48,24 @@ general bugfixes
- we created our own implementation of google_tag_manager so you could remove aldryn_google_tag_manager in the divio control panel. [#78](https://github.com/allink/allink-core/pull/78)

## v2.5.4
###### FIXES
#### FIXES
- if an image does not exist locally, no exception will be thrown in render_meta_og [#75](https://github.com/allink/allink-core/pull/75)

## v2.5.3
###### FIXES
#### FIXES
- Config admin is now translatable [#69](https://github.com/allink/allink-core/pull/69)

## v2.5.2
###### FIXES
#### FIXES
- if an image does not exist locally, no exception will be thrown [#68](https://github.com/allink/allink-core/pull/68)

## v2.5.1
###### FIXES
#### FIXES
- fix logo link name in browser-check and header
- fix render image tests

## v2.5.0
###### NEW
#### NEW
- Image icon_enabled is now False by default [#55](https://github.com/allink/allink-core/pull/55)
- Added partial for submit buttons [#56](https://github.com/allink/allink-core/pull/56)
- Removed onscreen effect in the allink_content plugin [#57](https://github.com/allink/allink-core/pull/57)
Expand Down
2 changes: 1 addition & 1 deletion allink_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

__version__ = '2.5.5'
__version__ = '2.6.0'

# Cheeky setting that allows each template to be accessible by two paths.
# Eg: the template 'allink/templates/allink/base.html' can be accessed via both
Expand Down
33 changes: 19 additions & 14 deletions allink_core/apps/locations/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,29 +284,34 @@ def opening_hours(self):
"""

opening_times = [
(_('Monday'), self.mon),
(_('Tuesday'), self.tue),
(_('Wednesday'), self.wed),
(_('Thursday'), self.thu),
(_('Friday'), self.fri),
(_('Saturday'), self.sat),
(_('Sunday'), self.sun)
(_('Monday'), self.mon, self.mon_afternoon),
(_('Tuesday'), self.tue, self.tue_afternoon),
(_('Wednesday'), self.wed, self.wed_afternoon),
(_('Thursday'), self.thu, self.thu_afternoon),
(_('Friday'), self.fri, self.fri_afternoon),
(_('Saturday'), self.sat, self.sat_afternoon),
(_('Sunday'), self.sun, self.sun_afternoon)
]

opening_hours = []
for opening_time in opening_times:
day, morning = opening_time
morning = morning.replace(':', '.').replace('-', ' – ')
for i, opening_time in enumerate(opening_times):
day, morning, afternoon = opening_time
morning = morning.replace('-', ' – ')
afternoon = afternoon.replace('-', ' – ')

if not morning:
continue
elif len(opening_hours) and morning in list(map(lambda x: x.get('time'), opening_hours))[-1]:
if not morning and not afternoon:
day = {}
opening_hours.append(day)
elif len(opening_hours) \
and morning == list(map(lambda x: x.get('morning'), opening_hours))[-1] \
and afternoon == list(map(lambda x: x.get('afternoon'), opening_hours))[-1]:
opening_hours[-1]['end_day'] = day
else:
day = {
'start_day': day,
'end_day': day,
'time': morning,
'morning': morning,
'afternoon': afternoon,
}
opening_hours.append(day)

Expand Down
9 changes: 9 additions & 0 deletions allink_core/core/allink_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'ALLINK_MANDRILL_DEV_MODE_FROM_EMAIL_ADDRESS',
'ALLINK_MANDRILL_DEV_MODE_TO_EMAIL_ADDRESSES',
'ALLINK_CONTENT_PLUGIN_CHILD_CLASSES',
'ALLINK_SEOACCORDION_PLUGIN_CHILD_CLASSES',
'THUMBNAIL_QUALITY',
'THUMBNAIL_OPTIMIZE_COMMAND',
'DEBUG_TOOLBAR_CONFIG',
Expand Down Expand Up @@ -107,6 +108,14 @@

####################################################################################

# Assign Plugins which are allowed as child in Allink SEO Accordion Content

ALLINK_SEOACCORDION_PLUGIN_CHILD_CLASSES = [
'TextPlugin',
]

####################################################################################

# Locale

ALLINK_LOCALE_PATHS = [
Expand Down
24 changes: 11 additions & 13 deletions allink_core/core/templates/allink_core/includes/browser-check.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
{% load i18n inline_static_tags %}

<div class="browser-suggestion hidden">
<div class="browser-suggestion__header">
<div class="browser-suggestion__header-container">
<div class="browser-suggestion__container">
<div class="browser-suggestion__content">
<a class="brand-logo__link browser-suggestion__logo" href="{% url 'pages-root' %}" aria-label="Brand Logo">
{% inline_style 'images/branding/brand-logo-compact.svg' %}
</a>
</div>
</div>

<div class="browser-suggestion__container">
<div class="text-container">
<h6 class="lead">{% trans 'Browser Info' %}</h6>
<h2 class="heading">{% trans 'no optimal representation possible' %}</h2>
<p class="text">{% trans 'Your web browser does not provide an optimal representation of our website. This means that some functions may not work or the view may be incorrect. We recommend that you use a current browser.' %}</p>
</div>
<div class="text-container">
<h6 class="lead">{% trans 'Browser Info' %}</h6>
<h2 class="heading">{% trans 'no optimal representation possible' %}</h2>
<p class="text">{% trans 'Your web browser does not provide an optimal representation of our website. This means that some functions may not work or the view may be incorrect. We recommend that you use a current browser.' %}</p>
</div>

<div class="browser-suggestion__list">
{% trans 'Visit Anyways' as link_label %}
{% include "partials/buttons/link.html" with link_url="" link_label=link_label link_classes="btn btn-primary js-use-legacy-browser" link_attributes='rel="noopener" role="button"' %}
<div class="browser-suggestion__list">
{% trans 'Visit Anyways' as link_label %}
{% include "partials/buttons/link.html" with link_url="" link_label=link_label link_classes="btn btn-primary js-use-legacy-browser" link_attributes='rel="noopener" role="button"' %}
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ <h2 class="heading">{% trans 'Contact' %}</h2>
{% endif %}
{% if object.map_link %}
{% trans "Directions" as link_label %}
{% include "partials/buttons/link.html" with link_url=object.map_link link_label=link_label link_classes="btn btn-default" link_attributes='target="_blank" rel="noopener' %}
{% include "partials/buttons/link.html" with link_url=object.map_link link_label=link_label link_classes="text" link_attributes='target="_blank" rel="noopener"' icon="arrow-external" %}
{% endif %}
</p>

<p>
{% if object.email %}
<a class="text" href="mailto:{{object.email}}">{{object.email}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="mailto:" link_url=object.email link_label=object.email link_classes="text" %}<br>
{% endif %}
{% if object.phone %}
<a class="text" href="tel:{{object.phone}}">{{object.phone_formatted}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.phone link_label=object.phone_formatted link_classes="text" %}<br>
{% endif %}
{% if object.mobile %}
<a class="text" href="tel:{{object.mobile}}">{{object.mobile_formatted}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.mobile link_label=object.mobile_formatted link_classes="text" %}<br>
{% endif %}
{% if object.fax %}
<a class="text" href="tel:{{object.fax}}">{{object.fax_formatted}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.fax link_label=object.fax_formatted link_classes="text" %}<br>
{% endif %}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,24 @@ <h4 class="details-and-map-container__heading">{% render_model_ajax object "titl

<p>
{% if object.email %}
<a class="text" href="mailto:{{object.email}}">{{object.email}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="mailto:" link_url=object.email link_label=object.email link_classes="text" %}<br>
{% endif %}
{% if object.phone %}
{% trans "Phone:" %} <a href="tel:{{object.phone}}">{{object.phone_formatted}}</a><br>
{% trans "Phone:" %} {% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.phone link_label=object.phone_formatted link_classes="text" %}<br>
{% endif %}
{% if object.mobile %}
{% trans "Mobile:" %} <a href="tel:{{object.mobile}}">{{object.mobile_formatted}}</a><br>
{% trans "Mobile:" %} {% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.mobile link_label=object.mobile_formatted link_classes="text" %}<br>
{% endif %}
{% if object.fax %}
{% trans "Fax:" %} <a href="tel:{{object.fax}}">{{object.fax_formatted}}</a><br>
{% trans "Fax:" %} {% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.fax link_label=object.fax_formatted link_classes="text" %}<br>
{% endif %}
</p>

{% if object.map_link %}
<p><a class="text" href="{{object.map_link}}" target="_blank" rel="noopener">{% trans "Directions" %}</a></p>
<p>
{% trans "Directions" as link_label %}
{% include "partials/buttons/link.html" with link_url=object.map_link link_label=link_label link_classes="text" link_attributes='target="_blank" rel="noopener"' icon="arrow-external" %}
</p>
{% endif %}

{% if object.opening_hours_display %}
Expand Down Expand Up @@ -106,19 +109,19 @@ <h4>{% trans "Opening hours" %}</h4>
+ '</div>'
+ '<div class="block text-container">'
{% if object.phone %}
+ 'T <a class="text" href="tel:{{object.phone|escapejs}}">{{object.phone_formatted|escapejs}}</a>'
+ 'T <a href="tel:{{object.phone|escapejs}}">{{object.phone_formatted|escapejs}}</a>'
{% endif %}
{% if object.mobile %}
+ '<br>M <a class="text" href="tel:{{object.mobile|escapejs}}">{{object.mobile_formatted|escapejs}}</a>'
+ '<br>M <a href="tel:{{object.mobile|escapejs}}">{{object.mobile_formatted|escapejs}}</a>'
{% endif %}
{% if object.fax %}
+ '<br>F <a class="text" href="tel:{{object.fax|escapejs}}">{{object.fax_formatted|escapejs}}</a>'
+ '<br>F <a href="tel:{{object.fax|escapejs}}">{{object.fax_formatted|escapejs}}</a>'
{% endif %}
{% if object.email %}
+ '<br>E <a class="text" href="mailto:{{object.email|escapejs}}">{{object.email|escapejs}}</a>'
+ '<br>E <a href="mailto:{{object.email|escapejs}}">{{object.email|escapejs}}</a>'
{% endif %}
{% if object.map_link %}
+ '<br><br><a class="text" href="{{object.map_link|escapejs}}" target="_blank" rel="noopener">{% trans "Directions" %}</a>'
+ '<br><br><a href="{{object.map_link|escapejs}}" target="_blank" rel="noopener">{% trans "Directions" %}</a>'
{% endif %}
+ '</div>'
+ '</address>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,23 @@ <h4 class="heading">{% trans "Betreiber der Webseite" %}</h4>
{{object.zip_code}} {{object.place}}<br>
{% endif %}
{% if object.map_link %}
<a class="button-link-plugin__link text" href="{{object.map_link}}" target="_blank" rel="noopener">
<span class="button-link-plugin__text">
{% trans "Directions" %}
</span>
</a>
{% trans "Directions" as link_label %}
{% include "partials/buttons/link.html" with link_url=object.map_link link_label=link_label link_classes="text" link_attributes='target="_blank" rel="noopener"' icon="arrow-external" %}
{% endif %}
</p>

<p>
{% if object.email %}
<a class="text" href="mailto:{{object.email}}">{{object.email}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="mailto:" link_url=object.email link_label=object.email link_classes="text" %}<br>
{% endif %}
{% if object.phone %}
<a class="text" href="tel:{{object.phone}}">{{object.phone_formatted}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.phone link_label=object.phone_formatted link_classes="text" %}<br>
{% endif %}
{% if object.mobile %}
<a class="text" href="tel:{{object.mobile}}">{{object.mobile_formatted}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.mobile link_label=object.mobile_formatted link_classes="text" %}<br>
{% endif %}
{% if object.fax %}
<a class="text" href="tel:{{object.fax}}">{{object.fax_formatted}}</a><br>
{% include "partials/buttons/link.html" with link_prefix="tel:" link_url=object.fax link_label=object.fax_formatted link_classes="text" %}<br>
{% endif %}
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
+ '</div>'
+ '<div class="block text-container">'
{% if object.phone %}
+ 'T <a class="text" href="tel:{{object.phone}}">{{object.phone_formatted}}</a>'
+ 'T <a href="tel:{{object.phone}}">{{object.phone_formatted}}</a>'
{% endif %}
{% if object.mobile %}
+ '<br>M <a class="text" href="tel:{{object.mobile}}">{{object.mobile_formatted}}</a>'
+ '<br>M <a href="tel:{{object.mobile}}">{{object.mobile_formatted}}</a>'
{% endif %}
{% if object.fax %}
+ '<br>F <a class="text" href="tel:{{object.fax}}">{{object.fax_formatted}}</a>'
+ '<br>F <a href="tel:{{object.fax}}">{{object.fax_formatted}}</a>'
{% endif %}
{% if object.email %}
+ '<br>E <a class="text" href="mailto:{{object.email}}">{{object.email}}</a>'
+ '<br>E <a href="mailto:{{object.email}}">{{object.email}}</a>'
{% endif %}
{% if object.map_link %}
+ '<br><br><a class="text" href="{{object.map_link}}" target="_blank" rel="noopener">{% trans "Directions" %}</a>'
+ '<br><br><a href="{{object.map_link}}" target="_blank" rel="noopener">{% trans "Directions" %}</a>'
{% endif %}
+ '</div>'
+ '</address>
Expand Down
2 changes: 1 addition & 1 deletion allink_core/core/templates/allink_core/lockdown/form.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% load i18n allink_helpers %}

{% block navigation %}{% endblock %}
{% block header %}{% endblock %}

{% block body_class %}{{super}} tpl-lockdown{% endblock %}

Expand Down
Loading

0 comments on commit 0edd32c

Please sign in to comment.