Browse Source

cosmetic: indent some templates to 4 instead of 2 spaces

Damien Accorsi 10 years ago
parent
commit
e90365a3df

+ 332 - 332
pboard/pboard/templates/document-widgets-tabs.mak View File

@@ -11,358 +11,358 @@
11 11
 </%def>
12 12
 
13 13
 <%def name="AccessManagementTab(poNode, user_rights, user)">
14
-  ######
15
-  ##
16
-  ## THIS WIDGET IS INTENDED TO BE USED ONE TIME ONLY IN A PAGE
17
-  ##
18
-  <h4>${_('Share options')}</h4> 
19
-  <p>
20
-    % if poNode.is_shared==False:
21
-      <span class="pod-grey">${_('This document is not shared')}</span>
22
-    % else:
23
-      <span class="">${_('This document is shared.')}</span>
24
-    % endif
25
-  </p>
26
-  <p>
27
-    % if poNode.is_shared==True:
28
-    <table class="table table-striped table-hover table-condensed">
29
-      <thead>
30
-        <tr>
31
-          <th><i class="fa fa-group"></i> ${_('Groups')}</th>
32
-          <th></th>
33
-        </tr>
34
-      </thead>
35
-      % for loGroupRightsOnNode in real_group_rights:
36
-        % if loGroupRightsOnNode.hasSomeAccess():
37
-          <tr>
38
-            <td>${loGroupRightsOnNode.display_name}</td>
39
-            <td>
40
-              % if loGroupRightsOnNode.hasReadAccess():
41
-                <span class="label label-success">R</span>
42
-              % endif
43
-              % if loGroupRightsOnNode.hasWriteAccess():
44
-                <span class="label label-warning">W</span>
45
-              % endif
46
-            </td>
47
-          </tr>
48
-        % endif
49
-      % endfor
50
-      <thead>
51
-        <tr>
52
-          <th><i class="fa fa-user"></i> ${_('Individual users')}</th>
53
-          <th></th>
54
-        </tr>
55
-      </thead>
56
-      % for loGroupRightsOnNode in user_specific_group_rights:
57
-        % if loGroupRightsOnNode.hasSomeAccess():
58
-          <tr>
59
-            <td>${loGroupRightsOnNode.display_name}</td>
60
-            <td>
61
-              % if loGroupRightsOnNode.hasReadAccess():
62
-                <span class="label label-success">R</span>
63
-              % endif
64
-              % if loGroupRightsOnNode.hasWriteAccess():
65
-                <span class="label label-warning">W</span>
66
-              % endif
67
-            </td>
68
-          </tr>
69
-        % endif
70
-      % endfor
71
-    </table>
72
-    
73
-    % endif
74
-  <p>
75
-
76
-######
77
-##
78
-## 2014-05-06 - D.A. We do not share documents on internet yet.
79
-##
80
-##  <p>
81
-##    % if poNode.is_public==False:
82
-##      ${_('This document is not shared on internet')|n}
83
-##    % else:
84
-##      ${_('This document is <span class="label label-warning"><i class="fa fa-globe"></i><span>shared</span></span> on internet')|n}.
85
-##      ${_('The associated url is:')} <a href="FIXME">${poNode.public_url_key}</a>
86
-##    % endif
87
-##  </p>
88
-  <!-- Button to trigger modal -->
89
-% if user.user_id==poNode.owner_id or (user_rights and user_rights.hasWriteAccess()):
90
-  <a href="#edit-document-share-properties" role="button" class="btn btn-success" data-toggle="modal">
91
-    <i class="fa fa-edit"></i>
92
-    ${_('Edit share options')}
93
-  </a>
94
-% endif
95
-
96
-  <!-- Modal -->
97
-  <div
98
-    id="edit-document-share-properties"
99
-    class="modal hide"
100
-    tabindex="-1"
101
-    role="dialog"
102
-    aria-labelledby="myModalLabel"
103
-    aria-hidden="true">
104
-    
105
-    <div class="modal-header">
106
-      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
107
-      <h3 id="myModalLabel">Document sharing options</h3>
108
-    </div>
109
-    <div class="modal-body">
110
-
111
-      <form id='document-share-form' method="GET" action="${tg.url('/api/set_access_management')}">
112
-        <input type="hidden" name="node_id" value="${poNode.node_id}" />
113
-        <input type="hidden" name="read" value="0" />
114
-        <input type="hidden" name="write" value="0" />
115
-        <fieldset>
116
-          <label class="checkbox">
117
-            <input name="is_shared" type="checkbox" id="document-share-selector" ${('', 'checked')[poNode.is_shared]}/>
118
-            ${_('Share document with collaborators.')}
119
-          </label>
120
-          <div id="document-share-people-selector">
121
-            <p>${_('Select read and write access for each group or people...')}</p>
122
-            <script>
123
-            function updateRights(psUserId, piNewValue) {
124
-              if (typeof piNewValue === 'undefined') { piNewValue = -1; }
125
-              var ACCESS_UNDEFINED = -1;
126
-              var ACCESS_NONE = 0;
127
-              var ACCESS_READ = 1;
128
-              var ACCESS_WRITE = 2;
129
-              
130
-              var nodeIdForSelectedUser = 'user-'+psUserId+'-value';
131
-              var widgetRead = $('#'+nodeIdForSelectedUser+'-read');
132
-              var widgetWrite = $('#'+nodeIdForSelectedUser+'-write');
133
-              var oldReadValue = widgetRead.val()
134
-              var oldWriteValue = widgetWrite.val();
135
-              
136
-              if(oldReadValue=='' && oldWriteValue=='' && piNewValue==ACCESS_UNDEFINED || piNewValue==ACCESS_READ) {
137
-## SET READ ACCESS
138
-                widgetRead.val(psUserId)
139
-                widgetWrite.val('')
140
-                newHtml = '<span class="label label-success" title="${'Allow to read the item'}">R</span>';
141
-              } else if(oldReadValue==psUserId && oldWriteValue=='' && piNewValue==ACCESS_UNDEFINED || piNewValue==ACCESS_READ+ACCESS_WRITE) {
142
-## SET READ + WRITE ACCESS
143
-                widgetRead.val(psUserId)
144
-                widgetWrite.val(psUserId)
145
-                newHtml = '<span class="label label-success" title="${'Allow to read the item'}">R</span> <span class="label label-warning" title="${'Allow to modify the item'}">W</span>';
146
-              } else if (oldReadValue==psUserId && oldWriteValue==psUserId && piNewValue==ACCESS_UNDEFINED || piNewValue==ACCESS_NONE) {
147
-## SET NO ACCESS
148
-                widgetRead.val('')
149
-                widgetWrite.val('')
150
-                newHtml = '';
151
-              } else {
152
-## SET READ ACCESS (default)
153
-                widgetRead.val(psUserId)
154
-                widgetWrite.val('')
155
-                newHtml = '<span class="label label-success" title="${'Allow to read the item'}">R</span>';
156
-              }
157
-              
158
-              visibleid = 'user-'+psUserId+'-rights';
159
-              $("#"+visibleid).html(newHtml);
160
-            }
161
-            </script>
162
-            
163
-            <table class="table table-striped table-hover table-condensed">
164 14
     ######
