Selaa lähdekoodia

Closes #165: Fix webdav document design (html)

Bastien Sevajol (Algoo) 8 vuotta sitten
vanhempi
commit
b2c05e0df0
1 muutettua tiedostoa jossa 14 lisäystä ja 27 poistoa
  1. 14 27
      tracim/tracim/lib/webdav/design.py

+ 14 - 27
tracim/tracim/lib/webdav/design.py Näytä tiedosto

109
 }
109
 }
110
 """
110
 """
111
 
111
 
112
+_LABELS = {
113
+    'archiving': 'Item archived',
114
+    'content-comment': 'Item commented',
115
+    'creation': 'Item created',
116
+    'deletion': 'Item deleted',
117
+    'edition': 'item modified',
118
+    'revision': 'New revision',
119
+    'status-update': 'New status',
120
+    'unarchiving': 'Item unarchived',
121
+    'undeletion': 'Item undeleted',
122
+    'move': 'Item moved',
123
+    'comment': 'Comment'
124
+}
125
+
112
 
126
 
113
 def create_readable_date(created, delta_from_datetime: datetime = None):
127
 def create_readable_date(created, delta_from_datetime: datetime = None):
114
     if not delta_from_datetime:
128
     if not delta_from_datetime:
139
     for event in hist:
153
     for event in hist:
140
         if isinstance(event, VirtualEvent):
154
         if isinstance(event, VirtualEvent):
141
             date = event.create_readable_date()
155
             date = event.create_readable_date()
142
-            _LABELS = {
143
-                'archiving': 'Item archived',
144
-                'content-comment': 'Item commented',
145
-                'creation': 'Item created',
146
-                'deletion': 'Item deleted',
147
-                'edition': 'item modified',
148
-                'revision': 'New revision',
149
-                'status-update': 'New status',
150
-                'unarchiving': 'Item unarchived',
151
-                'undeletion': 'Item undeleted',
152
-                'move': 'Item moved'
153
-            }
154
-
155
             label = _LABELS[event.type.id]
156
             label = _LABELS[event.type.id]
156
 
157
 
157
             histHTML += '''
158
             histHTML += '''
265
                     participants[t.owner.display_name][0] += 1
266
                     participants[t.owner.display_name][0] += 1
266
             else:
267
             else:
267
                 if isinstance(t, VirtualEvent) and t.type.id != 'comment':
268
                 if isinstance(t, VirtualEvent) and t.type.id != 'comment':
268
-                    _LABELS = {
269
-                        'archiving': 'Item archived',
270
-                        'content-comment': 'Item commented',
271
-                        'creation': 'Item created',
272
-                        'deletion': 'Item deleted',
273
-                        'edition': 'item modified',
274
-                        'revision': 'New revision',
275
-                        'status-update': 'New status',
276
-                        'unarchiving': 'Item unarchived',
277
-                        'undeletion': 'Item undeleted',
278
-                        'move': 'Item moved',
279
-                        'comment' : 'hmmm'
280
-                    }
281
-
282
                     label = _LABELS[t.type.id]
269
                     label = _LABELS[t.type.id]
283
 
270
 
284
                     disc += '''
271
                     disc += '''