Blame view

mobile/source/modules/admin/tmpl/control_blocks/block2tmpl.html 2.1 KB
a1684257   Administrator   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
   <ul class="top_nav">
  		<li ><a  href="/" >Сайт</a></li>
  		<li ><a  href="/admin.html" >Административный раздел</a></li>
  		<li ><a  href="/?p_name=admin_control_blocks" >Блоки</a></li>
  		<li class="current" > Блок  &laquo;${b_name}&raquo; задействован в следующих шаблонах</li>
  	</ul>
  
  <div style="padding:10px;padding-top:0px;" > 
  	<table  class="data" width="100%" align="left" >
  
  	<tr>
  	  	<td colspan="8" style="padding:5px;text-align:right">
  	  		<a style="color:#F8A720;font-size:14px;" act="add_link" row_id="0" >Добавить&nbsp;новый&nbsp;блок</a>
  	  	</td>
  	</tr>
  	<tr class="header">
  	 	<td width="15%">Шаблон</td>
  	  <td width="5%" >Переменная</td>
  	  <td width="5%">Настройки</td>
  	 	<td width="1%" colspan="2"></td>
  	</tr>
  	
  	
  	 <tbody id="table_content">
  		<tal:block metal:use-macro="inc/row_block2tmpl.html/row_block2tmpl">
  			подключаем шаблон из файла inc/row_block2tmpl.html
  		</tal:block>
  	</tbody>
  	</table>
  	
  	
  </div>
  <script>/*<![CDATA[*/
  
  t = new HL.controls.table("${MAIN_URL}/?p_name=admin_control_blocks");
  t.data['b_id']=${b_id};
  
  $('td input[type=checkbox]').change( function(e){
  	if ( $(this).attr('checked')=='checked'){
  			t.setWhere('access',1 )
  	}else{
  		t.setWhere('access',0 )
  	}
  	t.execute('freeAccess', $(this) );
  });
  
  t.setAction('updateKey',function(t,link){
  	 $.ajax( {
  	 			'beforeSend' : function(){
  	 				$(link).css('color','red');
  	 			},
          'dataType':'xml',
          'type'    : "POST",
          'url'     : t.server+'&act=updateKey', 
          'data'    : {'id':$(link).attr('row_id'),'key':$(link).attr('name'),'value':$(link).val()},
          'success' : function(xml){ 
          	$(link).css('color','green');
            $(link).prop('disabled',false);
          },
     })
  })
  
  $('input[name]').blur( function(e){
  	t.setWhere('key',$(this).attr('name') );
  	t.setWhere('value',$(this).val() );
  	t.execute('updateKey', $(this) );
  });
  
  
  $('#filter_module').change( function(e){
  	t.setWhere('filter_module',$(this).val() )
  	t.execute('reload', $(this) );
  });
  
  
  
  
  /*]]>*/</script>