Commit 31278b32 authored by Patrick's avatar Patrick

i18n javascript in admin : lock - unlock purchases

parent b5cfc84b
......@@ -4,8 +4,7 @@ from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# admin.autodiscover
from django.views.i18n import JavaScriptCatalog
urlpatterns = i18n_patterns(
url(r'^repanier/', include('repanier.urls')),
......@@ -13,6 +12,7 @@ urlpatterns = i18n_patterns(
# url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': {'cmspages': CMSSitemap}}),
url(r'^sitemap\.xml$', sitemap, {'sitemaps': {'cmspages': CMSSitemap}},
name='django.contrib.sitemaps.views.sitemap'),
url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
url(r'^', include('cms.urls')),
)
......
......@@ -13,6 +13,7 @@ from django.http import HttpResponseRedirect
from django.utils import translation
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from django.views.i18n import JavaScriptCatalog
from easy_select2 import Select2
from import_export import resources, fields
from import_export.admin import ExportMixin
......@@ -156,6 +157,7 @@ class PurchaseAdmin(ExportMixin, admin.ModelAdmin):
list_display_links = ('offer_item',)
search_fields = ('offer_item__translations__long_name',)
actions = []
change_list_template = 'admin/purchase_change_list.html'
def __init__(self, model, admin_site):
super(PurchaseAdmin, self).__init__(model, admin_site)
......@@ -217,6 +219,8 @@ class PurchaseAdmin(ExportMixin, admin.ModelAdmin):
my_urls = [
url(r'^is_order_confirm_send/$', self.is_order_confirm_send),
url(r'^is_order_confirm_not_send/$', self.is_order_confirm_not_send),
# url(r'^jsi18n/$', JavaScriptCatalog.as_view(), {'packages': ('repanier',)}, name='javascript-catalog'),
# url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
]
return my_urls + urls
......
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: repanier\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-08 02:19+0100\n"
"PO-Revision-Date: 2017-03-08 20:19+0100\n"
"Last-Translator: Patrick Colmant <pcolmant@gmail.com>\n"
"Language-Team: Patrick Colmant <pcolmant@gmail.com>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 1.7.1\n"
#: static/js/is_order_confirm_send.js:4
msgid "✗🔓"
msgstr "✗🔓 - déverrouiller"
#: static/js/is_order_confirm_send.js:5
msgid "✓🔐"
msgstr "✓🔐 - confirmer et vérrouiller"
(function($) {
$(document).ready(function($) {
if(location.pathname.indexOf('change') <= -1) {
$(".object-tools").append('<li><a href="./is_order_confirm_not_send/' + location.search + '">&nbsp;&nbsp;✗🔓&nbsp;&nbsp;</a></li>');
$(".object-tools").append('<li><a href="./is_order_confirm_send/' + location.search + '">&nbsp;&nbsp;✓🔐&nbsp;&nbsp;</a></li>');
$(".object-tools").append('<li><a href="./is_order_confirm_not_send/' + location.search + '">&nbsp;&nbsp;' + gettext('✗🔓')+ '&nbsp;&nbsp;</a></li>');
$(".object-tools").append('<li><a href="./is_order_confirm_send/' + location.search + '">&nbsp;&nbsp;' + gettext('✓🔐')+ '&nbsp;&nbsp;</a></li>');
}
// $(".object-tools").append('<li><a href="./is_order_confirm_send/' + location.search + '" class="addlink">&nbsp;&nbsp;🔐&nbsp;&nbsp;</a></li>');
});
})(django.jQuery);
{% extends "admin/change_list.html" %}
{% block extrahead %}
{{ block.super }}
<script type="text/javascript" src="../../../jsi18n"></script>
{% endblock %}
......@@ -124,10 +124,10 @@ urlpatterns = [
url(r'^who/$', who_is_who_view, name='who_is_who_view'),
url(r'^me/$', me_view, name='me_view'),
url(r'^rest/permanences/$', permanences_rest, name='permanences_rest'),
url(r'^rest/permanence/(?P<permanence_id>\d+)/(?P<short_profile_name>.*)/(?P<reference>.*)/$',
url(r'^rest/permanence/(?P<permanence_id>\d+)/(?P<producer_name>.*)/(?P<reference>.*)/$',
permanence_producer_product_rest,
name='permanence_producer_product_rest'),
url(r'^rest/permanence/(?P<permanence_id>\d+)/(?P<short_profile_name>.*)/$', permanence_producer_rest,
url(r'^rest/permanence/(?P<permanence_id>\d+)/(?P<producer_name>.*)/$', permanence_producer_rest,
name='permanence_producer_rest'),
url(r'^rest/departments-for-customers/$', departments_for_customers_rest, name='departments_for_customers_rest'),
url(r'^rest/department-for-customer/(?P<short_name>.*)/$', department_for_customer_rest,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment