Add possibility to have an unknown publication date
This commit is contained in:
parent
32716892d7
commit
e6cdf40fdc
3 changed files with 31 additions and 0 deletions
20
mainsite/migrations/0008_publication_unknown_date.py
Normal file
20
mainsite/migrations/0008_publication_unknown_date.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.5 on 2017-10-17 14:08
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mainsite', '0007_siteconfiguration_specialpublisdescr'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='publication',
|
||||||
|
name='unknown_date',
|
||||||
|
field=models.BooleanField(default=False, help_text="La date de publication du BOcal est inconnue parce qu'il est trop vieux. La date indiquée ne servira qu'à le ranger dans une année et à ordonner les BOcals.", verbose_name='Date inconnue'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -32,6 +32,13 @@ class Publication(models.Model):
|
||||||
# ^ This is not a URLField because we need internal URLS, eg `/static/blah`
|
# ^ This is not a URLField because we need internal URLS, eg `/static/blah`
|
||||||
|
|
||||||
date = DateField('Publication')
|
date = DateField('Publication')
|
||||||
|
unknown_date = BooleanField('Date inconnue',
|
||||||
|
help_text=("La date de publication du BOcal "
|
||||||
|
"est inconnue parce qu'il est "
|
||||||
|
"trop vieux. La date indiquée ne "
|
||||||
|
"servira qu'à le ranger dans une "
|
||||||
|
"année et à ordonner les BOcals."),
|
||||||
|
default=False)
|
||||||
is_special = BooleanField('Numéro spécial',
|
is_special = BooleanField('Numéro spécial',
|
||||||
help_text='Numéro du BOcal non-numéroté',
|
help_text='Numéro du BOcal non-numéroté',
|
||||||
default=False)
|
default=False)
|
||||||
|
|
|
@ -16,7 +16,11 @@ Millésime {{ year_range }}
|
||||||
<table class="publication-list">
|
<table class="publication-list">
|
||||||
{% for bocal in publications %}
|
{% for bocal in publications %}
|
||||||
<tr class="publication-entry">
|
<tr class="publication-entry">
|
||||||
|
{% if bocal.unknown_date %}
|
||||||
|
<td class="publication-date">Date inconnue</td>
|
||||||
|
{% else %}
|
||||||
<td class="publication-date">{{ bocal.date | date:"d/m/Y" }}</td>
|
<td class="publication-date">{{ bocal.date | date:"d/m/Y" }}</td>
|
||||||
|
{% endif %}
|
||||||
<td class="publication-body">
|
<td class="publication-body">
|
||||||
<a href="{{ bocal.url }}" title="Lire le BOcal !">{{ bocal }}</a>
|
<a href="{{ bocal.url }}" title="Lire le BOcal !">{{ bocal }}</a>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue