Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
chris
repanier
Commits
31278b32
Commit
31278b32
authored
Mar 08, 2017
by
Patrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i18n javascript in admin : lock - unlock purchases
parent
b5cfc84b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
7 deletions
+43
-7
mysite/urls.py
mysite/urls.py
+2
-2
repanier/admin/purchase.py
repanier/admin/purchase.py
+4
-0
repanier/locale/fr/LC_MESSAGES/djangojs.mo
repanier/locale/fr/LC_MESSAGES/djangojs.mo
+0
-0
repanier/locale/fr/LC_MESSAGES/djangojs.po
repanier/locale/fr/LC_MESSAGES/djangojs.po
+27
-0
repanier/static/js/is_order_confirm_send.js
repanier/static/js/is_order_confirm_send.js
+2
-3
repanier/templates/admin/purchase_change_list.html
repanier/templates/admin/purchase_change_list.html
+6
-0
repanier/urls.py
repanier/urls.py
+2
-2
No files found.
mysite/urls.py
View file @
31278b32
...
...
@@ -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'
)),
)
...
...
repanier/admin/purchase.py
View file @
31278b32
...
...
@@ -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
...
...
repanier/locale/fr/LC_MESSAGES/djangojs.mo
0 → 100644
View file @
31278b32
File added
repanier/locale/fr/LC_MESSAGES/djangojs.po
0 → 100644
View file @
31278b32
# 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"
repanier/static/js/is_order_confirm_send.js
View file @
31278b32
(
function
(
$
)
{
$
(
document
).
ready
(
function
(
$
)
{
if
(
location
.
pathname
.
indexOf
(
'
change
'
)
<=
-
1
)
{
$
(
"
.object-tools
"
).
append
(
'
<li><a href="./is_order_confirm_not_send/
'
+
location
.
search
+
'
">
✗🔓
</a></li>
'
);
$
(
"
.object-tools
"
).
append
(
'
<li><a href="./is_order_confirm_send/
'
+
location
.
search
+
'
">
✓🔐
</a></li>
'
);
$
(
"
.object-tools
"
).
append
(
'
<li><a href="./is_order_confirm_not_send/
'
+
location
.
search
+
'
">
'
+
gettext
(
'
✗🔓
'
)
+
'
</a></li>
'
);
$
(
"
.object-tools
"
).
append
(
'
<li><a href="./is_order_confirm_send/
'
+
location
.
search
+
'
">
'
+
gettext
(
'
✓🔐
'
)
+
'
</a></li>
'
);
}
// $(".object-tools").append('<li><a href="./is_order_confirm_send/' + location.search + '" class="addlink"> 🔐 </a></li>');
});
})(
django
.
jQuery
);
repanier/templates/admin/purchase_change_list.html
0 → 100644
View file @
31278b32
{% extends "admin/change_list.html" %}
{% block extrahead %}
{{ block.super }}
<script
type=
"text/javascript"
src=
"../../../jsi18n"
></script>
{% endblock %}
repanier/urls.py
View file @
31278b32
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
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