Skip to content

Commit

Permalink
Move modelWidget to pyramid component
Browse files Browse the repository at this point in the history
  • Loading branch information
drnextgis committed Sep 19, 2016
1 parent 5c8b542 commit 3ed1d2b
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 25 deletions.
4 changes: 2 additions & 2 deletions nextgisweb/auth/amd/ngw-auth/GroupWidget.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*global define, ngwConfig*/
define([
"dojo/_base/declare",
"ngw/modelWidget/Widget",
"ngw/modelWidget/ErrorDisplayMixin",
"ngw-pyramid/modelWidget/Widget",
"ngw-pyramid/modelWidget/ErrorDisplayMixin",
"dijit/_TemplatedMixin",
"dijit/_WidgetsInTemplateMixin",
"ngw-pyramid/i18n!auth",
Expand Down
4 changes: 2 additions & 2 deletions nextgisweb/auth/amd/ngw-auth/UserWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
define([
"dojo/_base/declare",
"dojo/_base/lang",
"ngw/modelWidget/Widget",
"ngw/modelWidget/ErrorDisplayMixin",
"ngw-pyramid/modelWidget/Widget",
"ngw-pyramid/modelWidget/ErrorDisplayMixin",
"dijit/_TemplatedMixin",
"dijit/_WidgetsInTemplateMixin",
"ngw-pyramid/i18n!auth",
Expand Down
2 changes: 1 addition & 1 deletion nextgisweb/feature_description/amd/EditorWidget.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define([
"dojo/_base/declare",
"ngw/modelWidget/Widget",
"ngw-pyramid/modelWidget/Widget",
"ngw-pyramid/i18n!feature_description",
"dijit/Editor",
"dijit/_editor/plugins/LinkDialog"
Expand Down
34 changes: 23 additions & 11 deletions nextgisweb/locale/ru/LC_MESSAGES/pyramid.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: nextgisweb 0.0\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2016-05-28 19:33+0300\n"
"POT-Creation-Date: 2016-09-19 09:10+0700\n"
"PO-Revision-Date: 2015-09-13 16:08+0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: ru\n"
Expand All @@ -17,13 +17,13 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.2.0\n"
"Generated-By: Babel 2.3.4\n"

#: view.py:44 template/base.mako:78
#: template/base.mako:85 view.py:44
msgid "Control panel"
msgstr "Панель управления"

#: view.py:53 template/base.mako:89
#: template/base.mako:96 view.py:53
msgid "Help"
msgstr "Справка"

Expand All @@ -39,31 +39,43 @@ msgstr "Информация о системе"
msgid "Enter the correct scale value, e.g. 1:"
msgstr "Введите корректное значение масштаба, например 1:"

#: template/base.mako:22
#: amd/ngw-pyramid/modelWidget/FormMixin.js:35
msgid "Create"
msgstr "Создать"

#: amd/ngw-pyramid/modelWidget/FormMixin.js:37
msgid "Save"
msgstr "Сохранить"

#: amd/ngw-pyramid/modelWidget/FormMixin.js:39
msgid "Delete"
msgstr "Удалить"

#: template/base.mako:27
msgid "Your Web GIS at nextgis.com"
msgstr "Ваши карты онлайн на nextgis.com"

#: template/base.mako:76
#: template/base.mako:83
msgid "Resources"
msgstr "Ресурсы"

#: template/base.mako:95
#: template/base.mako:102
msgid "Sign in"
msgstr "Войти"

#: template/pkginfo.mako:6
#: template/pkginfo.mako:22
msgid "Platform"
msgstr "Платформа"

#: template/pkginfo.mako:9
#: template/pkginfo.mako:25
msgid "Packages"
msgstr "Пакеты"

#: template/pkginfo.mako:14
#: template/pkginfo.mako:31
msgid "Package"
msgstr "Пакет"

#: template/pkginfo.mako:15
#: template/pkginfo.mako:32
msgid "Version"
msgstr "Версия"

Expand Down
2 changes: 1 addition & 1 deletion nextgisweb/object_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def populate_obj(self):
s.populate_obj()

def widget_module(self):
return 'ngw/modelWidget/Composite'
return 'ngw-pyramid/modelWidget/Composite'

def widget_params(self):
result = ObjectWidget.widget_params(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ define([
"dojo/when",
"dojo/dom-construct",
"dijit/layout/ContentPane",
"dijit/form/Button"
"dijit/form/Button",
"ngw-pyramid/i18n!pyramid"
], function (
declare,
Deferred,
Expand All @@ -15,9 +16,10 @@ define([
when,
domConstruct,
ContentPane,
Button
Button,
i18n
) {
// Mixin превращающий ngw/modelWidget/Widget в форму редактирования
// Mixin превращающий ngw-pyramid/modelWidget/Widget в форму редактирования
// модели с соответствующими кнопками и реализующий функционал сохранения
// или добавления.

Expand All @@ -30,11 +32,11 @@ define([
widget = this;

if (params.operation == 'create') {
this.btn = new Button({label: "Создать", iconClass: "dijitIconNewTask"});
this.btn = new Button({label: i18n.gettext("Create"), iconClass: "dijitIconNewTask"});
} else if (params.operation == 'edit') {
this.btn = new Button({label: "Сохранить", iconClass: "dijitIconSave"});
this.btn = new Button({label: i18n.gettext("Save"), iconClass: "dijitIconSave"});
} else if (params.operation == 'delete') {
this.btn = new Button({label: "Удалить", iconClass: "dijitIconDelete"});
this.btn = new Button({label: i18n.gettext("Delete"), iconClass: "dijitIconDelete"});
};

this.btn.placeAt(this.buttonPane).on("click", function () { widget.submit() });
Expand Down
4 changes: 2 additions & 2 deletions nextgisweb/templates/model_widget.mako
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"dojo/_base/declare",
"dojo/ready",
${ widget.widget_module() | json.dumps, n },
"ngw/modelWidget/FormMixin",
"ngw/modelWidget/CompositeTitlePaneMixin"
"ngw-pyramid/modelWidget/FormMixin",
"ngw-pyramid/modelWidget/CompositeTitlePaneMixin"
], function (declare, ready, Base, FormMixin, CompositeTitlePaneMixin) {
var FormClass = declare([Base, FormMixin, CompositeTitlePaneMixin]);
form = new FormClass(formParams);
Expand Down

0 comments on commit 3ed1d2b

Please sign in to comment.