Skip to content

Commit 340178e

Browse files
author
Kátia Nakamura
committed
core: add country to person model and flag to the templates
1 parent d53bb56 commit 340178e

File tree

9 files changed

+69
-4
lines changed

9 files changed

+69
-4
lines changed

pyconbalkan/conference/templates/home.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ <h1 class="centered">Keynote Speakers</h1>
6161
</div>
6262
<h2 class="centered">
6363
{{ keynote.name }}
64+
{% if keynote.country %}
65+
<i class="flag em em-flag-{{ keynote.country.code|lower }}"></i>
66+
{% endif %}
6467
</h2>
6568
</a>
6669
<p class="card__job">

pyconbalkan/core/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.db import models
2+
from django_countries.fields import CountryField
23
from markdownx.models import MarkdownxField
34
from slugify import slugify
45

@@ -18,6 +19,7 @@ class Person(models.Model):
1819
slug = models.CharField(unique=True, blank=True, max_length=100)
1920
description = MarkdownxField(blank=True, default='')
2021
email = models.EmailField(blank=True, null=True)
22+
country = CountryField(null=True, blank=True)
2123

2224
def save(self, *args, **kwargs):
2325
if not self.slug:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Flag
3+
* Usually <hr> elements representing a line.
4+
*/
5+
6+
i.flag {
7+
height: 1.0em;
8+
width: 1.0em;
9+
}

pyconbalkan/core/templates/base.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<link rel="stylesheet" href="{% static 'css/components/person.css' %}">
3030
<link rel="stylesheet" href="{% static 'css/components/countdown.css' %}">
3131
<link rel="stylesheet" href="{% static 'css/components/featured-letter.css' %}">
32+
<link rel="stylesheet" href="{% static 'css/components/flag.css' %}">
3233
<link rel="stylesheet" href="{% static 'css/components/form.css' %}">
3334
<link rel="stylesheet" href="{% static 'css/components/line.css' %}">
3435
<link rel="stylesheet" href="{% static 'css/components/long-text.css' %}">
@@ -40,6 +41,7 @@
4041
<link rel="stylesheet" href="{% static 'css/components/timetable.css' %}">
4142
<link rel="stylesheet" href="{% static 'css/helpers/spacing.css' %}">
4243
<link rel="stylesheet" href="{% static 'css/main.css' %}">
44+
<link rel="stylesheet" href="https://afeld.github.io/emoji-css/emoji.css">
4345

4446
<!-- Timer JS -->
4547
<!-- Set the date we're counting down to -->
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 2.0.5 on 2018-08-03 15:06
2+
3+
from django.db import migrations
4+
import django_countries.fields
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('organizers', '0012_auto_20180801_2318'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='volunteer',
16+
name='country',
17+
field=django_countries.fields.CountryField(blank=True, max_length=2, null=True),
18+
),
19+
]

pyconbalkan/organizers/templates/organizer.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
<div class="organizer">
88
<div class="organizer__image">
99
<img src="{{ organizer.images.first.profile_picture.url }}">
10-
1110
</div>
1211
<div class="organizer__details">
13-
<h1 class="title organizer__title title--yellow">{{ organizer.name }}</h1>
12+
<h1 class="title organizer__title title--yellow">
13+
{{ organizer.name }}
14+
{% if organizer.country %}<i class="flag em em-flag-{{ organizer.country.code|lower }}"></i>{% endif %}
15+
</h1>
1416
<h2 class="organizer__job title--blue">
1517
{{ organizer.job }}
1618
</h2>

pyconbalkan/organizers/templates/organizers.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ <h1 class="centered">Organizers</h1>
1717
</div>
1818
<h2 class="card__name title--blue">
1919
{{ organizer.name }}
20+
{% if organizer.country %}
21+
<i class="flag em em-flag-{{ organizer.country.code|lower }}"></i>
22+
{% endif %}
2023
</h2>
2124
</a>
2225
{% if organizer.job %}
@@ -49,6 +52,9 @@ <h1 class="centered">Volunteers</h1>
4952
</div>
5053
<h2 class="card__name title--blue">
5154
{{ volunteer.name }}
55+
{% if volunteer.country %}
56+
<i class="flag em em-flag-{{ volunteer.country.code|lower }}"></i>
57+
{% endif %}
5258
</h2>
5359
{% if volunteer.job %}
5460
<p class="card__job">
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 2.0.5 on 2018-08-03 15:06
2+
3+
from django.db import migrations
4+
import django_countries.fields
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('speaker', '0009_auto_20180801_2318'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='speaker',
16+
name='country',
17+
field=django_countries.fields.CountryField(blank=True, max_length=2, null=True),
18+
),
19+
]

pyconbalkan/speaker/templates/speaker.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
<div class="speaker">
88
<div class="speaker__image">
99
<img src="{{ speaker.images.first.profile_picture.url }}">
10-
1110
</div>
11+
1212
<div class="speaker__details">
13-
<h1>{{ speaker.name }}</h1>
13+
<h1>
14+
{{ speaker.name }}
15+
{% if speaker.country %}<i class="flag em em-flag-{{ speaker.country.code|lower }}"></i>{% endif %}
16+
</h1>
1417
<h2>{{ speaker.job }}</h2>
1518
<p class="speaker__description title--white">
1619
{{ speaker.description|safe }}

0 commit comments

Comments
 (0)