Changeset 6246


Ignore:
Timestamp:
30 May 2011, 08:17:42 (13 years ago)
Author:
Henrik Bettermann
Message:

Use always flash messages. The user does not expect error messages elsewhere. Avoid exclamation marks.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/batchprocessing.txt

    r6244 r6246  
    466466    <!DOCTYPE html PUBLIC...
    467467    ...
    468     ...Processing of 1 rows failed!...
     468    ...Processing of 1 rows failed...
    469469    ...Successfully processed 1 rows...
    470470    ...
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r6245 r6246  
    9191  >>> print browser.contents     
    9292  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    93   ...<li class="message">Error: xx@yy is not a valid email address!</li>
     93  ...<li class="message">Error: xx@yy is not a valid email address.</li>
    9494  ...
    9595
     
    223223  >>> print browser.contents
    224224  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    225   ...<div>The code chosen already exists in the database</div>
     225  ...<li class="message">The code chosen already exists in the database.</li>
    226226  ...
    227227
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r6245 r6246  
    2121from zope.component import (
    2222    getUtility, createObject,getAllUtilitiesRegisteredFor)
    23 from zope.component.interfaces import Invalid
     23#from zope.component.interfaces import Invalid
    2424from zope.event import notify
    2525from zope.session.interfaces import ISession
     
    6363        child_id = form['role_id']
    6464    else:
    65         view.flash('No local role selected!')
     65        view.flash('No local role selected.')
    6666        view.redirect(view.url(view.context, '@@manage')+'#tab-%s' % tab)
    6767        return
     
    111111                self.redirect(self.camefrom)
    112112                return
    113             self.flash('You entered wrong credentials!')
     113            self.flash('You entered wrong credentials.')
    114114
    115115class LoginStaffPage(LoginPage):
     
    296296                                 description=description, roles=roles)
    297297        except KeyError:
    298             self.status = Invalid('The userid chosen already exists '
    299                                   'in the database')
     298            self.status = self.flash('The userid chosen already exists '
     299                                  'in the database.')
    300300            return
    301301        self.redirect(self.url(self.context))
     
    396396        regno =form['regno']
    397397        if not (fullname and email and descr):
    398             self.flash('Error: All fields must be filled!')
     398            self.flash('Error: All fields must be filled.')
    399399            return
    400400        if not re.match("^[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+.[a-zA-Z]{2,6}$",
    401401                        email):
    402             self.flash('Error: %s is not a valid email address!' % email)
     402            self.flash('Error: %s is not a valid email address.' % email)
    403403            return
    404404        if regno == 'zope.anybody':
     
    499499    def update(self, filename=None, select=None, cancel=None):
    500500        if cancel is not None:
    501             self.flash('Import aborted')
     501            self.flash('Import aborted.')
    502502            self.redirect(self.url(self.context))
    503503            return
     
    575575            return
    576576        if cancel is not None:
    577             self.flash('Import aborted')
     577            self.flash('Import aborted.')
    578578            self.redirect(self.url(self.context))
    579579            return
     
    742742
    743743        if self.warn_num:
    744             self.flash('Processing of %d rows failed!' % self.warn_num)
     744            self.flash('Processing of %d rows failed.' % self.warn_num)
    745745        self.flash('Successfully processed %s rows' % (
    746746                linenum - (self.warn_num)))
     
    906906            child_id = form['val_id']
    907907        else:
    908             self.flash('No faculty selected!')
     908            self.flash('No faculty selected.')
    909909            self.redirect(self.url(self.context, '@@manage')+'#tab-1')
    910910            return
     
    953953            self.context.addFaculty(faculty)
    954954        except KeyError:
    955             self.status = Invalid('The name chosen already exists '
    956                                   'in the database')
     955            self.status = self.flash('The code chosen already exists '
     956                                  'in the database.')
    957957            return
    958958        self.redirect(self.url(self.context, u'@@manage')+'#tab-1')
     
    10311031            child_id = form['val_id']
    10321032        else:
    1033             self.flash('No department selected!')
     1033            self.flash('No department selected.')
    10341034            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
    10351035            return
     
    10931093            self.context.addDepartment(department)
    10941094        except KeyError:
    1095             self.status = Invalid('The code chosen already exists '
    1096                                   'in the database')
     1095            self.status = self.flash('The code chosen already exists '
     1096                                  'in the database.')
    10971097            return
    10981098        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
     
    12091209            child_id = form['val_id']
    12101210        else:
    1211             self.flash('No course selected!')
     1211            self.flash('No course selected.')
    12121212            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
    12131213            return
     
    12331233            child_id = form['val_id']
    12341234        else:
    1235             self.flash('No certificate selected!')
     1235            self.flash('No certificate selected.')
    12361236            self.redirect(self.url(self.context, '@@manage')+'#tab-3')
    12371237            return
     
    14721472            child_id = form['val_id']
    14731473        else:
    1474             self.flash('No course referrer selected!')
     1474            self.flash('No course referrer selected.')
    14751475            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
    14761476            return
     
    15211521            self.context.addCourseRef(**data)
    15221522        except KeyError:
    1523             self.status = Invalid('The chosen course referrer is already '
    1524                                   'part of this certificate')
     1523            self.status = self.flash('The chosen course referrer is already '
     1524                                  'part of this certificate.')
    15251525            return
    15261526        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
Note: See TracChangeset for help on using the changeset viewer.