+ [%
+ FOREACH field IN [
+ 'uid',
+ 'fullName'
+ ];
+ element(field) IF model.${field};
+ END;
+ %]
+
+
+
+ [%
+ FOREACH field IN [
+ 'gecos',
+ 'mail',
+ 'telephoneNumber',
+ 'roomNumber',
+ 'departmentNumber'
+ ];
+ element(field) IF model.${field};
+ END;
+ %]
+
+
+[% IF showRoles %]
+
@@ -91,7 +94,4 @@
});
-[% END %]
-[% WRAPPER LAYOUT;
- render('base', content = content);
-END %]
\ No newline at end of file
+[% END %]
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/layout/dojo.tt
--- a/view/layout/dojo.tt Thu May 15 01:51:42 2014 +0400
+++ b/view/layout/dojo.tt Thu May 15 18:24:02 2014 +0400
@@ -1,15 +1,20 @@
-[%
- modules = document.dojo.modules.unique;
+[% IF document.dojo.enable || document.dojo.modules.size;
+ IF document.dojo.config.parseOnLoad;
+ document.dojo.modules.push('dojo/parser');
+ END;
+ mods = document.dojo.modules.unique;
style = document.dojo.style || 'tundra';
dojo.js = cdn.dojo.SetView('js').dojo.dojo;
dijit.css = cdn.dojo.dijit.themes.${style}.${style}.SetView('css');
dojo.css = cdn.dojo.dojo.resources.dojo.SetView('css');
- document.css.push(dojo.css);
- document.css.push(dijit.css);
+ document.class.push('tundra');
+
+ document.css.unshift(dojo.css);
+ document.css.unshift(dijit.css);
document.scripts.push({ text = 'dojoConfig = ' _ toJSON(document.dojo.config) _ ';' });
document.scripts.push({ src = dojo.js });
- IF modules.size;
- document.scripts.push({ text = "require(" _ toJSON(modules) _ ");"});
+ IF mods.size;
+ document.scripts.push({ text = "require(" _ toJSON(mods) _ ");"});
END;
-%]
\ No newline at end of file
+END %]
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/layout/init.tt
--- a/view/layout/init.tt Thu May 15 01:51:42 2014 +0400
+++ b/view/layout/init.tt Thu May 15 18:24:02 2014 +0400
@@ -9,4 +9,5 @@
]
}
};
+ document.postRender.push('dojo');
%]
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/index.tt
--- a/view/site/index.tt Thu May 15 01:51:42 2014 +0400
+++ b/view/site/index.tt Thu May 15 18:24:02 2014 +0400
@@ -1,15 +1,9 @@
[%
document.title = "HOME";
+ document.layout = 'index';
document.css.push(css.index);
%]
-
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user.tt Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,8 @@
+[%
+ render('user/pagemenu');
+ labels(
+ Title = 'User profile (%user%)'
+ );
+ document.title = Title(user = user.name);
+ display_model(model, showRoles = 1);
+%]
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/edit.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/edit.tt Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,19 @@
+[%
+ labels(
+ Title = 'Update profile',
+ BtnSubmit = 'Save'
+ );
+ document.title = Title;
+ render('pagemenu');
+ display_model(
+ result,
+ 'dojo/form',
+ layout = {
+ content = 'form/box',
+ args = {
+ title = Title,
+ buttons = [ { type='submit', text= BtnSubmit } ]
+ }
+ },
+ )
+%]
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/locale/ru/edit.s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/locale/ru/edit.s Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,2 @@
+Title = Редактирование профиля
+BtnSubmit = Сохранить
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/locale/ru/pagemenu.s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/locale/ru/pagemenu.s Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,3 @@
+ViewProfile = Профиль
+EditProfile = Обновить профиль
+ChangePass = Сменить пароль
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/locale/ru/passwd.s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/locale/ru/passwd.s Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,3 @@
+Title = Сменить пароль
+BtnSubmit = Сменить
+SuccessMessage = Пароль для пользователя %name% успешно изменен!
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/locale/ru/register.s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/locale/ru/register.s Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,2 @@
+Title = Регистрация
+BtnSubmit = Зарегистрироваться
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/login.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/login.tt Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,19 @@
+[%
+ labels(
+ Title = 'Login'
+ BtnSubmit = 'Login'
+ );
+ document.title = Title;
+
+ display_model(
+ result,
+ 'dojo/form',
+ layout = {
+ content = 'form/box',
+ args = {
+ title = Title
+ buttons = [ { type='submit', text= BtnSubmit } ],
+ }
+ }
+ );
+%]
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/pagemenu.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/pagemenu.tt Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,14 @@
+[%
+ labels(
+ ViewProfile = 'View profile'
+ EditProfile = 'Update profile'
+ ChangePass = 'Change password'
+ );
+ userLocation = resource.Seek('user').location;
+ document.menu.page = [
+ { title = ViewProfile, href = userLocation },
+ { title = EditProfile, href = userLocation.edit },
+ { title = ChangePass, href = userLocation.passwd }
+ ];
+
+%]
\ No newline at end of file
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/passwd.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/passwd.tt Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,29 @@
+[%
+ labels(
+ Title = 'Change password'
+ BtnSubmit = 'Change',
+ SuccessMessage = 'Пароль для пользователя %name% успешно изменен!'
+ );
+ document.title = Title;
+ render('pagemenu');
+
+ IF result.complete;
+%]
+
+ [% SuccessMessage(model) %]
+
+[%
+ ELSE;
+ display_model(
+ result,
+ 'dojo/form',
+ layout = {
+ content = 'form/box',
+ args = {
+ title = Title,
+ buttons = [ { type = 'submit', text = BtnSubmit } ]
+ }
+ }
+ );
+ END;
+%]
diff -r 83ad674a8cdd -r 573272ec604b view/site/user/register.tt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/site/user/register.tt Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,20 @@
+[%
+ labels(
+ Title = 'Register'
+ BtnSubmit = 'Register'
+ );
+ document.title = Title;
+ display_model(
+ result,
+ 'dojo/form',
+ layout = {
+ content = 'form/box',
+ args = {
+ title = Title,
+ buttons = [
+ { type = 'submit', text = BtnSubmit }
+ ]
+ }
+ }
+ );
+%]
\ No newline at end of file