<%def name="formatting()">
${h.help_link(_("formatting hints"), 'formatting')|n}
<%def name="freetext(name, placeholder=None)"> ${formatting()} <%def name="headline()"> <%def name="admin_controls()">
${caller.body()}
<%def name="build_infobox()">
close ${caller.body()}
<%def name="flashmessages()"> <% messages = h.sorted_flash_messages() %> %if messages: %for message in messages:
x ${message.message|n}
%endfor %endif <%def name="savebox(cancel_url, save_text=None, save_value='save')"> <% save_text = save_text if save_text is not None else _("Save") %>
%if cancel_url is not None: ${_("or")} ${_("cancel")} %endif
<%def name="form_watch(entity, checked=False)"> %if can.watch.create(): <% if entity: checked = checked or (h.find_watch(entity) is not None) %> %endif <%def name="watch(entity, id=None, show_skip=True)"> ## FIXME: turn into an ajax call %if c.user: <% if isinstance(entity, model.Page): follow_text = _("Follow Norm") elif isinstance(entity, model.Instance): follow_text = _("Follow Instance") elif isinstance(entity, model.Proposal): follow_text = _("Follow Proposal") elif isinstance(entity, model.Milestone): follow_text = _("Follow Milestone") elif isinstance(entity, model.User): follow_text = _("Follow User") elif isinstance(entity, model.Comment): follow_text = _("Follow Comment") elif isinstance(entity, model.Tag): follow_text = _("Follow Tag") else: log.error('Unknown entity for watch button: %s' % entity) if id is None: id_attr = '' else: id_attr = 'id=%s'%id skip = False watch = h.find_watch(entity) if watch and can.watch.delete(watch): css_cls = "active" text = _('Following') hover_text = _('Unfollow') tooltip = _('Disable email notifications.') href = h.base_url('/watch/delete?%s' % h.url_token(), query_params={'watch': str(watch.id)}) elif not watch and can.watch.create(): css_cls = "" text = hover_text = follow_text tooltip = _('Receive email notifications if changes occur.') href = h.base_url('/watch/create?%s' % h.url_token(), query_params={'ref': str(h.make_watch(entity))}) else: skip = True %> %if skip: %if show_skip:
<%doc> placeholder div to fill the space if we cannot render a widget. FIXME: What if a user is authenticated, but is not allowed to watch/unwatch
%endif %else: ${text} %endif %else: ## (not c.user)
<%doc> FIXME: render a replacement with auth instructions. Problem: FIXME: How to determinate if login and join the instance is enough?
%endif <%def name="message_button(entity)"> <% if isinstance(entity, model.Instance): # not yet implemented text = _("Message to Members") elif isinstance(entity, model.Proposal): text = _("Message") elif isinstance(entity, model.User): text = _("Message") else: log.error('Unknown entity for message button: %s' % entity) if isinstance(entity, model.User): permission = can.user.message(entity) elif isinstance(entity, model.Proposal): permission = can.proposal.message(entity) else: permission = can.instance.message(c.instance) href = h.entity_url(entity, member='message/new') %> %if permission: ${text} %endif <%def name="vertical_tabs(items, css_class, current_variant=None)"> <%def name="social_share_buttons(title)"> %if h.config.get_bool('adhocracy.show_social_buttons'): <% h.need.socialshareprivacy base_url = h.get_socialshareprivacy_url() text = "%s - %s: %s" % (h.site.name(), c.instance.label, title) %>
%endif <%def name="head(title_def=None)"> <% if title_def is None: local_title = '' else: local_title = capture(title_def) full_title = '%s%s%s' % ( local_title + ' - ' if local_title else '', c.instance.label + ' - ' if c.instance else '', h.site.name()) %> ${full_title} %for key, value in c.html_meta.items(): %endfor <% h.instance.need_stylesheet(c.instance) h.need.modernizr h.need.jquery h.need.jquerytools h.need.elastic h.need.adhocracy h.need_js_i18n('moment') %> %if c.instance and c.instance.css: %endif %for link in c.html_head_links: %endfor %if c.user and c.user.no_help: %endif ${tiles.badge.badge_styles(c.instance)} <%def name="tutorial()"> %if h.tutorial.show(c.tutorial, c.user): <% h.need.joyride %> ${caller.body()} %endif <%def name="feedback()">
${h.field_token()|n}
${_(u'Send us your feedback')} %if h.feedback.get_categories(): %endif
${_(u'List existing feedback')}
${_(u'Feedback')}
<%def name="category_select(id, toplevel_question, categories, selected=None)"> <% h.need.select_hierarchy %>
${_('Proposal Category')} %if selected: <% (cat_id, key) = selected %> %else: %if toplevel_question is not None:
${toplevel_question}
%endif
%endif
<%def name="proposal_sort_order(name, sorting_orders, include_empty=True, default=None)"> ## Makes sure the rebindCameFrom javascript function is only called if the patched target wouldn't also lead to a 403. ## If the rebindCameFrom function isn't called, we usually (in these cases) redirect to the page we came from. <%def name="add_patch_camefrom_class()">${u'' if c.instance and c.instance.requires_valid_email() else u'patch_camefrom'} <%def name="attention_getter()"> <% show_attention_getter = ( not h.config.get_bool(u'adhocracy.readonly') and c.instance is not None and (c.user is None or can.instance.join(c.instance) or (c.instance.requires_valid_email() and c.user and not c.user.is_email_activated() and not c.hide_activate_attention_getter) or (h.config.get('adhocracy.propose_optional_attributes') and c.user.optional_attributes is None))) %> %if show_attention_getter:
%if c.user is None:
%if h.allow_user_registration(): ${_('Register')} ${_("or")} %endif ${_('Login')}

%if h.allow_user_registration(): ${_('Get an account to participate in the discussion.')} %else: ${_('Log in to participate in the discussion.')} %endif

%elif can.instance.join(c.instance):

${_('Join this instance to start contributing.')}

%elif c.instance.require_valid_email and c.user and not c.user.is_email_activated(): %if c.user.email is None:

${_('You need to set an email in your profile in order to contribute to this instance.')}

%else:

${_('Please validate your email address in order to contribute to this instance.')}
${_('Your registered email address is:')} ${c.user.email}

%endif %else: # h.config.get('adhocracy.propose_optional_attributes') and c.user.optional_attributes is None)):

${_(u'Please provide statistical information to help scientific evaluation!')}

%endif
%endif <%def name="hidden_badge_table(tables, badge_type, badge_label)"> <% badge_id = '%s_badge_tables' % badge_type %>
${_(u'Show %s') % badge_label}
<%def name="category_link(category)"> %if category.instance is not None and category.instance.display_category_pages: ${category} %else: ${category} %endif