165 15
     ##
166
-    ## REAL GROUPS LISTING HERE
16
+    ## THIS WIDGET IS INTENDED TO BE USED ONE TIME ONLY IN A PAGE
167 17
     ##
168
-              <thead>
18
+    <h4>${_('Share options')}</h4> 
19
+    <p>
20
+      % if poNode.is_shared==False:
21
+        <span class="pod-grey">${_('This document is not shared')}</span>
22
+      % else:
23
+        <span class="">${_('This document is shared.')}</span>
24
+      % endif
25
+    </p>
26
+    <p>
27
+      % if poNode.is_shared==True:
28
+      <table class="table table-striped table-hover table-condensed">
29
+        <thead>
30
+          <tr>
31
+            <th><i class="fa fa-group"></i> ${_('Groups')}</th>
32
+            <th></th>
33
+          </tr>
34
+        </thead>
35
+        % for loGroupRightsOnNode in real_group_rights:
36
+            % if loGroupRightsOnNode.hasSomeAccess():
37
+                <tr>
38
+                    <td>${loGroupRightsOnNode.display_name}</td>
39
+                    <td>
40
+                        % if loGroupRightsOnNode.hasReadAccess():
41
+                            <span class="label label-success">R</span>
42
+                        % endif
43
+                        % if loGroupRightsOnNode.hasWriteAccess():
44
+                            <span class="label label-warning">W</span>
45
+                        % endif
46
+                    </td>
47
+                </tr>
48
+            % endif
49
+        % endfor
50
+        <thead>
51
+            <tr>
52
+                <th><i class="fa fa-user"></i> ${_('Individual users')}</th>
53
+                <th></th>
54
+            </tr>
55
+        </thead>
56
+        % for loGroupRightsOnNode in user_specific_group_rights:
57
+            % if loGroupRightsOnNode.hasSomeAccess():
169 58
                 <tr>
