Mercurial > epgrec.yaz
comparison templates/recordedTable.html @ 27:a34f2ff49097
add: editable title & description
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Sun, 26 Jul 2009 18:00:11 +0900 |
parents | bbbc4f1ecf1d |
children | ae5491d72470 |
comparison
equal
deleted
inserted
replaced
26:82c1375ddb4a | 27:a34f2ff49097 |
---|---|
38 } | 38 } |
39 else { | 39 else { |
40 $('#resid_' + id ).hide(); | 40 $('#resid_' + id ).hide(); |
41 } | 41 } |
42 }); | 42 }); |
43 }, | |
44 editdialog:function(id) { | |
45 $('#floatBox4Dialog').dialog({title:'変更',width:500}); | |
46 var str; | |
47 str = '<div class="prg_title">録画ID:' + id + '</div>'; | |
48 str += '<input type="hidden" name="reserve_id" id="id_reserve_id" value="' + id + '" />'; | |
49 str += '<div><span class="labelLeft">タイトル</span><input name="title" id="id_title" size="30" value="'+ $('#tid_' + id ).html() + '" /></div>'; | |
50 str += '<div><span class="labelLeft">概要</span><textarea name="description" id="id_description" cols="30" rows="5" >' + $('#did_' + id ).html() + '</textarea></div>'; | |
51 str += '<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.edit()" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">変更する</a></div>'; | |
52 | |
53 $('#floatBox4Dialog').html(str); | |
54 $('#floatBox4Dialog').dialog('open','center'); | |
55 }, | |
56 edit:function() { | |
57 var id_reserve_id = $('#id_reserve_id').val(); | |
58 var id_title = $('#id_title').val(); | |
59 var id_description = $('#id_description').val(); | |
60 | |
61 $.post('changeReservation.php', { reserve_id: id_reserve_id, | |
62 title: id_title, | |
63 description: id_description }, function( data ) { | |
64 if(data.match(/^error/i)){ | |
65 alert(data); | |
66 $('#floatBox4Dialog').dialog('close'); | |
67 | |
68 } | |
69 else { | |
70 $('#tid_' + id_reserve_id ).html( id_title ); | |
71 $('#did_' + id_reserve_id ).html( id_description ); | |
72 $('#floatBox4Dialog').dialog('close'); | |
73 } | |
74 }); | |
43 } | 75 } |
44 } | 76 } |
77 $(document).ready(function () { | |
78 var DG = $('#floatBox4Dialog'); | |
79 DG.dialog({title:'あれ?',width:500}); | |
80 DG.dialog('close'); | |
81 }); | |
45 --> | 82 --> |
46 </script> | 83 </script> |
47 <style type="text/css"> | 84 <style type="text/css"> |
48 <!-- | 85 <!-- |
49 body {padding:4px;margin:0;font-size:10pt;} | 86 body {padding:4px;margin:0;font-size:10pt;} |
134 <th>ch</th> | 171 <th>ch</th> |
135 <th>モード</th> | 172 <th>モード</th> |
136 {if $use_thumbs}<th>サムネール</th>{/if} | 173 {if $use_thumbs}<th>サムネール</th>{/if} |
137 <th>タイトル</th> | 174 <th>タイトル</th> |
138 <th>内容</th> | 175 <th>内容</th> |
139 <th>情報削除</th> | 176 <th>変更</th> |
177 <th>削除</th> | |
140 </tr> | 178 </tr> |
141 | 179 |
142 {foreach from=$records item=rec } | 180 {foreach from=$records item=rec } |
143 <tr id="resid_{$rec.id}" class="ctg_{$rec.cat}"> | 181 <tr id="resid_{$rec.id}" class="ctg_{$rec.cat}"> |
144 <td>{$rec.starttime}</td> | 182 <td>{$rec.starttime}</td> |
145 <td>{$rec.station_name}</td> | 183 <td>{$rec.station_name}</td> |
146 <td>{$rec.mode}</td> | 184 <td>{$rec.mode}</td> |
147 {if $use_thumbs}<td><a href="{$rec.asf}">{$rec.thumb}</a></td>{/if} | 185 {if $use_thumbs}<td><a href="{$rec.asf}">{$rec.thumb}</a></td>{/if} |
148 <td><a href="{$rec.asf}">{$rec.title}</a></td> | 186 <td><a href="{$rec.asf}" id="tid_{$rec.id}">{$rec.title}</a></td> |
149 <td><a href="{$rec.asf}">{$rec.description}</a></td> | 187 <td><a href="{$rec.asf}" id="did_{$rec.id}">{$rec.description}</a></td> |
188 <td><input type="button" value="変更" onClick="javascript:PRG.editdialog('{$rec.id}')" /></td> | |
150 <td><input type="button" value="削除" onClick="javascript:PRG.dialog('{$rec.id}','{$rec.title}')" /></td> | 189 <td><input type="button" value="削除" onClick="javascript:PRG.dialog('{$rec.id}','{$rec.title}')" /></td> |
151 </tr> | 190 </tr> |
152 {/foreach} | 191 {/foreach} |
153 </table> | 192 </table> |
154 | 193 |