Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
01a7cd69
Verified
Commit
01a7cd69
authored
Feb 03, 2018
by
Sébastiaan Versteeg
Browse files
Make board/committee description an HTMLField
parent
ea0ef4a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
website/activemembers/migrations/0026_auto_20180203_2151.py
0 → 100644
View file @
01a7cd69
# Generated by Django 2.0.2 on 2018-02-03 20:51
from
django.db
import
migrations
import
tinymce.models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'activemembers'
,
'0025_auto_20180108_1253'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'committee'
,
name
=
'description_en'
,
field
=
tinymce
.
models
.
HTMLField
(
verbose_name
=
'Description (EN)'
),
),
migrations
.
AlterField
(
model_name
=
'committee'
,
name
=
'description_nl'
,
field
=
tinymce
.
models
.
HTMLField
(
verbose_name
=
'Description (NL)'
),
),
]
website/activemembers/models.py
View file @
01a7cd69
...
@@ -8,6 +8,7 @@ from django.db import models
...
@@ -8,6 +8,7 @@ from django.db import models
from
django.urls
import
reverse
from
django.urls
import
reverse
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
tinymce
import
HTMLField
from
utils.translation
import
(
ModelTranslateMeta
,
MultilingualField
,
from
utils.translation
import
(
ModelTranslateMeta
,
MultilingualField
,
localize_attr_name
)
localize_attr_name
)
...
@@ -57,7 +58,7 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
...
@@ -57,7 +58,7 @@ class Committee(models.Model, metaclass=ModelTranslateMeta):
)
)
description
=
MultilingualField
(
description
=
MultilingualField
(
models
.
Text
Field
,
HTML
Field
,
verbose_name
=
_
(
'Description'
),
verbose_name
=
_
(
'Description'
),
)
)
...
...
website/activemembers/templates/activemembers/board_detail.html
View file @
01a7cd69
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load i18n thumbnail static %}
{% load i18n thumbnail static
bleach_tags
%}
{% block title %}{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }} — {% trans "Boards" %} — {{ block.super }}{% endblock %}
{% block title %}{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }} — {% trans "Boards" %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }} — {% trans "Boards" %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }} — {% trans "Boards" %} — {{ block.super }}{% endblock %}
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
{% if board.description %}
{% if board.description %}
<div>
<div>
<h1
class=
"midhead"
>
{% blocktrans with name=board.name%}About {{ name }}{% endblocktrans %}
</h1>
<h1
class=
"midhead"
>
{% blocktrans with name=board.name%}About {{ name }}{% endblocktrans %}
</h1>
<p
class=
"text-center"
>
{{ board.description }}
</p>
<p
class=
"text-center"
>
{{ board.description
|bleach
}}
</p>
</div>
</div>
{% endif %}
{% endif %}
<div
class=
"clearfix member-directory"
>
<div
class=
"clearfix member-directory"
>
...
...
website/activemembers/templates/activemembers/committee_detail.html
View file @
01a7cd69
{% extends "base.html" %}
{% extends "base.html" %}
{% load i18n static thumbnail %}
{% load i18n static thumbnail
bleach_tags
%}
{% block title %}{{ committee.name }} — {% trans 'Committees' %} — {{ block.super }}{% endblock %}
{% block title %}{{ committee.name }} — {% trans 'Committees' %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{{ committee.name }} — {% trans 'Committees' %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{{ committee.name }} — {% trans 'Committees' %} — {{ block.super }}{% endblock %}
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</div>
</div>
<div>
<div>
<h1
class=
"midhead"
>
{% blocktrans with name=committee.name %}About the {{ name }}{% endblocktrans %}
</h1>
<h1
class=
"midhead"
>
{% blocktrans with name=committee.name %}About the {{ name }}{% endblocktrans %}
</h1>
<p
class=
"text-center"
>
{{ committee.description }}
</p>
<p
class=
"text-center"
>
{{ committee.description
|bleach
}}
</p>
</div>
</div>
<div
class=
"clearfix member-directory"
>
<div
class=
"clearfix member-directory"
>
<h1
class=
"midhead"
>
{% trans 'Committee members' %}
</h1>
<h1
class=
"midhead"
>
{% trans 'Committee members' %}
</h1>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment