diff --git a/web/js/actions.js b/web/js/actions.js
index 45a0ac9e..ee990d6a 100644
--- a/web/js/actions.js
+++ b/web/js/actions.js
@@ -1,3 +1,26 @@
+App.Actions.authorize = function()
+{
+ if ($('#authorize-form').length > 0) {
+ return;
+ }
+
+ App.View.popup('login');
+}
+
+App.Actions.do_authorise = function()
+{
+ $('#authorize-error').text('');
+ App.Ajax.request('MAIN.signin', {'login':$('#authorize-login').val(), 'password':$('#authorize-login'.val())}, function(reply)
+ {
+ if (reply.result) {
+ location.href = '';
+ }
+ else {
+ $('#authorize-error').text(reply.message);
+ }
+ });
+}
+
App.Actions.delete_entry = function(evt)
{
var confirmed = confirm(App.i18n.getMessage('confirm'));
@@ -351,3 +374,14 @@ App.Actions.view_template_info = function(evt)
}
});
}
+
+App.Actions.toggle_stats_block = function(evt)
+{
+ var elm = $(evt.target);
+ if (!!elm.attr('checked')) {
+ elm.parents('.stats-settings').find('.stats-block').removeClass('hidden');
+ }
+ else {
+ elm.parents('.stats-settings').find('.stats-block').addClass('hidden');
+ }
+}
diff --git a/web/js/app.js b/web/js/app.js
index 21d791d6..1fe4768c 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -191,8 +191,9 @@ App.Ajax.request = function(jedi_method, data, callback)
reply = jsonParse(reply);
if (reply.result == 'NOT_AUTHORISED') {
-
- return alert('NOT AUTH');
+ $('#content').html('
Not Authorized ');
+ App.Helpers.afterAjax();
+ return App.Actions.authorize();
}
//timer.start();
diff --git a/web/js/html.js b/web/js/html.js
index f01220d9..0288094f 100644
--- a/web/js/html.js
+++ b/web/js/html.js
@@ -296,6 +296,13 @@ App.HTML.Build.web_domain_entry = function(o, key)
}
tpl.set(':SUSPENDED_TPL', sub_tpl.finalize());
+ if (o.STATS_LOGIN.trim() != '') {
+ tpl.set(':STATS_AUTH', '+auth');
+ }
+ else {
+ tpl.set(':STATS_AUTH', '');
+ }
+
return tpl.finalize();
}
@@ -304,6 +311,12 @@ App.HTML.Build.web_domain_form = function(options, id)
if('undefined' == typeof App.Env.initialParams) {
return alert('PLease wait a bit. Some background processes are not yet executed. Thank you for patience.');
}
+
+ var in_edit = false;
+ if (!App.Helpers.isEmpty(options)) {
+ in_edit = true;
+ }
+
var tpl = App.Templates.get('FORM', 'web_domain');
tpl.set(':source', options);
tpl.set(':id', id || '');
@@ -318,10 +331,32 @@ App.HTML.Build.web_domain_form = function(options, id)
}
options = !App.Helpers.isEmpty(options) ? options : App.Empty.WEB_DOMAIN;
-
+ if (in_edit == true) {
+ options.STATS_PASSWORD = options.STATS_LOGIN.trim() != '' ? App.Settings.PASSWORD_IMMUTE : '';
+ }
tpl = App.HTML.setTplKeys(tpl, options, true);
tpl = App.HTML.Build.web_domain_selects(tpl, options);
+ if (options.CGI == 'yes') {
+ tpl.set(':CHECKED_CGI', 'checked="checked"');
+ }
+
+ if (options.ELOG == 'yes') {
+ tpl.set(':CHECKED_ELOG', 'checked="checked"');
+ }
+
+ if (options.STATS_LOGIN.trim() != '') {
+ tpl.set(':STAT_AUTH', 'checked="checked"');
+ tpl.set(':ACTIVE_LOGIN', '');
+ tpl.set(':ACTIVE_PASSWORD', '');
+ tpl.set(':stats_auth_checked', 'checked="checked"');
+ }
+ else {
+ tpl.set(':ACTIVE_LOGIN', 'hidden');
+ tpl.set(':ACTIVE_PASSWORD', 'hidden');
+ tpl.set(':stats_auth_checked', '');
+ }
+
return tpl.finalize();
}
@@ -601,6 +636,14 @@ App.HTML.Build.web_domain_selects = function(tpl, options)
var obj = App.Env.initialParams.WEB_DOMAIN.TPL;
var opts = App.HTML.Build.options(obj, options.TPL);
tpl.set(':TPL_OPTIONS', opts);
+
+ // TPL
+ var obj = App.Env.initialParams.WEB_DOMAIN.STAT;
+ var opts = App.HTML.Build.options(obj, options.STAT);
+ tpl.set(':STAT_OPTIONS', opts);
+
+
+ // \
}
catch (e) {
return tpl;
diff --git a/web/js/templates.js b/web/js/templates.js
index b2d4dd02..705512b2 100644
--- a/web/js/templates.js
+++ b/web/js/templates.js
@@ -35,7 +35,8 @@ App.Templates.html = {
SUSPENDED_TPL_SUSPENDED : ['suspended ']
},
popup: {
- error: ['Important: An Error Has Occured. Something went wrong and some of your actions can be not saved in system. Mostly, it happens when you have network connection errors.
, However, please notify us about the situation. It would be helpfull if you will write us approximate time the error occured and last actions you were performing. You send your petition on
this email: BLABLA ,
Sorry for inconvinience. (We recommend you to reload the page) ']
+ error: ['Important: An Error Has Occured. Something went wrong and some of your actions can be not saved in system. Mostly, it happens when you have network connection errors.
, However, please notify us about the situation. It would be helpfull if you will write us approximate time the error occured and last actions you were performing. You send your petition on
this email: BLABLA ,
Sorry for inconvinience. (We recommend you to reload the page) '],
+ login: ['']
},
dates: {
'lock_plan_date' : ['Lock plan dates Lock plan dates '],
@@ -511,13 +512,11 @@ App.Templates.html = {
\
\
\
- \
- CGI: \
- \
-
\
-