apply pre-commit (#86371)
This commit is contained in:
parent
36b4551cce
commit
65add720c7
|
@ -19,7 +19,6 @@ from django.db.migrations.operations.base import Operation
|
|||
|
||||
|
||||
class EnsureJsonbType(Operation):
|
||||
|
||||
reversible = True
|
||||
|
||||
def __init__(self, model_name, field_name):
|
||||
|
|
|
@ -19,7 +19,7 @@ from django.contrib.auth import get_user_model
|
|||
from django.shortcuts import redirect
|
||||
from django.urls import reverse
|
||||
from django.urls.exceptions import NoReverseMatch
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.decorators.cache import never_cache
|
||||
|
||||
from . import models
|
||||
|
@ -65,11 +65,10 @@ class UserDocumentAdmin(admin.ModelAdmin):
|
|||
'document__content_hash',
|
||||
]
|
||||
|
||||
@admin.display(description=_('thumbnail'))
|
||||
def thumbnail(self, instance):
|
||||
return instance.document.thumbnail_img_tag
|
||||
|
||||
thumbnail.short_description = _('thumbnail')
|
||||
|
||||
|
||||
class DocumentAdmin(admin.ModelAdmin):
|
||||
fields = ['content_hash', 'thumbnail', 'users']
|
||||
|
@ -82,11 +81,10 @@ class DocumentAdmin(admin.ModelAdmin):
|
|||
qs = User.objects.filter(user_documents__document=instance)
|
||||
return ', '.join('%s' % u for u in qs)
|
||||
|
||||
@admin.display(description=_('thumbnail'))
|
||||
def thumbnail(self, instance):
|
||||
return instance.thumbnail_img_tag
|
||||
|
||||
thumbnail.short_description = _('thumbnail')
|
||||
|
||||
|
||||
class OriginAdmin(admin.ModelAdmin):
|
||||
fields = ['label', 'slug']
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from rest_framework.serializers import ValidationError
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import os
|
|||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.template.defaultfilters import filesizeformat
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from . import models
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
|
|
@ -10,7 +10,6 @@ from django.utils.timezone import utc
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [
|
||||
('fargo', '0001_initial'),
|
||||
('fargo', '0002_auto_20150818_2117'),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('fargo', '0001_squashed_0017_auto_20180331_1532'),
|
||||
|
|
|
@ -16,7 +16,6 @@ def noop(apps, schema_editor):
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('fargo', '0002_auto_20150818_2117'),
|
||||
|
|
|
@ -6,7 +6,6 @@ from fargo.db_utils import EnsureJsonbType
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0002_auto_20210824_0957'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0003_auto_20150924_1056'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('fargo', '0003_text_to_jsonb'),
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('fargo', '0004_auto_20160212_0936'),
|
||||
|
|
|
@ -13,7 +13,6 @@ def noop(apps, schema_editor):
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0005_auto_20160312_1809'),
|
||||
]
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0006_fill_new_columns'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0007_auto_20160312_1816'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0008_validation_origin'),
|
||||
]
|
||||
|
|
|
@ -3,7 +3,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0009_auto_20160326_2104'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0010_auto_20160413_0809'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0011_userdocument_deletable_by_user'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0012_auto_20161124_0626'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0013_document_mime_type'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.utils import timezone
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0014_auto_20171016_0854'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0015_document_creation_date'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fargo', '0016_auto_20180330_2248'),
|
||||
]
|
||||
|
|
|
@ -20,19 +20,19 @@ import os
|
|||
import re
|
||||
import subprocess
|
||||
import threading
|
||||
from urllib.parse import quote
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.core.files.storage import default_storage
|
||||
from django.db import models
|
||||
from django.db.models import JSONField
|
||||
from django.db.models.signals import post_delete, post_save
|
||||
from django.dispatch import receiver
|
||||
from django.urls import reverse
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.encoding import force_str
|
||||
from django.utils.html import format_html
|
||||
from django.utils.http import urlquote
|
||||
from django.utils.text import slugify
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from sorl.thumbnail import delete, get_thumbnail
|
||||
from sorl.thumbnail.conf import settings as thumbnail_settings
|
||||
|
||||
|
@ -87,7 +87,7 @@ class UserDocument(models.Model):
|
|||
|
||||
@property
|
||||
def filename_encoded(self):
|
||||
return urlquote(self.filename, safe='')
|
||||
return quote(self.filename, safe='')
|
||||
|
||||
def __str__(self):
|
||||
return self.title or self.filename
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import django_tables2 as tables
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from . import models
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ from django.urls import reverse, reverse_lazy
|
|||
from django.utils.decorators import method_decorator
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.http import quote
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.translation import gettext as _
|
||||
from django.views.decorators.cache import never_cache
|
||||
from django.views.decorators.clickjacking import xframe_options_exempt
|
||||
from django.views.generic import CreateView, DeleteView, TemplateView, UpdateView, View
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
{% block page-title %}Fargo{% endblock %}
|
||||
{% block site-title %}Fargo{% endblock %}
|
||||
{% block css %}
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" href="{% static "fargo/css/style.css" %}" />
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" href="{% static "fargo/css/style.css" %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block logout-url %}{% url "auth_logout" %}{% endblock %}
|
||||
|
|
|
@ -42,42 +42,42 @@
|
|||
</script>
|
||||
|
||||
<div class="cell">
|
||||
<h2>{% if site_title %}{{ site_title }}{% else %}{% trans "Portfolio" %}{% endif %}</h2>
|
||||
<div id="user-files">
|
||||
{% render_table table "fargo/table.html" %}
|
||||
<h2>{% if site_title %}{{ site_title }}{% else %}{% trans "Portfolio" %}{% endif %}</h2>
|
||||
<div id="user-files">
|
||||
{% render_table table "fargo/table.html" %}
|
||||
|
||||
{% if full %}
|
||||
<div class="infonotice">
|
||||
<p>
|
||||
{% blocktrans count max_documents_per_user=max_documents_per_user trimmed %}
|
||||
The limit of {{ max_documents_per_user }} document per user is reached.
|
||||
You cannot add any more documents.
|
||||
{% plural %}
|
||||
The limit of {{ max_documents_per_user }} documents per user is reached.
|
||||
You cannot add any more documents.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% if full %}
|
||||
<div class="infonotice">
|
||||
<p>
|
||||
{% blocktrans count max_documents_per_user=max_documents_per_user trimmed %}
|
||||
The limit of {{ max_documents_per_user }} document per user is reached.
|
||||
You cannot add any more documents.
|
||||
{% plural %}
|
||||
The limit of {{ max_documents_per_user }} documents per user is reached.
|
||||
You cannot add any more documents.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<form id="send-file" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{{ form.content.errors }}
|
||||
<div style="display: none">
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="submit" value="Upload">
|
||||
</div>
|
||||
<div class="invalid-file-error" style="display: none">
|
||||
<p>
|
||||
{% blocktrans with max_size_mb=max_document_size|filesizeformat %}
|
||||
Error: an uploaded document can't exceed {{ max_size_mb }}.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<p>{% trans "Please try again with a smaller document." %}</p>
|
||||
</div>
|
||||
<button>{% trans "Upload a new document" %}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<form id="send-file" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{{ form.content.errors }}
|
||||
<div style="display: none">
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="submit" value="Upload">
|
||||
</div>
|
||||
<div class="invalid-file-error" style="display: none">
|
||||
<p>
|
||||
{% blocktrans with max_size_mb=max_document_size|filesizeformat %}
|
||||
Error: an uploaded document can't exceed {{ max_size_mb }}.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<p>{% trans "Please try again with a smaller document." %}</p>
|
||||
</div>
|
||||
<button>{% trans "Upload a new document" %}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -5,20 +5,20 @@
|
|||
{% block bodyclasses %}fargo-popup fargo-pick-popup{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% render_table table "fargo/pick_table.html" %}
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{{ form.content.errors }}
|
||||
<div style="display: none">
|
||||
{% render_table table "fargo/pick_table.html" %}
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{{ form.content.errors }}
|
||||
<div style="display: none">
|
||||
{{ form.as_p }}
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('table').on('click', 'tbody tr', function() {
|
||||
$(this).find('form').submit();
|
||||
});
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('table').on('click', 'tbody tr', function() {
|
||||
$(this).find('form').submit();
|
||||
});
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
{% load django_tables2 i18n %}
|
||||
|
||||
{% block action-column %}
|
||||
<form method="post" action="{% url 'pick' pk=row.record.pk %}{% querystring %}">
|
||||
{% csrf_token %}
|
||||
<button class="pick-button">{% trans "Pick" %}</button>
|
||||
</form>
|
||||
<form method="post" action="{% url 'pick' pk=row.record.pk %}{% querystring %}">
|
||||
{% csrf_token %}
|
||||
<button class="pick-button">{% trans "Pick" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -24,40 +24,40 @@
|
|||
{% block table.tbody.row %}
|
||||
<tr class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }} {{row.record.css_classes}}"
|
||||
data-url="{{row.record.get_download_url}}"
|
||||
> {# avoid cycle for Django 1.2-1.6 compatibility #}
|
||||
> {# avoid cycle for Django 1.2-1.6 compatibility #}
|
||||
<td class="title">
|
||||
{{ row.record }}
|
||||
{{ row.record }}
|
||||
</td>
|
||||
{% for column, cell in row.items %}
|
||||
<td {{ column.attrs.td.as_html }}>{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}</td>
|
||||
{% endfor %}
|
||||
{% with thumbnail=row.record.thumbnail_image %}
|
||||
<td class="thumbnail desktop-only" rowspan={{ row.record.description|yesno:"2,1" }}>
|
||||
{% if thumbnail %}
|
||||
<img src="{{ thumbnail.src }}" height="{{ thumbnail.height }}" width="{{ thumbnail.width }}"/>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endwith %}
|
||||
{% with thumbnail=row.record.thumbnail_image %}
|
||||
<td class="thumbnail desktop-only" rowspan={{ row.record.description|yesno:"2,1" }}>
|
||||
{% if thumbnail %}
|
||||
<img src="{{ thumbnail.src }}" height="{{ thumbnail.height }}" width="{{ thumbnail.width }}"/>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endwith %}
|
||||
<td class="action-column" rowspan={{ row.record.description|yesno:"2,1" }}>
|
||||
{% block action-column %}
|
||||
{% if table.context.include_edit_link or include_edit_link %}<!-- dj11 compatibility -->
|
||||
<a class="icon-edit" rel="popup" data-selector="#edit-form" href="{% url 'edit' pk=row.record.pk %}"></a>
|
||||
{% endif %}
|
||||
{% if row.record.deletable_by_user %}
|
||||
<a class="icon-remove" rel="popup" data-selector="#delete-form" href="{% url 'delete' pk=row.record.pk %}"></a>
|
||||
{% endif %}
|
||||
{% if table.context.include_edit_link or include_edit_link %}<!-- dj11 compatibility -->
|
||||
<a class="icon-edit" rel="popup" data-selector="#edit-form" href="{% url 'edit' pk=row.record.pk %}"></a>
|
||||
{% endif %}
|
||||
{% if row.record.deletable_by_user %}
|
||||
<a class="icon-remove" rel="popup" data-selector="#delete-form" href="{% url 'delete' pk=row.record.pk %}"></a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
{% if row.record.description %}
|
||||
<tr class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }} description-row">
|
||||
<tr class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }} description-row">
|
||||
<td class="description" colspan={{table.columns|length|add:"1"}}>{{row.record.description}}</td>
|
||||
</tr>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endblock table.tbody.row %}
|
||||
|
||||
{% block table.tbody.empty_text %}
|
||||
<tr class="empty"><td colspan="{{ table.columns|length|add:3 }}">{{ table.empty_text }}</td></tr>
|
||||
<tr class="empty"><td colspan="{{ table.columns|length|add:3 }}">{{ table.empty_text }}</td></tr>
|
||||
{% endblock %}
|
||||
|
||||
{% block pagination.cardinality %}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post" id="delete-form">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
{% blocktrans %}Are you sure you want to delete "{{ object }}"?{% endblocktrans %}
|
||||
</p>
|
||||
<div class="buttons">
|
||||
<button class="delete-button">{% trans 'Delete' %}</button>
|
||||
<a class="cancel" href="{% url 'home' %}">{% trans 'Cancel' %}</a>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" id="delete-form">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
{% blocktrans %}Are you sure you want to delete "{{ object }}"?{% endblocktrans %}
|
||||
</p>
|
||||
<div class="buttons">
|
||||
<button class="delete-button">{% trans 'Delete' %}</button>
|
||||
<a class="cancel" href="{% url 'home' %}">{% trans 'Cancel' %}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<div id="appbar">
|
||||
<h2>{% trans "Edit" %}</h2>
|
||||
</div>
|
||||
|
||||
<form action="{% url 'edit' pk=object.pk %}" method="post" id="edit-form">
|
||||
{% csrf_token %}
|
||||
{{form.as_p}}
|
||||
<div class="buttons">
|
||||
<button class="submit-button">{% trans "Save" %}</button>
|
||||
<a class="cancel" href="{% url 'home' %}">{% trans 'Cancel' %}</a>
|
||||
<div id="appbar">
|
||||
<h2>{% trans "Edit" %}</h2>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form action="{% url 'edit' pk=object.pk %}" method="post" id="edit-form">
|
||||
{% csrf_token %}
|
||||
{{form.as_p}}
|
||||
<div class="buttons">
|
||||
<button class="submit-button">{% trans "Save" %}</button>
|
||||
<a class="cancel" href="{% url 'home' %}">{% trans 'Cancel' %}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{% block extra_head %}
|
||||
<link rel="stylesheet" type="text/css" media="all"
|
||||
href="{% xstatic 'jquery-ui' 'themes/smoothness/jquery-ui.min.css' %}"/>
|
||||
href="{% xstatic 'jquery-ui' 'themes/smoothness/jquery-ui.min.css' %}"/>
|
||||
<script src="{% xstatic 'jquery-ui' 'jquery-ui.min.js' %}"></script>
|
||||
<script src="{% static "fargo/js/datepicker-fr.js" %}"></script>
|
||||
<script src="{% static 'fargo/js/fargo.js' %}"></script>
|
||||
|
@ -12,15 +12,15 @@
|
|||
{% block bodyclasses %}fargo-popup fargo-pick-popup{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<div class="buttons">
|
||||
<button name="submit">{% trans "Validate" %}</button>
|
||||
<button name="cancel">{% trans "Cancel" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$('#id_start, #id_end').datepicker($.datepicker.regional["fr"]);
|
||||
</script>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<div class="buttons">
|
||||
<button name="submit">{% trans "Validate" %}</button>
|
||||
<button name="cancel">{% trans "Cancel" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$('#id_start, #id_end').datepicker($.datepicker.regional["fr"]);
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path, re_path
|
||||
|
||||
from .fargo.api_views import push_document, recent_documents
|
||||
from .fargo.views import (
|
||||
|
@ -36,30 +36,30 @@ from .fargo.views import (
|
|||
)
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', home, name='home'),
|
||||
url(r'^pick/$', pick_list, name='list_to_pick'),
|
||||
url(r'^jsonp/$', jsonp, name='jsonp'),
|
||||
url(r'^json/$', json, name='json'),
|
||||
url(r'^(?P<pk>\d+)/edit/$', edit, name='edit'),
|
||||
url(r'^(?P<pk>\d+)/delete/$', delete, name='delete'),
|
||||
url(r'^(?P<pk>\d+)/pick/$', pick, name='pick'),
|
||||
url(r'^(?P<pk>\d+)/download/(?P<filename>[^/]*)$', download, name='download'),
|
||||
url(r'^(?P<pk>\d+)/thumbnail/(?P<filename>[^/]*)$', thumbnail, name='thumbnail'),
|
||||
url(r'^upload/$', upload, name='upload'),
|
||||
url(r'^remote-download/(?P<filename>[^/]*)$', remote_download, name='remote_download'),
|
||||
url(r'^admin/', admin.site.urls),
|
||||
url(r'^login/$', login, name='auth_login'),
|
||||
url(r'^logout/$', logout, name='auth_logout'),
|
||||
url(r'^api/documents/push/$', push_document, name='fargo-api-push-document'),
|
||||
url(r'^api/documents/recently-added/$', recent_documents),
|
||||
path('', home, name='home'),
|
||||
path('pick/', pick_list, name='list_to_pick'),
|
||||
path('jsonp/', jsonp, name='jsonp'),
|
||||
path('json/', json, name='json'),
|
||||
path('<int:pk>/edit/', edit, name='edit'),
|
||||
path('<int:pk>/delete/', delete, name='delete'),
|
||||
path('<int:pk>/pick/', pick, name='pick'),
|
||||
re_path(r'^(?P<pk>\d+)/download/(?P<filename>[^/]*)$', download, name='download'),
|
||||
re_path(r'^(?P<pk>\d+)/thumbnail/(?P<filename>[^/]*)$', thumbnail, name='thumbnail'),
|
||||
path('upload/', upload, name='upload'),
|
||||
re_path(r'^remote-download/(?P<filename>[^/]*)$', remote_download, name='remote_download'),
|
||||
re_path(r'^admin/', admin.site.urls),
|
||||
path('login/', login, name='auth_login'),
|
||||
path('logout/', logout, name='auth_logout'),
|
||||
path('api/documents/push/', push_document, name='fargo-api-push-document'),
|
||||
path('api/documents/recently-added/', recent_documents),
|
||||
]
|
||||
|
||||
if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^__debug__/', include(debug_toolbar.urls)),
|
||||
path('__debug__/', include(debug_toolbar.urls)),
|
||||
] + urlpatterns
|
||||
|
||||
if 'mellon' in settings.INSTALLED_APPS:
|
||||
urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls')))
|
||||
urlpatterns.append(path('accounts/mellon/', include('mellon.urls')))
|
||||
|
|
Loading…
Reference in New Issue