170
-                  <th><i class="fa fa-group"></i></th>
171
-                  <th>${_('Group')}</th>
172
-                  <th>${_('Access')}</th>
59
+                    <td>${loGroupRightsOnNode.display_name}</td>
60
+                    <td>
61
+                        % if loGroupRightsOnNode.hasReadAccess():
62
+                            <span class="label label-success">R</span>
63
+                        % endif
64
+                        % if loGroupRightsOnNode.hasWriteAccess():
65
+                            <span class="label label-warning">W</span>
66
+                        % endif
67
+                    </td>
173 68
                 </tr>
174
-              </thead>
175
-              % for loGroupRightsOnNode in real_group_rights:
69
+            % endif
70
+        % endfor
71
+      </table>
72
+      
73
+      % endif
74
+    <p>
176 75
 
177
-              <tr id='user-${loGroupRightsOnNode.group_id}-rights-row'>
178
-                <td>
179
-                  <a
180
-                    class="btn btn-mini"
181
-                    onclick="updateRights(${loGroupRightsOnNode.group_id})"
182
-                  >
183
-                    <i class="fa fa-key"></i>
184
-                  </a>
185
-                </td>
186
-                <td class='pod-highlightable-access-management-cell'>
187
-                  ${loGroupRightsOnNode.display_name}
188
-                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-read" name="read" value="" />
189
-                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-write" name="write" value="" />
190
-                </td>
191
-                <td id="user-${loGroupRightsOnNode.group_id}-rights" class="pod-right-cell"></td>
192
-              </tr>
193
-              % endfor
194
-              
195 76
     ######
196 77
     ##
197
-    ## INDIVIDUAL USERS LISTING HERE
78
+    ## 2014-05-06 - D.A. We do not share documents on internet yet.
198 79
     ##
199
-              <thead>
200
-                <tr>
201
-                  <th><i class="fa fa-user"></i></th>
202
-                  <th>${_('Individual Users')}</th>
203
-                  <th>${_('Access')}</th>
204
-                </tr>
205
-              </thead>
206
-              % for loGroupRightsOnNode in user_specific_group_rights:
207
-              
208
-              <tr id='user-${loGroupRightsOnNode.group_id}-rights-row'>
209
-                <td>
210
-                  <a
211
-                    class="btn btn-mini"
212
-                    onclick="updateRights(${loGroupRightsOnNode.group_id})"
213
-                  >
214
-                    <i class="fa fa-key"></i>
215
-                  </a>
216
-                </td>
217
-                <td class='pod-highlightable-access-management-cell'>
218
-                  ${loGroupRightsOnNode.display_name}
219
-                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-read" name="read" value="" />
220
-                  <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-write" name="write" value="" />
221
-                </td>
222
-                <td id="user-${loGroupRightsOnNode.group_id}-rights" class="pod-right-cell"></td>
223
-              </tr>
224
-              % endfor
225
-            </table>
226
-          </div>
227
-        </fieldset>
228
-######
229
-##
230
-## 2014-05-06 - D.A. The documents are not yet sharable through internet
231
-##
232
-##        <fieldset>
233
-##          <label class="checkbox">
234
-##            <input name="is_public" type="checkbox" id="document-public-selector" ${('', 'checked')[poNode.is_public]}/>
235
-##            ${_('Internet shared document')}
236
-##            <i class="fa fa-globe"></i>
237
-##          </label>
238
-##          <label id="document-public-key-selector">
239
-##            ${_('Key')}
240
-##            <div class="input-append">
241
-##              <input name="url_public_key" id="document-public-key" type="text">
242
-##              <span id="document-public-key-refresh-button" class="add-on btn" title="${_('Regenerate key')}">
243
-##                <i class="fa fa-refresh"></i>
244
-##              </span>
245
-##            </div>
246
-##            <p><a id='document-public-key-url' href="">http://share.pod.com/document/azefnzeioguneriugnreiugnre</a></p>
247
-##          </label>
80
+    ##  <p>
81
+    ##    % if poNode.is_public==False:
82
+    ##      ${_('This document is not shared on internet')|n}
83
+    ##    % else:
84
+    ##      ${_('This document is <span class="label label-warning"><i class="fa fa-globe"></i><span>shared</span></span> on internet')|n}.
85
+    ##      ${_('The associated url is:')} <a href="FIXME">${poNode.public_url_key}</a>
86
+    ##    % endif
87
+    ##  </p>
88
+      <!-- Button to trigger modal -->
89
+    % if user.user_id==poNode.owner_id or (user_rights and user_rights.hasWriteAccess()):
90
+      <a href="#edit-document-share-properties" role="button" class="btn btn-success" data-toggle="modal">
91
+        <i class="fa fa-edit"></i>
92
+        ${_('Edit share options')}
93
+      </a>
94
+    % endif
248 95
 
