Exemplo n.º 1
0
def categories(request):
    """
   Returns a page-full of categories (like a tag cloud)
   """
    context = wegblob_settings.config
    context["tags"] = db.get_tags()
    return render_to_response("wegblob-categories.html", context, context_instance=RequestContext(request))
Exemplo n.º 2
0
def categories(request):
    """
   Returns a page-full of categories (like a tag cloud)
   """
    context = wegblob_settings.config
    context['tags'] = db.get_tags()
    return render_to_response('wegblob-categories.html',
                              context,
                              context_instance=RequestContext(request))
Exemplo n.º 3
0
def edit_conferences():
	conferences = db.conferences()
	parents = [ (None, '') ] + [
		(c.conference, '%s: %s' % (c.abbreviation, c.name)) for c in conferences
	]

	tags = dict(db.get_tags())

	return flask.render_template('edit/conferences.html',
			table = 'Conferences',
			tags = tags,
			conferences = conferences,
			parents = parents,
			prototype = event.Event,
		)
Exemplo n.º 4
0
def main():
	""" Main "entry point" for the site. """

	# What tags are we using to filter results?
	tag_names = utils.tags()
	current_tags = [ id for (id, name) in db.get_tags(tag_names) ]
	if len(tag_names) == 0: tag_names = None

	# Render from the 'main' template.
	return flask.render_template('main.html',
			tags = tag_names,
			deadlines = db.deadlines(current_tags),
			upcoming = db.upcoming(current_tags),
			recent = db.recent(current_tags),
			utils = utils)
Exemplo n.º 5
0
def edit_conference(abbreviation):
	""" Edit a particular conference (e.g. all events). """
	(conference, events) = db.conference_events(abbreviation = abbreviation)

	conferences = [
		(c.conference, '%s: %s' % (c.abbreviation, c.name))
			for c in db.conferences() ]

	locations = [
		(l.location_id, l.where()) for l in db.locations() ]

	meeting_types = [ (m.type_id, m.name) for m in db.meeting_types() ]

	return flask.render_template('edit/conference.html',
			all_tags = [ name for (id, name) in db.get_tags() ],
			conferences = conferences,
			conference = conference,
			events = events,
			locations = locations,
			meeting_types = meeting_types,
		)
Exemplo n.º 6
0
def all_tags():
    return jsonify(get_tags())
Exemplo n.º 7
0
 def get(self):
     index = self.get_argument("index", None)
     entry = db.get_entry(index) if index else None
     tags = db.get_tags()
     tags = tags and " ".join([t.name for t in tags]) or ""
     self.render("compose.html", entry=entry, tags=tags)
Exemplo n.º 8
0
 def get(self):
     index = self.get_argument("index", None)
     entry = db.get_entry(index) if index else None
     tags = db.get_tags()
     tags = tags and " ".join([t.name for t in tags]) or ""
     self.render("compose.html", entry=entry, tags=tags)
Exemplo n.º 9
0
 def render(self):
     return self.render_string("modules/tags.html", tags=get_tags())
Exemplo n.º 10
0
def prefs():
	""" Ask the user for preferences. """
	return flask.render_template('prefs.html',
			all_tags = db.get_tags(),
			current_tags = utils.tags()
		)
Exemplo n.º 11
0
def tags(s):
	if valid_tags.match(s):
		names = [ name.strip() for name in s.split(',') ]
		values = [ str(i) for (i,name) in db.get_tags(names) ]
		return ','.join(values)
	else: raise ValueError, "'%s' is not database-safe text" % s
Exemplo n.º 12
0
def get_tags():
    startswith = request.GET.get("startswith")
    tags = db.get_tags(startswith)
    return json.dumps(tags)