{% include 'formMacros.html' %} {% include 'pagerMacros.html' %} {% macro renderSnippets(items, pageUrl) %} {% if items %} {% for item in items %} {{ renderSnippet(item, pageUrl) }} {% endfor %} {% else %}

There are no snippets yet.

{% endif %} {% endmacro %} {% macro renderSnippet(item, pageUrl) %}
{% if not item.hideTitle %}

{% if item.url %} {% endif %} {{ item.title | e }} {% if item.url %} {% endif %}

{% endif %} {{ aposArea({ area: item.areas.body }) }}
{% endmacro %} {% macro snippetText(name, label, options = {}) %} {{ formText(name, label, options) }} {% endmacro %} {% macro snippetEmail(name, label) %} {{ formEmail(name, label) }} {% endmacro %} {% macro snippetPassword(name, label) %} {{ formPassword(name, label) }} {% endmacro %} {# Less ambiguous to work with than a checkbox #} {% macro snippetBoolean(name, label) %} {{ formBoolean(name, label) }} {% endmacro %} {% macro snippetTags(name, label) %} {{ formTags(name, label) }} {% endmacro %} {% macro snippetTextarea(name, label) %} {{ formTextarea(name, label) }} {% endmacro %} {% macro snippetSelect(name, label, choices) %} {{ formSelect(name, label, choices) }} {% endmacro %} {% macro snippetDate(name, label) %} {{ formDate(name, label) }} {% endmacro %} {% macro snippetTime(name, label) %} {{ formTime(name, label) }} {% endmacro %} {# See enableArea in snippets' main.js for the necessary plumbing, including #} {# specifying the type we want for the singleton #} {% macro snippetSingleton(name, label) %} {{ formSingleton(name, label) }} {% endmacro %} {# See enableArea in snippets' main.js for the necessary plumbing #} {% macro snippetArea(name, label) %} {{ formArea(name, label) }} {% endmacro %} {# A pill button with several mutually exclusive choices #} {% macro snippetPill(name, label, options) %} {{ formPill(name, label, options) }} {% endmacro %} {# Just the pill button group itself, no fieldset #} {% macro snippetPillStandalone(name, options) %} {{ formPillStandalone(name, options) }} {% endmacro %} {# These promote a consistent interface in the various "manage" dialogs for types #} {% macro snippetNewButtons() %} {% endmacro %} {% macro snippetEditButtons() %} {% endmacro %} {# See $.selective in content.js for the necessary plumbing #} {% macro snippetSelective(name, label, options) %} {{ formSelective(name, label, options) }} {% endmacro %} {% macro snippetTrashFilter() %} {{ snippetPillStandalone('trash', [ { value: '0', label: 'Live' }, { value: '1', label: 'Trash' } ] ) }} {% endmacro %} {% macro snippetPublishedFilter() %} {{ snippetPillStandalone('published', [ { value: '1', label: 'Published' }, { value: '0', label: 'Draft' }, { value: 'any', label: 'Both' } ] ) }} {% endmacro %} {% macro snippetSearchFilter() %} {# In user testing we found that leaving out the submit button isn't great. #} {# So if you remove it, make sure some other clickable thing is visible. -Tom #} Search: x {% endmacro %} {# Standard filters suitable for all snippet derivatives. Does not include date filter. #} {# You can call the filters separately to change the order or skip or add things. #} {% macro snippetFilters() %} {{ snippetTrashFilter() }} {{ snippetPublishedFilter() }} {{ snippetSearchFilter() }} {% endmacro %} {# Events and related subclasses of snippets use this one. #} {% macro snippetDateFilter() %} {{ snippetPillStandalone('date', [ { value: 'past', label: 'Past' }, { value: 'future', label: 'Future' }, { value: 'all', label: 'All' } ] ) }} {% endmacro %} {% include "schemas:schemaMacros.html" %} {% macro snippetAllFields(fields, options = { from: false, to: false, except: [], only: false }) %} {{ schemaFields(fields, options) }} {% endmacro %}