249
-        </fieldset>
250
-####
251
-## Button replaced by modal dialog button
252
-##        <button type="submit" class="btn btn-success">
253
-##          <i class="fa fa-check"></i>
254
-##          ${_('Save')}
255
-##        </button>
256
-      </form>
257
-    </div>
258
-    <div class="modal-footer">
259
-    <button class="btn" data-dismiss="modal" aria-hidden="true">
260
-      <i class="fa fa-ban"></i> ${_('Cancel')}
261
-    </button>
262
-    <button class="btn btn-success" id="document-share-form-submit-button">
263
-      <i class="fa fa-check"></i> ${_('Save changes')}
264
-    </button>
265
-    </div>
266
-    <script>
267
-##
268
-## 2014-05-06 - D.A. - Documents are not yet sharable through internet
269
-##
270
-##        function refreshDocumentPublicKey(psNewPublicKey) {
271
-##          var lsNewUrl = 'http://share.pod.com/document/'+psNewPublicKey;
272
-##          $('#document-public-key').val(psNewPublicKey);
273
-##          $('#document-public-key-url').attr('href', lsNewUrl);
274
-##          $('#document-public-key-url').text(lsNewUrl);
275
-##        }
96
+    <!-- Modal -->
97
+    <div
98
+      id="edit-document-share-properties"
99
+      class="modal hide"
100
+      tabindex="-1"
101
+      role="dialog"
102
+      aria-labelledby="myModalLabel"
103
+      aria-hidden="true">
276 104
       
