NS = Name Server. Closes #20

This commit is contained in:
Malishev Dmitry 2012-01-10 12:22:32 +03:00
parent 401c7851ea
commit c8c8e90435
3 changed files with 9 additions and 9 deletions

View file

@ -561,7 +561,7 @@ App.Actions.add_form_ns = function(evt)
var tpl = App.Templates.get('NS_INPUT', 'user'); var tpl = App.Templates.get('NS_INPUT', 'user');
tpl.set(':NAME', ''); tpl.set(':NAME', '');
tpl.set(':NS_LABEL', 'NS'); tpl.set(':NS_LABEL', 'Name Server');
var ref = $(elm).hasClass('form-row') ? elm : $(elm).parents('.form-row'); var ref = $(elm).hasClass('form-row') ? elm : $(elm).parents('.form-row');
$(ref).before(tpl.finalize()); $(ref).before(tpl.finalize());
@ -571,7 +571,7 @@ App.Actions.add_form_ns = function(evt)
$(form).find('.ns-entry').each(function(i, o) $(form).find('.ns-entry').each(function(i, o)
{ {
$(o).find('label').text('NS #' + (i + 1)); $(o).find('label').text('Name Server #' + (i + 1));
$(o).find('input').attr('name', 'NS' + (i + 1)); $(o).find('input').attr('name', 'NS' + (i + 1));
}); });
} }
@ -587,7 +587,7 @@ App.Actions.delete_ns = function(evt)
form = elm.parents('.form:first'); form = elm.parents('.form:first');
var total_nses = $(form).find('.ns-entry').length; var total_nses = $(form).find('.ns-entry').length;
if (total_nses == App.Settings.NS_MIN) { if (total_nses == App.Settings.NS_MIN) {
return App.Helpers.alert('Minimum number of NS is ' + App.Settings.NS_MIN); return App.Helpers.alert('Minimum number of Name Servers is ' + App.Settings.NS_MIN);
} }
var form = elm.parents('.form:first'); var form = elm.parents('.form:first');
@ -596,7 +596,7 @@ App.Actions.delete_ns = function(evt)
$(form).find('.ns-entry').each(function(i, o) $(form).find('.ns-entry').each(function(i, o)
{ {
$(o).find('label').text('NS #' + (i + 1)); $(o).find('label').text('Name Server #' + (i + 1));
$(o).find('input').attr('name', 'NS' + (i + 1)); $(o).find('input').attr('name', 'NS' + (i + 1));
}); });
} }
@ -604,7 +604,7 @@ App.Actions.delete_ns = function(evt)
App.Actions.view_full_ns_list = function(evt) App.Actions.view_full_ns_list = function(evt)
{ {
var elm = $(evt.target); var elm = $(evt.target);
App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'NS list'); App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html(), 'Name Server list');
} }
App.Actions.view_template_info = function(evt) App.Actions.view_template_info = function(evt)

View file

@ -101,7 +101,7 @@ App.HTML.Build.user_form = function (options, id) {
$([3, 4, 5, 6, 7, 8]).each(function (i, index) { $([3, 4, 5, 6, 7, 8]).each(function (i, index) {
if (options['NS' + index].trim() != '') { if (options['NS' + index].trim() != '') {
var tpl_ns = App.Templates.get('NS_INPUT', 'user'); var tpl_ns = App.Templates.get('NS_INPUT', 'user');
tpl_ns.set(':NS_LABEL', 'NS #' + (index)); tpl_ns.set(':NS_LABEL', 'Name Server #' + (index));
tpl_ns.set(':NAME', options['NS' + index]); tpl_ns.set(':NAME', options['NS' + index]);
ns[ns.length++] = tpl_ns.finalize(); ns[ns.length++] = tpl_ns.finalize();
} }

View file

@ -378,7 +378,7 @@ App.Templates.html = {
PLUS_ONE_NS: ['<div class="form-row cc do_action_add_form_ns additional-ns-add">\ PLUS_ONE_NS: ['<div class="form-row cc do_action_add_form_ns additional-ns-add">\
<a href="javascript:void(0);" class="add-ns do_action_add_form_ns">\ <a href="javascript:void(0);" class="add-ns do_action_add_form_ns">\
<i class="icon do_action_add_form_ns">&nbsp;</i>\ <i class="icon do_action_add_form_ns">&nbsp;</i>\
<span class="btn-title do_action_add_form_ns">Add additional NS</span>\ <span class="btn-title do_action_add_form_ns">Add additional Name Server</span>\
</a>\ </a>\
</div>'], </div>'],
ENTRIES_WRAPPER: ['<div class="users-list items-list">~!:content~!</div>'], ENTRIES_WRAPPER: ['<div class="users-list items-list">~!:content~!</div>'],
@ -432,11 +432,11 @@ App.Templates.html = {
<input type="text" name="LNAME" class="text-field rule-abc rule-required" value="~!:LNAME~!">\ <input type="text" name="LNAME" class="text-field rule-abc rule-required" value="~!:LNAME~!">\
</div>\ </div>\
<div class="form-row ns-entry cc">\ <div class="form-row ns-entry cc">\
<label for="#" class="field-label">NameServer #1:</label>\ <label for="#" class="field-label">Name Server #1:</label>\
<input type="text" value="~!:NS1~!" name="NS1" class="text-field rule-required rule-ns">\ <input type="text" value="~!:NS1~!" name="NS1" class="text-field rule-required rule-ns">\
</div>\ </div>\
<div class="form-row ns-entry cc">\ <div class="form-row ns-entry cc">\
<label for="#" class="field-label">NameServer #2:</label>\ <label for="#" class="field-label">Name Server #2:</label>\
<input type="text" value="~!:NS2~!" name="NS2" class="text-field rule-required rule-ns">\ <input type="text" value="~!:NS2~!" name="NS2" class="text-field rule-required rule-ns">\
</div>\ </div>\
~!:NS~!\ ~!:NS~!\