%inherit file="/template.html" /> <%namespace name="tiles" file="/badge/tiles.html"/> <%namespace name="components" file="/components.html"/> <%def name="title()">${_("Badges")}%def> <%def name="breadcrumbs()"> ${h.badge.breadcrumbs(None)|n} %def> <%def name="edit_button(base_url, badge_id)"> ${_('Edit')} %def> <%def name="delete_button(base_url, badge_id)"> ${_('Delete')} %def> <%def name="new_button(base_url, type_, is_global)"> ${_("New")} %def> <%def name="render_table(badges, base_url, type_, show_header, is_global)"> %if badges is not None: <% table_def = { 'user': user_badges_table, 'delegateable': delegateable_badges_table, 'category': category_badges_table, 'thumbnail': thumbnail_badges_table, 'instance': instance_badges_table, }.get(type_) %> %if show_header:
${_("No badges added yet.")}
%endif %endif %def> <%def name="render_context_tables()"> ${render_tables(c.global_badges, c.instance_badges, c.badge_base_url, c.badge_header, c.badge_type)} %def> <%def name="render_tables(global_badges, instance_badges, base_url, title, type_)"> <% single_table = global_badges is None or instance_badges is None %>${_("User badges allow you to organize your members according to certain groups.")}
%elif type_ == 'delegateable':${_("Proposal badges may be used to link different attributes to a proposal (e.g. official, first phase, etc.).")}
%elif type_ == 'category':${_("Add new categories to allow your users to categorize their proposals according to a topic.")}
%elif type_ == 'thumbnail':${_("Status badges may be used to indicate different statuses of proposals in your participation process (e.g. accepted, rejected, in discussion, etc.) with an image.")}
%endif ${render_table(global_badges, base_url, type_, not single_table, True)} ${render_table(instance_badges, base_url, type_, not single_table, False)} %def> <%def name="user_badges_table(base_url, badge_items)">${_("Title")} | ${_("Description")} | ${_("Preview")} | ${_("Assigned Group")} | ${_("Display")} | ${_("Actions")} | %for badge in badge_items:
---|---|---|---|---|---|
${badge.title} | ${badge.description and (badge.description[:20] + u'...') or ''} | ${tiles.badge(badge)} | ${badge.group and badge.group.group_name or ""} | ${badge.display_group and _("yes") or _("no")} | ${edit_button(base_url, badge.id)} ${delete_button(base_url, badge.id)} |
${_("Title")} | ${_("Description")} | ${_("Preview")} | ${_("Impact")} | ${_("Actions")} | %for badge in badge_items:
---|---|---|---|---|
${badge.title} | ${badge.description and (badge.description[:20] + u'...') or ''} | ${tiles.badge(badge)} | ${badge.impact} | ${edit_button(base_url, badge.id)} ${delete_button(base_url, badge.id)} |
${_("Title")} | ${_("Description")} | ${_("Preview")} | ${_("Actions")} | %for badge in badge_items:
---|---|---|---|
${badge.title} | ${badge.description and (badge.description[:20] + u'...') or ''} | ${tiles.badge(badge)} | ${edit_button(base_url, badge.id)} ${delete_button(base_url, badge.id)} |
${_("Title")} | ${_("Description")} | ${_("Preview")} | ${_("Impact")} | ${_("Parent")} | ${_("Actions")} | %for badge in badge_items:
---|---|---|---|---|---|
${badge.title} | ${badge.description and (badge.description[:20] + u'...') or ''} | ${tiles.badge(badge)} | ${badge.impact} | ${badge.parent.title if badge.parent else ""} | ${edit_button(base_url, badge.id)} ${delete_button(base_url, badge.id)} |
${_("Title")} | ${_("Description")} | ${_("Preview")} | ${_("Impact")} | ${_("Actions")} | %for badge in badge_items:
---|---|---|---|---|
${badge.title} | ${(badge.description[:20] + u'...' if len(badge.description) > 20 else badge.description) if badge.description else u''} | ${tiles.badge(badge)} | ${badge.impact} | ${edit_button(base_url, badge.id)} ${delete_button(base_url, badge.id)} |