Ignore:
Timestamp:
07/13/10 14:56:21 (23 months ago)
Author:
dart
Message:

LoReality?:
o Implement notifications
o Begin integration of ajax fmw dojo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loreality/loreality/controllers/mission.py

    r2109 r2111  
    1212 
    1313import loreality.lib.helpers as h 
     14from webhelpers.html.tags import stylesheet_link, literal, link_to 
     15from webhelpers.html.builder import make_tag 
    1416from loreality.model.form import * 
    1517 
     
    2123import uuid 
    2224from pylons.i18n.translation import _, ungettext 
     25from pylons import session 
     26 
    2327class MissionController(BaseController): 
    2428    formfields = [ 
     
    103107 
    104108        c.title = "LoReality" 
    105         c.heading = "Edit %s"%mission.name 
     109        c.heading = _("Edit %s")%mission.name 
    106110        c.mission = mission 
    107111        c.formfields = self.formfields 
     
    133137        if pilot is None: 
    134138            abort(404) 
     139         
    135140        
    136141        #- del now 
    137142        mission.pilots.append( pilot ) 
     143 
     144        #- Notify 
     145        h.msg.notify(  
     146            pilot.id, 
     147            subject=_("Participation for mission") + " %s"%mission.name,  
     148            text = _("You have been selected to participate to the mission ") + h.msg.make_link(mission.name, h.url_for(controller='mission', action='view', id=mission.id)), 
     149            commit=False) 
     150 
     151        session['flash'] = _('Pilot %s added to the mission')%pilot.name 
     152        session.save() 
     153 
    138154        meta.Session.commit() 
    139155        return self.edit( id ) 
     
    159175        #- del now 
    160176        mission.pilots.remove( pilot ) 
     177        session['flash'] = _('Pilot %s removed of the mission')%pilot.name 
     178        session.save() 
    161179        meta.Session.commit() 
    162180        return self.edit( id ) 
Note: See TracChangeset for help on using the changeset viewer.