OSDN Git Service

Controller::Admin::Sidebar: implement vue.js based sidebar editor
[newslash/newslash.git] / src / newslash_web / templates / admin / sidebar / index.html.tt2
1 [% WRAPPER common/layout vue=1 %]
2
3 <script type="text/x-template" id="sidebar-item-editor">
4 </script>
5
6 <div class="app-frame" id="sidebar-manager">
7   <h3>Sidebar items</h3>
8   <div v-text="message">
9   </div>
10   <form class="items">
11     <table class="table table-hover">
12       <thead>
13         <tr>
14           <th></th><th>ID</th><th>name</th><th>model</th><th>query_param</th>
15         </tr>
16       </thead>
17       <tbody>
18         <tr v-for="item in sidebarItems">
19           <td><input type="checkbox" value="" /></td>
20           <td v-text="item.id"></td>
21           <td v-text="item.name"></td>
22           <td v-text="item.model"></td>
23           <td v-text="item.query_param"></td>
24         </tr>
25       </tbody>
26     </table>
27     <div class="actions">
28       <button class="btn btn-default" type="button">New</button>
29       <button class="btn btn-default" type="button">Delete</button>
30     </div>
31   </form>
32 </div>
33
34 <script src="/js/sidebar_editor.js" ></script>
35 <script>
36   $(document).ready(function () {
37     editor.run({ el: '#sidebar-manager' });
38   });
39 </script>
40
41 [% END %]