277
-      function toggleDocumentSharePeopleSelector(pbShowIt) {
278
-        if (pbShowIt) {
279
-          $('#document-share-people-selector').show();
280
-          // $('#document-share-people-selector input').removeAttr("disabled");
281
-        } else {
282
-          $('#document-share-people-selector').hide();
283
-          // $('#document-share-people-selector input').prop('disabled', 'disabled');
105
+      <div class="modal-header">
106
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
107
+        <h3 id="myModalLabel">Document sharing options</h3>
108
+      </div>
109
+      <div class="modal-body">
110
+
111
+        <form id='document-share-form' method="GET" action="${tg.url('/api/set_access_management')}">
112
+          <input type="hidden" name="node_id" value="${poNode.node_id}" />
113
+          <input type="hidden" name="read" value="0" />
114
+          <input type="hidden" name="write" value="0" />
115
+          <fieldset>
116
+            <label class="checkbox">
117
+              <input name="is_shared" type="checkbox" id="document-share-selector" ${('', 'checked')[poNode.is_shared]}/>
118
+              ${_('Share document with collaborators.')}
119
+            </label>
120
+            <div id="document-share-people-selector">
121
+              <p>${_('Select read and write access for each group or people...')}</p>
122
+              <script>
123
+              function updateRights(psUserId, piNewValue) {
124
+                if (typeof piNewValue === 'undefined') { piNewValue = -1; }
125
+                var ACCESS_UNDEFINED = -1;
126
+                var ACCESS_NONE = 0;
127
+                var ACCESS_READ = 1;
128
+                var ACCESS_WRITE = 2;
129
+                
130
+                var nodeIdForSelectedUser = 'user-'+psUserId+'-value';
131
+                var widgetRead = $('#'+nodeIdForSelectedUser+'-read');
132
+                var widgetWrite = $('#'+nodeIdForSelectedUser+'-write');
133
+                var oldReadValue = widgetRead.val()
134
+                var oldWriteValue = widgetWrite.val();
135
+                
136
+                if(oldReadValue=='' && oldWriteValue=='' && piNewValue==ACCESS_UNDEFINED || piNewValue==ACCESS_READ) {
137
+  ## SET READ ACCESS
138
+                  widgetRead.val(psUserId)
139
+                  widgetWrite.val('')
140
+                  newHtml = '<span class="label label-success" title="${'Allow to read the item'}">R</span>';
141
+                } else if(oldReadValue==psUserId && oldWriteValue=='' && piNewValue==ACCESS_UNDEFINED || piNewValue==ACCESS_READ+ACCESS_WRITE) {
142
+  ## SET READ + WRITE ACCESS
143
+                  widgetRead.val(psUserId)
144
+                  widgetWrite.val(psUserId)
145
+                  newHtml = '<span class="label label-success" title="${'Allow to read the item'}">R</span> <span class="label label-warning" title="${'Allow to modify the item'}">W</span>';
146
+                } else if (oldReadValue==psUserId && oldWriteValue==psUserId && piNewValue==ACCESS_UNDEFINED || piNewValue==ACCESS_NONE) {
147
+  ## SET NO ACCESS
148
+                  widgetRead.val('')
149
+                  widgetWrite.val('')
150
+                  newHtml = '';
151
+                } else {
152
+  ## SET READ ACCESS (default)
153
+                  widgetRead.val(psUserId)
154
+                  widgetWrite.val('')
155
+                  newHtml = '<span class="label label-success" title="${'Allow to read the item'}">R</span>';
156
+                }
157
+                
158
+                visibleid = 'user-'+psUserId+'-rights';
159
+                $("#"+visibleid).html(newHtml);
160
+              }
161
+              </script>
162
+              
163
+              <table class="table table-striped table-hover table-condensed">
164
+      ######
165
+      ##
166
+      ## REAL GROUPS LISTING HERE
167
+      ##
168
+                <thead>
169
+                  <tr>
170
+                    <th><i class="fa fa-group"></i></th>
171
+                    <th>${_('Group')}</th>
172
+                    <th>${_('Access')}</th>
173
+                  </tr>
174
+                </thead>
175
+                % for loGroupRightsOnNode in real_group_rights:
176
+
177
+                <tr id='user-${loGroupRightsOnNode.group_id}-rights-row'>
178
+                  <td>
179
+                    <a
180
+                      class="btn btn-mini"
181
+                      onclick="updateRights(${loGroupRightsOnNode.group_id})"
182
+                    >
183
+                      <i class="fa fa-key"></i>
184
+                    </a>
185
+                  </td>
186
+                  <td class='pod-highlightable-access-management-cell'>
187
+                    ${loGroupRightsOnNode.display_name}
188
+                    <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-read" name="read" value="" />
189
+                    <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-write" name="write" value="" />
190
+                  </td>
191
+                  <td id="user-${loGroupRightsOnNode.group_id}-rights" class="pod-right-cell"></td>
192
+                </tr>
193
+                % endfor
194
+                
195
+      ######
196
+      ##
197
+      ## INDIVIDUAL USERS LISTING HERE
198
+      ##
199
+                <thead>
200
+                  <tr>
201
+                    <th><i class="fa fa-user"></i></th>
202
+                    <th>${_('Individual Users')}</th>
203
+                    <th>${_('Access')}</th>
204
+                  </tr>
205
+                </thead>
206
+                % for loGroupRightsOnNode in user_specific_group_rights:
207
+                
208
+                <tr id='user-${loGroupRightsOnNode.group_id}-rights-row'>
209
+                  <td>
210
+                    <a
211
+                      class="btn btn-mini"
212
+                      onclick="updateRights(${loGroupRightsOnNode.group_id})"
213
+                    >
214
+                      <i class="fa fa-key"></i>
215
+                    </a>
216
+                  </td>
217
+                  <td class='pod-highlightable-access-management-cell'>
218
+                    ${loGroupRightsOnNode.display_name}
219
+                    <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-read" name="read" value="" />
220
+                    <input type="hidden" id="user-${loGroupRightsOnNode.group_id}-value-write" name="write" value="" />
221
+                  </td>
222
+                  <td id="user-${loGroupRightsOnNode.group_id}-rights" class="pod-right-cell"></td>
223
+                </tr>
224
+                % endfor
225
+              </table>
226
+            </div>
227
+          </fieldset>
228
+  ######
229
+  ##
230
+  ## 2014-05-06 - D.A. The documents are not yet sharable through internet
231
+  ##
232
+  ##        <fieldset>
233
+  ##          <label class="checkbox">
234
+  ##            <input name="is_public" type="checkbox" id="document-public-selector" ${('', 'checked')[poNode.is_public]}/>
235
+  ##            ${_('Internet shared document')}
236
+  ##            <i class="fa fa-globe"></i>
237
+  ##          </label>
238
+  ##          <label id="document-public-key-selector">
239
+  ##            ${_('Key')}
240
+  ##            <div class="input-append">
241
+  ##              <input name="url_public_key" id="document-public-key" type="text">
242
+  ##              <span id="document-public-key-refresh-button" class="add-on btn" title="${_('Regenerate key')}">
243
+  ##                <i class="fa fa-refresh"></i>
244
+  ##              </span>
245
+  ##            </div>
246
+  ##            <p><a id='document-public-key-url' href="">http://share.pod.com/document/azefnzeioguneriugnreiugnre</a></p>
247
+  ##          </label>
248
+
249
+          </fieldset>
250
+  ####
251
+  ## Button replaced by modal dialog button
252
+  ##        <button type="submit" class="btn btn-success">
253
+  ##          <i class="fa fa-check"></i>
254
+  ##          ${_('Save')}
255
+  ##        </button>
256
+        </form>
257
+      </div>
258
+      <div class="modal-footer">
259
+      <button class="btn" data-dismiss="modal" aria-hidden="true">
260
+        <i class="fa fa-ban"></i> ${_('Cancel')}
261
+      </button>
262
+      <button class="btn btn-success" id="document-share-form-submit-button">
263
+        <i class="fa fa-check"></i> ${_('Save changes')}
264
+      </button>
265
+      </div>
266
+      <script>
267
+  ##
268
+  ## 2014-05-06 - D.A. - Documents are not yet sharable through internet
269
+  ##
270
+  ##        function refreshDocumentPublicKey(psNewPublicKey) {
271
+  ##          var lsNewUrl = 'http://share.pod.com/document/'+psNewPublicKey;
272
+  ##          $('#document-public-key').val(psNewPublicKey);
273
+  ##          $('#document-public-key-url').attr('href', lsNewUrl);
274
+  ##          $('#document-public-key-url').text(lsNewUrl);
275
+  ##        }
276
+        
277
+        function toggleDocumentSharePeopleSelector(pbShowIt) {
278
+          if (pbShowIt) {
279
+            $('#document-share-people-selector').show();
280
+            // $('#document-share-people-selector input').removeAttr("disabled");
281
+          } else {
282
+            $('#document-share-people-selector').hide();
283
+            // $('#document-share-people-selector input').prop('disabled', 'disabled');
284
+          }
284 285
         }
285
-      }
286 286
 
287
-##
288
-## 2014-05-06 - D.A. - Documents are not yet sharable through internet
289
-##
290
-##        function toggleDocumentPublicKeyGenerator(pbShowIt) {
291
-##          if (pbShowIt) {
292
-##            $('#document-public-key-selector input').removeAttr("disabled");
293
-##            $('#document-public-key-refresh-button').removeProp('disabled');
294
-##            $('#document-public-key-refresh-button').removeClass('btn-disabled');
295
-##            $('#document-public-key-selector a').show();
296
-##            $('#document-public-key-refresh-button').on("click").click(function () {
297
-##              refreshDocumentPublicKey(generateStringId()); // New random 32-char id
298
-##            });
299
-##            if($('#document-public-key-selector input').val()=='') {
300
-##              refreshDocumentPublicKey(generateStringId());
301
-##            }
302
-##          } else {
303
-##            $('#document-public-key-refresh-button').prop('disabled', true);
304
-##            $('#document-public-key-refresh-button').addClass('btn-disabled');
305
-##            $('#document-public-key-selector input').prop('disabled', 'disabled');
306
-##            $('#document-public-key-refresh-button').off("click");
307
-##            $('#document-public-key-selector a').hide();
308
-##          }
309
-##        }
310
-##
311
-##
312
-##
287
+  ##
288
+  ## 2014-05-06 - D.A. - Documents are not yet sharable through internet
289
+  ##
290
+  ##        function toggleDocumentPublicKeyGenerator(pbShowIt) {
291
+  ##          if (pbShowIt) {
292
+  ##            $('#document-public-key-selector input').removeAttr("disabled");
293
+  ##            $('#document-public-key-refresh-button').removeProp('disabled');
294
+  ##            $('#document-public-key-refresh-button').removeClass('btn-disabled');
295
+  ##            $('#document-public-key-selector a').show();
296
+  ##            $('#document-public-key-refresh-button').on("click").click(function () {
297
+  ##              refreshDocumentPublicKey(generateStringId()); // New random 32-char id
298
+  ##            });
299
+  ##            if($('#document-public-key-selector input').val()=='') {
300
+  ##              refreshDocumentPublicKey(generateStringId());
301
+  ##            }
302
+  ##          } else {
303
+  ##            $('#document-public-key-refresh-button').prop('disabled', true);
304
+  ##            $('#document-public-key-refresh-button').addClass('btn-disabled');
305
+  ##            $('#document-public-key-selector input').prop('disabled', 'disabled');
306
+  ##            $('#document-public-key-refresh-button').off("click");
307
+  ##            $('#document-public-key-selector a').hide();
308
+  ##          }
309
+  ##        }
310
+  ##
311
+  ##
312
+  ##
313 313
 
314
-      // Callbacks setup
315
-      $('#document-share-selector').change(function () {
316
-        var checkedValue = $('#document-share-selector').prop("checked");
317
-        toggleDocumentSharePeopleSelector(checkedValue);
318
-      });
314
+        // Callbacks setup
315
+        $('#document-share-selector').change(function () {
316
+          var checkedValue = $('#document-share-selector').prop("checked");
317
+          toggleDocumentSharePeopleSelector(checkedValue);
318
+        });
319 319
 
320
-##        $('#document-public-selector').change(function () {
321
-##          var checkedValue = $('#document-public-selector').prop("checked");
322
-##          toggleDocumentPublicKeyGenerator(checkedValue);
323
-##        });
320
+  ##        $('#document-public-selector').change(function () {
321
+  ##          var checkedValue = $('#document-public-selector').prop("checked");
322
+  ##          toggleDocumentPublicKeyGenerator(checkedValue);
323
+  ##        });
324 324
 
325
-      // Submit access-management modal dialog form
326
-      $('#document-share-form-submit-button').click(function(){
327
-        $("input[name='read'][value='']").remove();
328
-        $("input[name='write'][value='']").remove();
329
-        $('#document-share-form')[0].submit();
330
-      });
325
+        // Submit access-management modal dialog form
326
+        $('#document-share-form-submit-button').click(function(){
327
+          $("input[name='read'][value='']").remove();
328
+          $("input[name='write'][value='']").remove();
329
+          $('#document-share-form')[0].submit();
330
+        });
331 331
 
332
-      // Initial setup
333
-      // Activate or disactivate users selector according
334
-      // to current state of the is_shared property
335
-      //
336
-      // FIXME - 2014-05-06 - This is not working (should be done at document.ready time)
337
-      // note: putting this in a document.ready callback does not work.
338
-      //
339
-##
340
-## The following code is something like dirty ;)
341
-## the goal of this piece of code is to setup view
342
-## according to hidden input values
343
-## for read/write access management
344
-##
332
+        // Initial setup
333
+        // Activate or disactivate users selector according
334
+        // to current state of the is_shared property
335
+        //
336
+        // FIXME - 2014-05-06 - This is not working (should be done at document.ready time)
337
+        // note: putting this in a document.ready callback does not work.
338
+        //
339
+  ##
340
+  ## The following code is something like dirty ;)
341
+  ## the goal of this piece of code is to setup view
342
+  ## according to hidden input values
343
+  ## for read/write access management
344
+  ##
345 345
 
346
-## FIXME      % for loGroupRightsOnNode in real_group_rights:
347
-##      % for loCurrentGroup in real_group_rights + user_specific_group_rights:
348
-      % for loGroupRightsOnNode in real_group_rights + user_specific_group_rights:
349
-        % if loGroupRightsOnNode.hasSomeAccess()==False:
350
-          updateRights(${loGroupRightsOnNode.group_id}, 0);
351
-        % else:
352
-##
353
-## The following line should build some javascript code similar to this:
354
-## updateRights(-5, 3);
355
-          updateRights(${loGroupRightsOnNode.group_id}, ${loGroupRightsOnNode.rights});
356
-        % endif
357
-      % endfor
346
+  ## FIXME      % for loGroupRightsOnNode in real_group_rights:
347
+  ##      % for loCurrentGroup in real_group_rights + user_specific_group_rights:
348
+        % for loGroupRightsOnNode in real_group_rights + user_specific_group_rights:
349
+          % if loGroupRightsOnNode.hasSomeAccess()==False:
350
+            updateRights(${loGroupRightsOnNode.group_id}, 0);
351
+          % else:
352
+  ##
353
+  ## The following line should build some javascript code similar to this:
354
+  ## updateRights(-5, 3);
355
+            updateRights(${loGroupRightsOnNode.group_id}, ${loGroupRightsOnNode.rights});
356
+          % endif
357
+        % endfor
358 358
 
359
-      toggleDocumentSharePeopleSelector($('#document-share-selector').prop("checked"));
360
-##        toggleDocumentPublicKeyGenerator($('#document-public-selector').prop("checked"));  
361
-##        
362
-##        refreshDocumentPublicKey($('#document-public-key').val()); // First init
359
+        toggleDocumentSharePeopleSelector($('#document-share-selector').prop("checked"));
360
+  ##        toggleDocumentPublicKeyGenerator($('#document-public-selector').prop("checked"));  
361
+  ##        
362
+  ##        refreshDocumentPublicKey($('#document-public-key').val()); // First init
363 363
 
364
-    </script>
365
-  </div>
364
+      </script>
365
+    </div>
366 366
 </%def>
367 367
 
368 368
 <%def name="FileTabContent(poNode)">

+ 8 - 8
pboard/pboard/templates/document-widgets.mak View File

@@ -723,15 +723,15 @@
723 723
             if(shouldRemoveNodeCallBack && shouldRemoveNodeCallBack(parentTreeViewItem, currentTreeViewItem, rootList)) {
724 724
                 console.log('Will remove node #'+currentTreeViewItem.id+' from tree view');
725 725
                 if(parentTreeViewItem!=null) {
726
-                  var currentTreeViewItemPosition = parentTreeViewItem.children.indexOf(currentTreeViewItem);
727
-                  if(currentTreeViewItemPosition != -1) {
728
-                      parentTreeViewItem.children.splice(currentTreeViewItemPosition, 1);
729
-                  }
726
+                    var currentTreeViewItemPosition = parentTreeViewItem.children.indexOf(currentTreeViewItem);
727
+                    if(currentTreeViewItemPosition != -1) {
728
+                        parentTreeViewItem.children.splice(currentTreeViewItemPosition, 1);
729
+                    }
730 730
                 } else {
731
-                  var currentTreeViewItemPosition = rootList.indexOf(currentTreeViewItem);
732
-                  if(currentTreeViewItemPosition != -1) {
733
-                      rootList.splice(currentTreeViewItemPosition, 1);
734
-                  }
731
+                    var currentTreeViewItemPosition = rootList.indexOf(currentTreeViewItem);
732
+                    if(currentTreeViewItemPosition != -1) {
733
+                        rootList.splice(currentTreeViewItemPosition, 1);
734
+                    }
735 735
                 }
736 736
                 
737 737
             } else {