Skip to content
Snippets Groups Projects
Unverified Commit 68e5eb0f authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #1769 from OpenTechFund/enhancement/add_guide_link_to_fund_lab_pages

Add guide link field to labs and fund, display it on fund/lab pages a…
parents 0b9e074f 245afdf4
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.2.9 on 2020-01-31 12:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('funds', '0071_update_field_reviewer'),
]
operations = [
migrations.AddField(
model_name='applicationbase',
name='guide_link',
field=models.URLField(blank=True, help_text='Link to the apply guide.', max_length=255),
),
migrations.AddField(
model_name='labbase',
name='guide_link',
field=models.URLField(blank=True, help_text='Link to the apply guide.', max_length=255),
),
]
......@@ -73,6 +73,8 @@ class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore
related_name='funds',
)
guide_link = models.URLField(blank=True, max_length=255, help_text=_('Link to the apply guide.'))
slack_channel = models.CharField(blank=True, max_length=128, help_text=_('The slack #channel for notifications.'))
objects = PageManager.from_queryset(ApplicationBaseManager)()
......@@ -110,6 +112,7 @@ class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore
content_panels = WorkflowStreamForm.content_panels + [
FieldPanel('approval_form'),
FieldPanel('reviewers', widget=forms.SelectMultiple(attrs={'size': '16'})),
FieldPanel('guide_link'),
FieldPanel('slack_channel'),
]
......@@ -400,6 +403,8 @@ class LabBase(EmailForm, WorkflowStreamForm, SubmittableStreamForm): # type: ig
related_name='labs',
)
guide_link = models.URLField(blank=True, max_length=255, help_text=_('Link to the apply guide.'))
slack_channel = models.CharField(blank=True, max_length=128, help_text=_('The slack #channel for notifications.'))
parent_page_types = ['apply_home.ApplyHomePage']
......@@ -409,6 +414,7 @@ class LabBase(EmailForm, WorkflowStreamForm, SubmittableStreamForm): # type: ig
FieldPanel('approval_form'),
FieldPanel('lead'),
FieldPanel('reviewers', widget=forms.SelectMultiple(attrs={'size': '16'})),
FieldPanel('guide_link'),
FieldPanel('slack_channel'),
]
......
......@@ -6,7 +6,6 @@
{% block header_modifier %}header--light-bg{% endblock %}
{% block content %}
{% if form.errors or form.non_field_errors %}
<div class="wrapper wrapper--medium wrapper--error">
<svg class="icon icon--error"><use xlink:href="#error"></use></svg>
......@@ -26,6 +25,11 @@
{# the page has no open rounds and we arent on a round page #}
<h3>{% blocktrans %}Sorry this {{ page|verbose_name }} is not accepting applications at the moment{% endblocktrans %}</h3>
{% else%}
{% if page.get_parent.specific.guide_link %}
<a href="{{ page.get_parent.specific.guide_link }}" class="link link--fixed-apply">
{% trans "Application guide" %}
</a>
{% endif %}
<form class="form application-form" action="/test500/" method="POST" enctype="multipart/form-data">
{{ form.media }}
{% csrf_token %}
......
......@@ -15,6 +15,11 @@
<a href="{% pageurl apply_page %}" class="link link--button-secondary">
{% trans "Apply for this" %} {% verbose_name apply_page %}
</a>
{% if apply_page.specific.guide_link %}
<a href="{{ apply_page.specific.guide_link }}" class="link link--button-tertiary">
{% trans "Application guide" %}
</a>
{% endif %}
{% else %}
<h3 class="heading heading--no-margin">
{% trans "CLOSED" %}
......
......@@ -32,6 +32,17 @@
@include button($color--purple, darken($color--purple, 20%));
}
&--button-tertiary {
@include button(transparent, darken($color--purple, 20%));
color: $color--purple;
border-color: $color--purple;
&:focus,
&:hover {
color: $color--white;
}
}
&--button-transparent {
@include button(transparent, $color--darkest-blue);
color: $color--white;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment