Example #1
0
 def item(self, hit):
   return {
     'url': self.hit_url(hit)
   , 'title': hit.title
   , 'location': hit.location
   , 'time': unix_timestamp(hit.time)
   , 'key': str(hit.key())
   , 'added': datetime_format(hit.added)
   }
Example #2
0
 def item(self, hit):
     return {
         'url': self.hit_url(hit),
         'title': hit.title,
         'location': hit.location,
         'time': unix_timestamp(hit.time),
         'key': str(hit.key()),
         'added': datetime_format(hit.added)
     }
Example #3
0
    def get(self):
        user = users.get_current_user()
        type = self.get_value('type', required=False)
        type = self.map_type(type)

        self.render('priv/hit_list.html', {
            'user': user,
            'type': type,
            'time': datetime_format(datetime.utcnow())
        })
Example #4
0
  def get(self, key):
    hit = HIT.get(key)

    if hit:
      if hit.focal_time:
        focal_time = datetime_format(hit.focal_time)
      else:
        focal_time = None

      self.render('priv/hit_detail.html', {
        'hit': hit
      , 'hit_group_url': hit_group_url(hit)
      , 'added': datetime_format(hit.added)
      , 'timestamp': json.dumps(unix_timestamp(hit.time))
      , 'workers_url': json.dumps(self.hit_workers_url(hit))
      , 'cancel_url': json.dumps(self.hit_cancel_url(hit))
      , 'user': users.get_current_user()
      , 'focal_time': focal_time
      })
    else:
      self.not_found()
Example #5
0
    def get(self, key):
        hit = HIT.get(key)

        if hit:
            if hit.focal_time:
                focal_time = datetime_format(hit.focal_time)
            else:
                focal_time = None

            self.render(
                'priv/hit_detail.html', {
                    'hit': hit,
                    'hit_group_url': hit_group_url(hit),
                    'added': datetime_format(hit.added),
                    'timestamp': json.dumps(unix_timestamp(hit.time)),
                    'workers_url': json.dumps(self.hit_workers_url(hit)),
                    'cancel_url': json.dumps(self.hit_cancel_url(hit)),
                    'user': users.get_current_user(),
                    'focal_time': focal_time
                })
        else:
            self.not_found()
Example #6
0
 def get(self):
   self.json(datetime_format(datetime.utcnow()))
Example #7
0
  def get(self):
    user = users.get_current_user()
    type = self.get_value('type', required=False)
    type = self.map_type(type)

    self.render('priv/hit_list.html', {'user': user, 'type': type, 'time': datetime_format(datetime.utcnow())})
Example #8
0
 def get(self):
     self.json(datetime_format(datetime.utcnow()))