Projet

Général

Profil

« Précédent | Suivant » 

Révision e8e6dedb

Ajouté par Frédéric Péters il y a plus de 11 ans

backoffice: renew backoffice UI with the same patterns as in w.c.s.

Voir les différences:

extra/modules/announces_ui.ptl
125 125

  
126 126
    def _q_index [html] (self):
127 127
        form = Form(enctype='multipart/form-data')
128
        form.add_submit('edit', _('Edit'))
129
        form.add_submit('delete', _('Delete'))
128
        get_response().filter['sidebar'] = self.get_sidebar()
129

  
130 130
        if self.announce.sent_by_email_time is None:
131 131
            form.add_submit('email', _('Send email'))
132 132

  
133 133
        announces_cfg = get_cfg('announces', {})
134 134
        if announces_cfg.get('sms_support', 0) and self.announce.sent_by_sms_time is None:
135 135
            form.add_submit('sms', _('Send SMS'))
136
        form.add_submit('back', _('Back'))
137 136

  
138 137
        if form.get_submit() == 'edit':
139 138
            return redirect('edit')
......
143 142
            return redirect('email')
144 143
        if form.get_submit() == 'sms':
145 144
            return redirect('sms')
146
        if form.get_submit() == 'back':
147
            return redirect('..')
148 145

  
149 146
        html_top('announces', title = _('Announce: %s') % self.announce.title)
150 147
        '<h2>%s</h2>' % _('Announce: %s') % self.announce.title
148
        '<div class="bo-block">'
151 149
        '<p>'
152 150
        self.announce.text
153 151
        '</p>'
152
        '</div>'
154 153

  
155
        form.render()
154
        if form.get_submit_widgets():
155
            form.render()
156

  
157
    def get_sidebar [html] (self):
158
        '<ul>'
159
        '<li><a href="edit">%s</a></li>' % _('Edit')
160
        '<li><a href="delete">%s</a></li>' % _('Delete')
161
        '</ul>'
156 162

  
157 163
    def email [html] (self):
158 164
        if get_request().form.get('job'):
......
333 339
                '<p class="details">'
334 340
                time.strftime(misc.date_format(), l.publication_time)
335 341
                '</p>'
336
            '<p class="commands">'
337
            command_icon('%s/edit' % announce_id, 'edit')
338
            command_icon('%s/delete' % announce_id, 'remove')
339
            '</p></li>'
342
            '</li>'
340 343
        '</ul>'
341 344

  
342 345
    def log [html] (self):

Formats disponibles : Unified diff