From 2a6e6ab6885fbec42307d857dd7c52b4b91448e8 Mon Sep 17 00:00:00 2001 From: Malishev Dmitry Date: Mon, 9 Jan 2012 18:41:56 +0300 Subject: [PATCH] Delete button removed from "new" forms. Closes #26 --- web/js/html.js | 12 +++++ web/js/templates.js | 124 ++++++++++++++++++++++++-------------------- 2 files changed, 79 insertions(+), 57 deletions(-) diff --git a/web/js/html.js b/web/js/html.js index b09e4946..042cfdd5 100644 --- a/web/js/html.js +++ b/web/js/html.js @@ -29,9 +29,11 @@ App.HTML.Build.dns_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New dns domain'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit dns domain'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } tpl.set(':id', id || ''); tpl.set(':DNS_DOMAIN', options.DNS_DOMAIN || ''); @@ -55,9 +57,11 @@ App.HTML.Build.ip_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New ip address'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit ip address'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } tpl.set(':id', id || ''); tpl.set(':IP_ADDRESS', options.IP_ADDRESS || ''); @@ -84,9 +88,11 @@ App.HTML.Build.user_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New user'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit user'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : App.Empty.USER; if (in_edit == true) { @@ -135,9 +141,11 @@ App.HTML.Build.web_domain_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New WEB domain'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit WEB domain'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : App.Empty.WEB_DOMAIN; if (in_edit == true) { @@ -180,9 +188,11 @@ App.HTML.Build.db_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New database'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit database "' + options.DB + '"'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : App.Empty.DB; if (in_edit == true) { @@ -206,9 +216,11 @@ App.HTML.Build.cron_form = function (options, id) { if (App.Helpers.isEmpty(options)) { tpl.set(':title', 'New cron job'); tpl.set(':save_button', 'ADD'); + tpl.set(':DELETE_ACTION', ''); } else { tpl.set(':title', 'Edit cron job'); tpl.set(':save_button', 'SAVE'); + tpl.set(':DELETE_ACTION', App.Templates.get('DELETE_ACTION', 'general').finalize()); } options = !App.Helpers.isEmpty(options) ? options : { DAY: '', diff --git a/web/js/templates.js b/web/js/templates.js index bbe42a13..625b1e7a 100644 --- a/web/js/templates.js +++ b/web/js/templates.js @@ -35,7 +35,8 @@ App.Templates.html = { select_option: [''], error_elm: ['
~!:ERROR~!
'], SUSPENDED_TPL_NOT_SUSPENDED : ['enabled'], - SUSPENDED_TPL_SUSPENDED : ['suspended'] + SUSPENDED_TPL_SUSPENDED : ['suspended'], + DELETE_ACTION: ['Delete'] }, 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)
'], @@ -158,7 +159,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\ ' ], @@ -292,7 +293,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\ \ '], @@ -319,14 +320,14 @@ App.Templates.html = { netmask:\ ~!:NETMASK~!\ \ - \ - interface:\ - ~!:INTERFACE~!\ - \ \ name:\ ~!:NAME~!\ \ + \ + interface:\ + ~!:INTERFACE~!\ + \ \
\ \ @@ -340,7 +341,7 @@ App.Templates.html = {
\
\ \ - sys users:\ + users:\ ~!:U_SYS_USERS~!\ \ \ @@ -446,7 +447,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\
'], ENTRY: ['
\ @@ -469,19 +470,13 @@ App.Templates.html = { ~!:LOGIN_NAME~!\ \ \ - \ - package:\ - ~!:PACKAGE~!\ - \ -
\ + \ + ~!:FULLNAME~!\ + \ \
\ \ - \ - name:\ - ~!:FULLNAME~!\ - \ \ email:\ \ @@ -489,6 +484,10 @@ App.Templates.html = { (reports ~!:REPORTS_ENABLED~!)\ \ \ + \ + package:\ + ~!:PACKAGE~!\ + \
\ \ \ @@ -526,6 +525,10 @@ App.Templates.html = { \ \
\ + \ + web domains:\ + ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!)\ + \ \ web ssl:\ ~!:U_WEB_SSL~! (~!:WEB_SSL~!)\ @@ -544,6 +547,37 @@ App.Templates.html = { databases:\ ~!:U_DATABASES~! (~!:DATABASES~!)\ \ + \ + Dedicated IP\'s:\ + ~!:IP_OWNED~!\ + \ + \ + cron jobs:\ + ~!:U_CRON_JOBS~!\ + \ +
\ +
\ + \ + mail domains:\ + ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!)\ + \ + \ + mail accounts:\ + ~!:MAIL_BOXES~! per domain\ + \ + \ + mail forwarders:\ + ~!:MAIL_FORWARDERS~! per domain\ + \ + \ + dns domains:\ + ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!)\ + \ + \ + name servers:\ + \ + ~!:NS~!\ + \ \ shell:\ ~!:SHELL~!\ @@ -551,35 +585,7 @@ App.Templates.html = { \ backups:\ retention ~!:BACKUPS~!\ - \ -
\ -
\ - \ - mailboxes:\ - ~!:U_MAIL_BOXES~! (~!:MAIL_BOXES~!)\ - \ - \ - mail forwarders:\ - ~!:U_MAIL_FORWARDERS~! (~!:MAIL_FORWARDERS~!)\ - \ - \ - mail domains:\ - ~!:U_MAIL_DOMAINS~! (~!:MAIL_DOMAINS~!)\ - \ - \ - web domains:\ - ~!:U_WEB_DOMAINS~! (~!:WEB_DOMAINS~!)\ - \ - \ - dns domains:\ - ~!:U_DNS_DOMAINS~! (~!:DNS_DOMAINS~!)\ - \ - \ - ns list:\ - \ - ~!:NS~!\ - \ -
\ + \ \ \ '] }, @@ -653,23 +659,28 @@ App.Templates.html = { Generate\ \ \ - \ + \
\ \ \
\ +
\ + \ + ...\ + \ +
\
\ \ ...\ \
\
\ - \ - ...\ - \ + \ + ...\ + \
\ \ \ @@ -702,7 +713,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\ '], ENTRIES_WRAPPER: ['
~!:content~!
'], @@ -721,7 +732,6 @@ App.Templates.html = {
\
\ ~!:DOMAIN~!\ - Alias:\ ~!:ALIAS~!\
\
\ @@ -829,7 +839,7 @@ App.Templates.html = {
\
\
\ - \ + \ \
\
\ @@ -849,7 +859,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\
'], ENTRY: ['
\ @@ -959,7 +969,7 @@ App.Templates.html = {
\ \ Cancel\ - Delete\ + ~!:DELETE_ACTION~!\
\
'], ENTRIES_WRAPPER: ['
~!:content~!
'],