11App . HTML . setTplKeys = function ( tpl , o , empty )
22{
3- var empty = empty || '- ' ;
3+ var empty = empty || '' ;
44 fb . log ( empty ) ;
55 tpl . set ( ':source' , $ . toJSON ( o ) . replace ( / ' / gi, "\\'" ) )
66 $ ( o ) . each ( function ( i , object )
@@ -12,7 +12,7 @@ App.HTML.setTplKeys = function(tpl, o, empty)
1212 tpl . set ( ':' + key , val || '' ) ;
1313 }
1414 else {
15- tpl . set ( ':' + key , val || '- ' ) ;
15+ tpl . set ( ':' + key , val || '' ) ;
1616 }
1717 } ) ;
1818 } ) ;
@@ -138,14 +138,14 @@ App.HTML.Build.ip_entry = function(o)
138138 var tpl = App . Templates . get ( 'ENTRY' , 'ip' ) ;
139139 tpl = App . HTML . setTplKeys ( tpl , o ) ;
140140
141- if ( App . Constants . SUSPENDED_YES == o . SUSPENDED ) {
141+ /* if (App.Constants.SUSPENDED_YES == o.SUSPENDED) {
142142 var sub_tpl = App.Templates.get('SUSPENDED_TPL_ENABLED', 'ip');
143143 }
144144 else {
145145 var sub_tpl = App.Templates.get('SUSPENDED_TPL_DISABLED', 'ip');
146- }
146+ }*/
147147
148- tpl . set ( ':SUSPENDED_TPL' , sub_tpl . finalize ( ) ) ;
148+ tpl . set ( ':SUSPENDED_TPL' , '' ) ;
149149
150150 return tpl . finalize ( ) ;
151151}
@@ -163,14 +163,14 @@ App.HTML.Build.dns_entry = function(o, is_new)
163163 tpl . set ( ':DATE' , now . format ( "d.mm.yyyy" ) ) ;
164164 }
165165
166- if ( App . Constants . SUSPENDED_YES == o . SUSPEND ) {
166+ /* if (App.Constants.SUSPENDED_YES == o.SUSPEND) {
167167 var sub_tpl = App.Templates.get('SUSPENDED_TPL_NOT_SUSPENDED', 'general');
168168 }
169169 else {
170170 var sub_tpl = App.Templates.get('SUSPENDED_TPL_SUSPENDED', 'general');
171- }
171+ }*/
172172
173- tpl . set ( ':SUSPENDED_TPL' , sub_tpl . finalize ( ) ) ;
173+ tpl . set ( ':SUSPENDED_TPL' , '' ) ;
174174
175175 return tpl . finalize ( ) ;
176176}
@@ -190,13 +190,41 @@ App.HTML.Build.user_entry = function(o, key)
190190 var tpl = App . Templates . get ( 'ENTRY' , 'user' ) ;
191191 tpl = App . HTML . setTplKeys ( tpl , o ) ;
192192
193- if ( App . Constants . SUSPENDED_YES == o . SUSPENDED ) {
193+ /* if (App.Constants.SUSPENDED_YES == o.SUSPENDED) {
194194 var sub_tpl = App.Templates.get('SUSPENDED_TPL_SUSPENDED', 'general');
195195 }
196196 else {
197197 var sub_tpl = App.Templates.get('SUSPENDED_TPL_NOT_SUSPENDED', 'general');
198+ }*/
199+ tpl . set ( ':SUSPENDED_TPL' , '' ) ; //sub_tpl.finalize());
200+
201+ var ns = [ ] ;
202+ var ns_full = [ ] ;
203+ fb . info ( o ) ;
204+ $ ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ) . each ( function ( i , index )
205+ {
206+ if ( o [ 'NS' + index ] . trim ( ) != '' ) {
207+ var tpl_ns = App . Templates . get ( 'NS_RECORD' , 'user' ) ;
208+ tpl_ns . set ( ':NAME' , o [ 'NS' + index ] ) ;
209+ var tpl_finalized = tpl_ns . finalize ( ) ;
210+ ns_full [ ns_full . length ++ ] = tpl_finalized ;
211+ if ( i < App . Settings . USER_VISIBLE_NS ) {
212+ ns [ ns . length ++ ] = tpl_finalized ;
213+ }
214+ }
215+ } ) ;
216+
217+ if ( ns_full . length <= App . Settings . USER_VISIBLE_NS ) {
218+ tpl . set ( ':NS' , ns . done ( ) ) ;
219+ }
220+ else {
221+ var ns_custom = App . Templates . get ( 'NS_MINIMIZED' , 'user' ) ;
222+ ns_custom . set ( ':NS_MINI' , ns . done ( ) ) ;
223+ ns_custom . set ( ':NS_FULL' , ns_full . done ( ) ) ;
224+ ns_custom . set ( ':MORE_NUMBER' , Math . abs ( App . Settings . USER_VISIBLE_NS - ns_full . length ) ) ;
225+ tpl . set ( ':NS' , ns_custom . finalize ( ) ) ;
198226 }
199- tpl . set ( ':SUSPENDED_TPL' , sub_tpl . finalize ( ) ) ;
227+
200228
201229 return tpl . finalize ( ) ;
202230}
@@ -220,7 +248,22 @@ App.HTML.Build.user_form = function(options, id)
220248 tpl . set ( ':save_button' , 'SAVE' ) ;
221249 }
222250
223- options = ! App . Helpers . isEmpty ( options ) ? options : { 'CONTACT' :'' , 'PASSWORD' :'' , 'LOGIN_NAME' :'' , 'LNAME' :'' , 'FNAME' :'' } ;
251+ options = ! App . Helpers . isEmpty ( options ) ? options : App . Empty . USER ;
252+
253+ // NS
254+ var ns = [ ] ;
255+ $ ( [ 3 , 4 , 5 , 6 , 7 , 8 ] ) . each ( function ( i , index )
256+ { fb . warn ( options ) ;
257+ if ( options [ 'NS' + index ] . trim ( ) != '' ) {
258+ var tpl_ns = App . Templates . get ( 'NS_INPUT' , 'user' ) ;
259+ tpl_ns . set ( ':NS_LABEL' , 'NS #' + ( index ) ) ;
260+ tpl_ns . set ( ':NAME' , options [ 'NS' + index ] ) ;
261+ ns [ ns . length ++ ] = tpl_ns . finalize ( ) ;
262+ }
263+ } ) ;
264+ ns [ ns . length ++ ] = App . Templates . get ( 'PLUS_ONE_NS' , 'user' ) . finalize ( ) ;
265+
266+ tpl . set ( ':NS' , ns . done ( ) ) ;
224267
225268 tpl = App . HTML . setTplKeys ( tpl , options , true ) ;
226269 tpl = App . HTML . Build . user_selects ( tpl , options ) ;
@@ -491,7 +534,7 @@ App.HTML.Build.db_selects = function(tpl, options)
491534App . HTML . Build . ip_selects = function ( tpl , options )
492535{
493536 // OWNER
494- var users = App . Env . initialParams . IP . SYS_USERS || [ 'Skid' ] ;
537+ var users = App . Env . initialParams . IP . SYS_USERS ;
495538 var opts = App . HTML . Build . options ( users , options . OWNER ) ;
496539 tpl . set ( ':owner_options' , opts ) ;
497540
0 commit comments