|
@@ -1,45 +1,64 @@
|
1
|
1
|
<%inherit file="local:templates.master"/>
|
2
|
|
-<%def name="get_icon_class_from_node_type(node_type)">
|
3
|
2
|
|
4
|
|
-</%def>
|
5
|
3
|
|
6
|
|
-<%def name="node_treeview(node_list, indentation=0)">
|
7
|
|
- % if len(node_list)>0:
|
8
|
|
- <!--ul style="list-style:none; margin-left: ${(indentation+1)*0.5}em;"-->
|
9
|
|
- % for node in node_list:
|
10
|
|
- <tr title="Last updated: ${node.updated_at}">
|
11
|
|
- <td style="padding-left: ${(indentation+1)*0.5}em;">
|
12
|
|
- <a href="?node=${node.node_id}" title="${node.data_label}">
|
13
|
|
- <i class='${node.getIconClass()}'></i>
|
14
|
|
- % if len(node.data_label)<=15:
|
15
|
|
- ${node.data_label}
|
16
|
|
- % else:
|
17
|
|
- ${node.data_label[0:15]}...
|
18
|
|
- % endif
|
19
|
|
- </a>
|
20
|
|
- </td>
|
21
|
|
- <td class="text-right">
|
22
|
|
- <a href="${tg.url('/move_node_upper?node_id=%i'%(node.node_id))}" title="Move up"><i class=" icon-g-up-arrow"></i></a>
|
23
|
|
- <a href="${tg.url('/move_node_lower?node_id=%i'%(node.node_id))}" title="Move down"><i class=" icon-g-down-arrow"></i></a>
|
24
|
|
- <a href="" title="Edit"><i class="icon-g-edit"></i></a>
|
25
|
|
- </td>
|
26
|
|
- </tr>
|
27
|
|
- ${node_treeview(node.getChildren(), indentation+1)}
|
28
|
|
- % endfor
|
29
|
|
- <!--/ul-->
|
|
4
|
+
|
|
5
|
+<%def name="node_treeview(node_list, indentation=-1)">
|
|
6
|
+ % if indentation==-1:
|
|
7
|
+ <tr>
|
|
8
|
+ <td style="padding-left: ${(indentation+1)*0.8}em;">
|
|
9
|
+ <a href="?node=0" title="${_('Root')}">
|
|
10
|
+ <i class='icon-g-folder-open'></i>
|
|
11
|
+ ${_('Root')}
|
|
12
|
+ </a>
|
|
13
|
+ </td>
|
|
14
|
+ <td class="text-right">
|
|
15
|
+ <div class="pod-toolbar">
|
|
16
|
+ <a href="${tg.url('/create_document?parent_id=0')}" title="${_('Add child document')}"><i class="icon-g-circle-plus"></i></a>
|
|
17
|
+ </div>
|
|
18
|
+ </td>
|
|
19
|
+ </tr>
|
|
20
|
+ ${node_treeview(node_list, 0)}
|
|
21
|
+ % else:
|
|
22
|
+ % if len(node_list)>0:
|
|
23
|
+ % for node in node_list:
|
|
24
|
+ <tr title="Last updated: ${node.updated_at}">
|
|
25
|
+ <td style="padding-left: ${(indentation+1)*0.5}em;">
|
|
26
|
+ <a href="?node=${node.node_id}" title="${node.data_label}">
|
|
27
|
+ <i class='${node.getIconClass()}'></i>
|
|
28
|
+ % if len(node.data_label)<=15:
|
|
29
|
+ ${node.data_label}
|
|
30
|
+ % else:
|
|
31
|
+ ${node.data_label[0:15]}...
|
|
32
|
+ % endif
|
|
33
|
+ </a>
|
|
34
|
+ </td>
|
|
35
|
+ <td class="text-right">
|
|
36
|
+ <div class="pod-toolbar">
|
|
37
|
+ <a href="${tg.url('/move_node_upper?node_id=%i'%(node.node_id))}" title="${_('Move up')}"><i class="icon-g-up-arrow"></i></a>
|
|
38
|
+ <a href="${tg.url('/move_node_lower?node_id=%i'%(node.node_id))}" title="${_('Move down')}"><i class="icon-g-down-arrow"></i></a>
|
|
39
|
+ <a href="${tg.url('/create_document?parent_id=%i'%(node.node_id))}" title="${_('Add child document')}"><i class="icon-g-circle-plus"></i></a>
|
|
40
|
+ </div>
|
|
41
|
+ </td>
|
|
42
|
+ </tr>
|
|
43
|
+ ${node_treeview(node.getChildren(), indentation+1)}
|
|
44
|
+ % endfor
|
|
45
|
+ % endif
|
30
|
46
|
% endif
|
31
|
47
|
</%def>
|
32
|
48
|
|
33
|
|
-<%def name="node_treeview_in_select_field(node_list, indentation)">
|
|
49
|
+<%def name="node_treeview_in_select_field(node_list, indentation, selected_id=0)">
|
34
|
50
|
% if len(node_list)>0:
|
35
|
51
|
% if indentation==0:
|
36
|
52
|
<option style="margin-left: ${0.5*indentation}em; color: #CCC;" value="0">no parent...</option>
|
37
|
53
|
% endif
|
38
|
54
|
% for node in node_list:
|
39
|
|
- <option style="margin-left: ${0.5*indentation}em;" value="${node.node_id}">${node.data_label}</option>
|
40
|
|
- ${node_treeview_in_select_field(node.getChildren(), indentation+1)}
|
|
55
|
+ % if selected_id!=node.node_id:
|
|
56
|
+ <option style="margin-left: ${0.5*indentation}em;" value="${node.node_id}">${node.data_label}</option>
|
|
57
|
+ % else:
|
|
58
|
+ <option style="margin-left: ${0.5*indentation}em;" value="${node.node_id}" selected>${node.data_label}</option>
|
|
59
|
+ % endif
|
|
60
|
+ ${node_treeview_in_select_field(node.getChildren(), indentation+1, selected_id)}
|
41
|
61
|
% endfor
|
42
|
|
- </ul>
|
43
|
62
|
% endif
|
44
|
63
|
</%def>
|
45
|
64
|
|
|
@@ -53,48 +72,6 @@ Learning TurboGears 2.3: Quick guide to the Quickstart pages.
|
53
|
72
|
Documents
|
54
|
73
|
</legend>
|
55
|
74
|
|
56
|
|
- <!-- Button to trigger modal -->
|
57
|
|
- <p>
|
58
|
|
- <a href="#addFolderNode" role="button" class="btn" data-toggle="modal">
|
59
|
|
- <i class="icon-g-circle-plus"></i> Create document</a>
|
60
|
|
- </p>
|
61
|
|
- <!-- Modal -->
|
62
|
|
- <div id="addFolderNode" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
63
|
|
- <div class="modal-header">
|
64
|
|
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
65
|
|
- <h3 id="myModalLabel">Create a new page</h3>
|
66
|
|
- </div>
|
67
|
|
- <div class="modal-body">
|
68
|
|
- <form id="create_document_form" method="POST" action="${tg.url('/create_document')}" class="form-horizontal">
|
69
|
|
- <div class="control-group">
|
70
|
|
- <label class="control-label" for="data_label">Title</label>
|
71
|
|
- <div class="controls">
|
72
|
|
- <input type="text" id="data_label" name="data_label" placeholder="page title...">
|
73
|
|
- </div>
|
74
|
|
- </div>
|
75
|
|
- <div class="control-group">
|
76
|
|
- <label class="control-label" for="parent_id">As child of...</label>
|
77
|
|
- <div class="controls">
|
78
|
|
- <select id="parent_id" name="parent_id" placeholder="as child of...">
|
79
|
|
- ${node_treeview_in_select_field(root_node_list, 0)}
|
80
|
|
- </select>
|
81
|
|
- </div>
|
82
|
|
- </div>
|
83
|
|
- <div class="control-group">
|
84
|
|
- <label class="control-label" for="data_content">Description</label>
|
85
|
|
- <div class="controls">
|
86
|
|
-
|
87
|
|
- <textarea id="data_content" name="data_content"></textarea>
|
88
|
|
- </div>
|
89
|
|
- </div>
|
90
|
|
- </form>
|
91
|
|
- </div>
|
92
|
|
- <div class="modal-footer">
|
93
|
|
- <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
94
|
|
- <button id="create_document_save_button" class="btn btn-primary">Save changes</button>
|
95
|
|
- </div>
|
96
|
|
- </div>
|
97
|
|
-
|
98
|
75
|
<div>
|
99
|
76
|
<table class="table table-striped table-hover table-condensed">
|
100
|
77
|
${node_treeview(root_node_list)}
|
|
@@ -103,49 +80,48 @@ Learning TurboGears 2.3: Quick guide to the Quickstart pages.
|
103
|
80
|
</div>
|
104
|
81
|
<div class="span5">
|
105
|
82
|
<div class="page-header">
|
106
|
|
- <h3>${current_node.data_label}</h3>
|
|
83
|
+ <h3 id="current-document-title">${current_node.data_label}</h3>
|
|
84
|
+ <form id="current-document-title-edit-form" method='post' action='${tg.url('/edit_label')}'>
|
|
85
|
+ <div class="input-prepend input-append">
|
|
86
|
+ <input type='hidden' name='node_id' value='${current_node.node_id}'/>
|
|
87
|
+ <button id="current-document-title-edit-cancel-button" type="button" class="btn" title="${_('Cancel editing')}"><i class="icon-g-ban"></i></button>
|
|
88
|
+ <input type='text' name='data_label' value='${current_node.data_label}' class="span2" />
|
|
89
|
+ <button id='current-document-title-save-cancel-button' type="button" class="btn" title="${_('Save')}"><i class="icon-g-edit"></i></button>
|
|
90
|
+ </div>
|
|
91
|
+ </form>
|
107
|
92
|
</div>
|
108
|
93
|
|
109
|
|
- <div class="btn-group">
|
110
|
|
- <button class="btn"><i class="icon-g-edit"></i> Edit</button>
|
111
|
|
-
|
112
|
|
- </div>
|
113
|
94
|
|
114
|
95
|
<div class="btn-group">
|
115
|
96
|
<a class="btn btn-primary" href="#"><i class="icon-g-stats icon-g-white"></i> Status</a>
|
116
|
97
|
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
117
|
98
|
<ul class="dropdown-menu">
|
118
|
|
-
|
119
|
|
-
|
120
|
|
-
|
121
|
99
|
<li><a class="btn-success" href="#"><i class="icon-g-sun"></i> Open</a></li>
|
122
|
100
|
<li><a class="btn-warning" href="#"><i class="icon-g-rotation-lock"></i> in Standby</a></li>
|
123
|
101
|
<li><a class="btn-danger" href="#"><i class="icon-g-circle-exclamation-mark"></i> Hot</a></li>
|
124
|
102
|
<li><a class="btn " href="#"><i class="icon-g-ok"></i> Finished</a></li>
|
125
|
103
|
<li><a class="btn btn-disabled" href="#"><i class="icon-g-ban"></i> Archived</a></li>
|
126
|
104
|
</ul>
|
127
|
|
-
|
128
|
105
|
</div>
|
129
|
|
-
|
130
|
106
|
<div class="btn-group">
|
131
|
|
- <a class="btn btn-primary" href="#" ><i class="icon-g-circle-plus icon-g-white"></i> Add</a>
|
132
|
|
- <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
133
|
|
- <ul class="dropdown-menu">
|
134
|
|
- <li><a href="#"><i class="icon-g-calendar" ></i> Event</a></li>
|
135
|
|
- <li><a href="#"><i class="icon-g-comments"></i> Comment</a></li>
|
136
|
|
- <li><a href="#"><i class="icon-g-user"></i> Contact</a></li>
|
137
|
|
- <li><a href="#"><i class="icon-g-attach"></i> File</a></li>
|
138
|
|
- </ul>
|
|
107
|
+ <button id='current-document-content-edit-button' class="btn"><i class='icon-g-edit'></i> ${_('Edit')}</button>
|
139
|
108
|
</div>
|
140
|
|
-
|
141
|
109
|
<div class="btn-group">
|
142
|
|
- <button class="btn btn-danger"><i class="icon-g-white icon-g-remove"></i> Delete</button>
|
143
|
|
- </div>
|
144
|
|
-
|
145
|
|
-
|
146
|
|
- <div>
|
147
|
|
- ${current_node.data_content|n}
|
|
110
|
+ <a href='${tg.url('/force_delete_node?node_id=%i'%(current_node.node_id))}' id='current-document-force-delete-button' class="btn btn-danger"><i class="icon-g-white icon-g-remove"></i> ${_('Delete')}</a>
|
148
|
111
|
</div>
|
|
112
|
+ <p>
|
|
113
|
+ <div id='current-document-content' class="">
|
|
114
|
+ ${current_node.data_content|n}
|
|
115
|
+ </div>
|
|
116
|
+ <form id="current-document-content-edit-form" method='post' action='${tg.url('/edit_content')}'>
|
|
117
|
+ <input type='hidden' name='node_id' value='${current_node.node_id}'/>
|
|
118
|
+ <textarea id="current_node_textarea" name='data_content' spellcheck="false" wrap="off" autofocus placeholder="Enter something ...">
|
|
119
|
+ ${current_node.data_content|n}
|
|
120
|
+ </textarea>
|
|
121
|
+ <button id="current-document-content-edit-cancel-button" type="button" class="btn" title="${_('Cancel editing')}"><i class="icon-g-ban"></i> ${_('Cancel')}</button>
|
|
122
|
+ <button id='current-document-content-edit-save-button' type="button" class="btn" title="${_('Save')}"><i class="icon-g-edit"></i> ${_('Save')}</button>
|
|
123
|
+ </form>
|
|
124
|
+ </p>
|
149
|
125
|
</div>
|
150
|
126
|
<div class="span4">
|
151
|
127
|
<div class="tabbable">
|