Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into mn-2019-09-style-social-login
Browse files Browse the repository at this point in the history
  • Loading branch information
Magdalena Noffke committed Sep 27, 2019
2 parents 8053b7d + 1d39115 commit 9490faf
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 14 deletions.
18 changes: 18 additions & 0 deletions apps/cms/settings/migrations/0007_importantpages_manual_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.5 on 2019-09-26 14:17

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('a4_candy_cms_settings', '0006_importantpages_donate_link'),
]

operations = [
migrations.AddField(
model_name='importantpages',
name='manual_link',
field=models.URLField(blank=True),
),
]
4 changes: 3 additions & 1 deletion apps/cms/settings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ class ImportantPages(BaseSetting):
blank=True,
on_delete=models.SET_NULL)
donate_link = models.URLField(blank=True)
manual_link = models.URLField(blank=True)


panels = [
PageChooserPanel('terms_of_use'),
PageChooserPanel('imprint'),
PageChooserPanel('data_protection_policy'),
PageChooserPanel('contact'),
FieldPanel('donate_link')
FieldPanel('donate_link'),
FieldPanel('manual_link')
]


Expand Down
11 changes: 6 additions & 5 deletions apps/organisations/templatetags/organisation_tags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django import template
from django.urls import Resolver404
from django.urls import resolve

from apps.organisations.models import Organisation
Expand All @@ -9,10 +10,10 @@
@register.simple_tag(takes_context=True)
def get_current_organisation(context):
request = context.request
resolver = resolve(request.path_info)
if resolver.kwargs and 'organisation_slug' in resolver.kwargs:
try:
try:
resolver = resolve(request.path_info)
if resolver.kwargs and 'organisation_slug' in resolver.kwargs:
return Organisation.objects.get(
slug=resolver.kwargs['organisation_slug'])
except Organisation.DoesNotExist:
pass
except (Resolver404, Organisation.DoesNotExist):
pass
3 changes: 0 additions & 3 deletions liqd_product/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.github',
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'rules.apps.AutodiscoverRulesConfig',
'easy_thumbnails',
'ckeditor',
Expand Down
9 changes: 8 additions & 1 deletion liqd_product/templates/a4dashboard/base_project_list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "a4dashboard/base_dashboard.html" %}
{% load i18n rules %}
{% load i18n rules wagtailsettings_tags %}
{% get_settings %}

{% block dashboard_content %}
<div class="l-menu">
Expand All @@ -24,6 +25,12 @@
class="btn btn--light btn--full">
{% trans 'Edit your organisation' %}
</a>
{% if settings.a4_candy_cms_settings.ImportantPages.manual_link %}
<a href="{{ settings.a4_candy_cms_settings.ImportantPages.manual_link }}"
class="btn btn--light btn--full">
{% trans 'Manual' %}
</a>
{% endif %}
{% endif %}
</nav>

Expand Down
1 change: 0 additions & 1 deletion liqd_product/templates/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ <h1>{% trans "Login" %}</h1>
</div>
</form>

<h3 class="socialaccounts-heading">{% trans "or use your social media account" %}</h3>
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
{% endblock %}
10 changes: 8 additions & 2 deletions liqd_product/templates/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load i18n static %}
{% load i18n static wagtailsettings_tags %}
{% get_settings %}

<footer class="footer px-3 pt-3">
<div class="l-wrapper">
Expand Down Expand Up @@ -48,12 +49,17 @@
<a href="{{ pages.contact.url }}" class="navi__link">{% trans 'Contact' %}</a>
</li>
{% endif %}
{% if pages.manual_link %}
<li class="navi__item footer__link">
<a href="{{ pages.manual_link }}" class="navi__link">{% trans 'Manual' %}</a>
</li>
{% endif %}
</ul>
</nav>
</div>
{% if pages.donate_link %}
<div class="col-12 col-sm-6 offset-sm-6 offset-lg-0 d-flex flex-column">
<a href="{{ pages.donate_link.url }}" class="btn btn--full {% if ORGANISATION %} btn--bg-tertiary {% else %} btn--secondary-filled {% endif %} mb-0 mr-0 mt-auto">{% trans 'Support the further development of the platform' %}<br><b>{% trans 'Donate now' %}</b></a>
<a href="{{ pages.donate_link }}" class="btn btn--full {% if ORGANISATION %} btn--bg-tertiary {% else %} btn--secondary-filled {% endif %} mb-0 mr-0 mt-auto">{% trans 'Support the further development of the platform' %}<br><b>{% trans 'Donate now' %}</b></a>
</div>
{% endif %}
{% endwith %}
Expand Down
8 changes: 7 additions & 1 deletion liqd_product/templates/footer_cms.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load i18n static %}
{% load i18n static wagtailsettings_tags %}
{% get_settings %}

<footer class="footer footer--cms px-3 pt-3">
<div class="row mt-3 mb-3 mb-sm-4 justify-content-lg-center">
Expand Down Expand Up @@ -47,6 +48,11 @@
<a href="{{ pages.contact.url }}" class="navi__link">{% trans 'Contact' %}</a>
</li>
{% endif %}
{% if pages.manual_link %}
<li class="navi__item footer__link">
<a href="{{ pages.manual_link }}" class="navi__link">{% trans 'Manual' %}</a>
</li>
{% endif %}
</ul>
</nav>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% get_providers as socialaccount_providers %}

{% if socialaccount_providers %}
<h3 class="socialaccounts-heading">{% trans "or use your social media account" %}</h3>
<ul class="list-group">
{% for provider in socialaccount_providers %}
{% if provider.id == "openid" %}
Expand Down

0 comments on commit 9490faf

Please sign in to comment.