示例#1
0
文件: main.py 项目: btubbs/hd-events
 def get(self, id):
     event = Event.get_by_id(int(id))
     user = users.get_current_user()
     if user:
         is_admin = username(user) in dojo('/groups/events')
         is_staff = username(user) in dojo('/groups/staff')
         can_approve = (event.status in ['pending'] and is_admin)
         can_staff = (event.status in ['pending', 'understaffed', 'approved'] and is_staff and not user in event.staff)
         logout_url = users.create_logout_url('/')
     else:
         login_url = users.create_login_url('/')
     self.response.out.write(template.render('templates/event.html', locals()))
示例#2
0
文件: main.py 项目: btubbs/hd-events
    def post(self, id):
        event = Event.get_by_id(int(id))
        user = users.get_current_user()
        is_admin = username(user) in dojo('/groups/events')
        is_staff = username(user) in dojo('/groups/staff')
        state = self.request.get('state')
        if state:
            if state.lower() == 'approve' and is_admin:
                event.approve()
            if state.lower() == 'staff' and is_staff:
                event.add_staff(user)
            if state.lower() == 'cancel' and is_admin:
                event.cancel()
            if state.lower() == 'expire' and is_admin:
                event.expire()

            if event.status == 'approved':
                notify_owner_approved(event)
        self.redirect('/event/%s-%s' % (event.key().id(), slugify(event.name)))
示例#3
0
文件: main.py 项目: btubbs/hd-events
 def get(self):
     user = users.get_current_user()
     if user:
         logout_url = users.create_logout_url('/')
     else:
         login_url = users.create_login_url('/')
     today = datetime.today()
     events = Event.all().filter('start_time < ', today).order('-start_time')
     is_admin = username(user) in dojo('/groups/events')
     self.response.out.write(template.render('templates/past.html', locals()))
示例#4
0
文件: main.py 项目: btubbs/hd-events
 def get(self):
     user = users.get_current_user()
     if user:
         logout_url = users.create_logout_url('/')
     else:
         login_url = users.create_login_url('/')
     events = Event.all().filter('member = ', user).order('start_time')
     today = datetime.today()
     tomorrow = today + timedelta(days=1)
     is_admin = username(user) in dojo('/groups/events')
     self.response.out.write(template.render('templates/myevents.html', locals()))
示例#5
0
文件: main.py 项目: btubbs/hd-events
 def get(self):
     user = users.get_current_user()
     if user:
         logout_url = users.create_logout_url('/')
     else:
         login_url = users.create_login_url('/')
     events = Event.get_pending_list()
     today = datetime.today()
     tomorrow = today + timedelta(days=1)
     is_admin = username(user) in dojo('/groups/events')
     self.response.out.write(template.render('templates/pending.html', locals()))
示例#6
0
文件: main.py 项目: kiwinoy/hd-events
 def post(self):
     noop = dojo('/groups/events',force=True)
示例#7
0
文件: main.py 项目: jernst/hd-events
 def get(self):
     noop = dojo('/groups/events',force=True)
示例#8
0
 def get(self):
     noop = dojo("/groups/events", force=True)