-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #660 from VirginiaDooley/feature/new-person-page
Feature/new person page
- Loading branch information
Showing
20 changed files
with
924 additions
and
372 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
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,17 @@ | ||
# Generated by Django 2.2.18 on 2021-02-25 11:03 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0002_auto_20170526_1448"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="loggedpostcode", | ||
options={"get_latest_by": "modified"}, | ||
), | ||
] |
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,17 @@ | ||
# Generated by Django 2.2.18 on 2021-02-25 11:03 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("feedback", "0002_feedback_token"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="feedback", | ||
options={"get_latest_by": "modified"}, | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
wcivf/apps/news_mentions/migrations/0003_auto_20210225_1103.py
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,17 @@ | ||
# Generated by Django 2.2.18 on 2021-02-25 11:03 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("news_mentions", "0002_ballotnewsarticle_publisher"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="ballotnewsarticle", | ||
options={"get_latest_by": "modified"}, | ||
), | ||
] |
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
40 changes: 40 additions & 0 deletions
40
wcivf/apps/people/templates/people/includes/_person_about_card.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,40 @@ | ||
{% if object.wikipedia_bio or object.associatedcompany_set.exists or object.cv %} | ||
<section class="ds-card"> | ||
<div class="ds-card-body"> | ||
<h2 class="ds-candidate-name ds-h3"> | ||
About {{ object.name }} | ||
</h2> | ||
{% if object.cv %} | ||
<p> | ||
<h3>CV</h3> | ||
<p>{{ object.cv }}</p> | ||
{% endif %} | ||
</p> | ||
|
||
{% if object.wikipedia_bio %} | ||
<h3>Wikipedia</h3> | ||
<p>{{ object.wikipedia_bio }}</p> | ||
<a href="{{ object.wikipedia_url }}" class="link-button">Read more on Wikipedia</a> | ||
{% endif %} | ||
|
||
{% if object.associatedcompany_set.exists %} | ||
<h3>Associated companies</h3> | ||
<p>{{object.name}} is associated with the following companies:</p> | ||
<ul> | ||
{% for company in object.associatedcompany_set.all %} | ||
<li> | ||
<strong>{{ company.company_name }}</strong> | ||
|
||
{{ company.role }}{% if company.role_status %}({{ company.role_status }}){% endif %} | ||
{{ company.role_appointed_date | date:"Y" }} – {{ company.role_resigned_date | date:"Y"}} | ||
|
||
<a href="https://beta.companieshouse.gov.uk/company/{{ company.company_number }}/"> | ||
More details from Companies House} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</div> | ||
</section> | ||
{% endif %} |
108 changes: 108 additions & 0 deletions
108
wcivf/apps/people/templates/people/includes/_person_contact_card.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,108 @@ | ||
<section class="ds-card"> | ||
<div class="ds-card-body ds-stack-smaller"> | ||
<h2 class="ds-candidate-name ds-h3"> | ||
{{ object.name }} online | ||
</h2> | ||
<dl class="ds-descriptions"> | ||
{% if object.facebook_page_url or object.facebook_personal_url %} | ||
<div> | ||
<dt>Facebook</dt> | ||
<div> | ||
{% if object.facebook_personal_url %} | ||
<dd> | ||
<a href="{{ object.facebook_personal_url }}" title="{{ object.name }}'s Facebook personal page"> | ||
{{ object.facebook_personal_username }} | ||
</a><br /> | ||
</dd> | ||
{% endif %} | ||
{% if object.facebook_page_url %} | ||
<dd> | ||
<a href="{{ object.facebook_page_url }}" title="{{ object.name }}'s Facebook page"> | ||
{{ object.facebook_username}} | ||
</a> | ||
</dd> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
{% if object.linkedin_url %} | ||
<div> | ||
<dt>LinkedIn</dt> | ||
<dd> | ||
<a href="{{ object.linkedin_url }}" title="{{ object.name }}'s LinkedIn profile"> | ||
{{ object.linkedin_username}} | ||
</a> | ||
</dd> | ||
</div> | ||
{% endif %} | ||
|
||
{% if object.homepage_url %} | ||
<div> | ||
<dt>Home page</dt> | ||
<dd> | ||
<a href="{{ object.homepage_url }}" title="{{ object.name }}'s home page"> | ||
{{ object.homepage_url }} | ||
</a> | ||
</dd> | ||
</div> | ||
{% endif %} | ||
|
||
{% if object.instagram_url %} | ||
<div> | ||
<dt>Instagram</dt> | ||
<dd> | ||
<a href="{{ object.instagram_url }}" title="{{ object.name }}'s instagram"> | ||
{{ object.instagram_username }} | ||
</a> | ||
</dd> | ||
</div> | ||
{% endif %} | ||
|
||
{% if object.youtube_profile %} | ||
<div> | ||
<dt>YouTube</dt> | ||
<dd> | ||
<a href="{{ object.youtube_profile }}" title="{{ object.name }}'s YouTube"> | ||
{{ object.youtube_username }} | ||
</a> | ||
</dd> | ||
</div> | ||
{% endif %} | ||
|
||
{% if object.party_ppc_page_url %} | ||
<div> | ||
<dt>The party's candidate page for this person</dt> | ||
<dd> | ||
<a href="{{ object.party_ppc_page_url }}" title="Party page for {{ object.name }}"> | ||
{{ object.party_ppc_page_url }} | ||
</a> | ||
</dd> | ||
</div> | ||
{% endif %} | ||
|
||
{% if object.email and object.current_or_future_candidacies %} | ||
<div> | ||
<dt>Email</dt> | ||
<dd> | ||
<a href="mailto:{{ object.email }}">{{ object.email }}</a> | ||
</dd> | ||
</div> | ||
{% else %} | ||
<div> | ||
<dt>We don't know {{ object.name }}'s email address.</dt> | ||
<dd> | ||
<a href="{{ object.get_ynr_url }}">Can you add it?</a> | ||
</dd> | ||
</div> | ||
{% endif %} | ||
</dl> | ||
<h3>Latest tweets</h3> | ||
<div class="twitter_container"> | ||
<a data-width="100%" data-height="500" class="twitter-timeline" href="https://twitter.com/{{ object.twitter_username }}"> | ||
Tweets by @{{ object.twitter_username }}</a> | ||
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> | ||
</div> | ||
</div> | ||
</section> | ||
|
42 changes: 42 additions & 0 deletions
42
wcivf/apps/people/templates/people/includes/_person_edit_details_card.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,42 @@ | ||
{% load humanize %} | ||
|
||
{% if object.current_or_future_candidacies %} | ||
<section class="ds-card"> | ||
<div class="ds-card-body"> | ||
<h3>That's all we know! Will you help us find more about this candidate?</h3> | ||
<p>Our volunteers have been working hard to add information on as many | ||
candidates as possible, but they need help. | ||
</p> | ||
|
||
{% if object.should_show_email_cta %} | ||
<p>Thousands of voters will rely on this site. | ||
{% else %} | ||
<p> | ||
{% endif %} | ||
If you can add information that should be on this page | ||
|
||
{% if object.cta_example_details %} | ||
- such as {{ object.name }}'s | ||
{{ object.cta_example_details|join:", " }} - | ||
{% endif %} | ||
please use our crowdsourcing website to add it.</p> | ||
<a href="{{ object.get_ynr_url }}update/" class="ds-cta ds-cta-blue"> | ||
Add or edit details » | ||
</a> | ||
{% if object.should_show_email_cta %} | ||
<p>You can also email {{ object.name }} directly to ask them to add information to this page. | ||
<p> | ||
<a href="{% url 'email_person_view' pk=object.pk ignored_slug=person.name|slugify %}" | ||
class="ds-cta ds-cta-blue">Ask the | ||
candidate for more information »</a> | ||
</p> | ||
{% endif %} | ||
|
||
<h4>Upload your leaflets</h4> | ||
<p>If you've received election leaflets from {{ object.name }}, please take a photo | ||
of them and upload them to ElectionLeaflets.org</p> | ||
<p><a class="ds-button ds-cta ds-cta-blue" type="button" href="https://electionleaflets.org/">Add leaflets</a> | ||
</p> | ||
</div> | ||
</section> | ||
{% endif %} |
14 changes: 14 additions & 0 deletions
14
wcivf/apps/people/templates/people/includes/_person_hustings_card.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,14 @@ | ||
{% load humanize %} | ||
|
||
{% if object.postelection.husting_set.exists and object.current_or_future_candidacies %} | ||
<section class="ds-card ds-stack-smaller"> | ||
<div class="ds-card-body"> | ||
<h3>Local hustings</h3> | ||
<p>You can meet candidates and question them at local hustings. Here are hustings where {{ object.name }} may | ||
be | ||
appearing. | ||
</p> | ||
{% include "elections/includes/_hustings_list.html" with hustings=object.postelection.husting_set.all %} | ||
</div> | ||
</section> | ||
{% endif %} |
33 changes: 33 additions & 0 deletions
33
wcivf/apps/people/templates/people/includes/_person_intro_card.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,33 @@ | ||
<section class="ds-candidate"> | ||
<div class="ds-candidate-body ds-stack-smaller"> | ||
<h2 class="ds-candidate-name ds-h3"> | ||
{{ object.name }} | ||
</h2> | ||
{% if person.display_deceased and person.personpost.party.is_independent %} | ||
(Deceased) | ||
{% endif %} | ||
|
||
{% if object.current_or_future_candidacies.all.count > 1 %} | ||
<h5>{{ object.name }} is {% if object.personpost.party.is_independent %}an{% else %}a{% endif %} {{object.personpost.party.party_name }} candidate in the following elections:</h5> | ||
|
||
{% for candidacy in object.current_or_future_candidacies %} | ||
<ul> | ||
<li> | ||
{{ candidacy.election.name }} for {{ candidacy.post_election.friendly_name }} | ||
</li> | ||
</ul> | ||
{% endfor %} | ||
|
||
{% else %} | ||
<p> | ||
{{ object.intro|safe }}. | ||
</p> | ||
{% endif %} | ||
</div> | ||
|
||
{% if object.photo_url %} | ||
<div class="ds-candidate-image"> | ||
<img src="{{ object.photo_url }}" alt="profile photo of {{ object.name }}"> | ||
</div> | ||
{% endif %} | ||
</section> |
Oops, something went wrong.