# HG changeset patch # User Goffi # Date 1607596144 -3600 # Node ID fbea1b9a558fd2a43115508dda3e7028850dde7c # Parent 1de599c5a68f3a90260f11aba2f6fcf5898a6772 bulma: new search box, used in blog for now diff -r 1de599c5a68f -r fbea1b9a558f sat_templates/templates/bulma/blog/articles.html --- a/sat_templates/templates/bulma/blog/articles.html Fri Nov 27 12:24:03 2020 +0100 +++ b/sat_templates/templates/bulma/blog/articles.html Thu Dec 10 11:29:04 2020 +0100 @@ -5,6 +5,7 @@ {% import 'components/avatar.html' as avatar with context %} {% import 'blog/macros.html' as blog with context %} {% import 'input/navigation.html' as navigation with context %} +{% import 'input/textbox.html' as textbox with context %} {%- block title scoped -%} {%- if blog_page -%} @@ -23,6 +24,15 @@ {% if blog_items['items'] %}
+
{{ blog.show_items(blog_items['items'], expanded=single) }} diff -r 1de599c5a68f -r fbea1b9a558f sat_templates/templates/bulma/input/field.html --- a/sat_templates/templates/bulma/input/field.html Fri Nov 27 12:24:03 2020 +0100 +++ b/sat_templates/templates/bulma/input/field.html Thu Dec 10 11:29:04 2020 +0100 @@ -27,6 +27,9 @@ {% if help %}

{{help}}

{% endif %} + {% if caller %} + {{ caller() }} + {% endif %}
{% endmacro %} @@ -67,7 +70,7 @@ {% endmacro %} {% macro text(name, label="", value=none, class='', placeholder=none, required=false, pattern=none, title=none, autocomplete=none, icon_left=none, icon_right=none) %} - {{ field("text", name=name, label=label, value=value, class=class, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'placeholder': placeholder, 'pattern': pattern, 'title': title, 'autocomplete': autocomplete}) }} + {{ field("text", name=name, label=label, value=value, class=class, required=required, icon_left=icon_left, icon_right=icon_right, attrs={'placeholder': placeholder, 'pattern': pattern, 'title': title, 'autocomplete': autocomplete}, caller=caller) }} {% endmacro %} {% macro password(name, label="", value=none, required=false, minlength=none, icon_left=none, icon_right=none) %} diff -r 1de599c5a68f -r fbea1b9a558f sat_templates/templates/bulma/input/form.html --- a/sat_templates/templates/bulma/input/form.html Fri Nov 27 12:24:03 2020 +0100 +++ b/sat_templates/templates/bulma/input/form.html Thu Dec 10 11:29:04 2020 +0100 @@ -1,8 +1,8 @@ -{% macro form(action='', class=none, id=none) %} -
- {% if csrf_token is defined %} - - {% endif %} - {{ caller() }} -
+{% macro form(action='', class=none, id=none, method="post", use_csrf_token=true) %} +
+ {% if csrf_token is defined and use_csrf_token %} + + {% endif %} + {{ caller() }} +
{% endmacro %} diff -r 1de599c5a68f -r fbea1b9a558f sat_templates/templates/bulma/input/textbox.html --- a/sat_templates/templates/bulma/input/textbox.html Fri Nov 27 12:24:03 2020 +0100 +++ b/sat_templates/templates/bulma/input/textbox.html Thu Dec 10 11:29:04 2020 +0100 @@ -77,3 +77,11 @@
{% endif %} {% endmacro %} + +{% macro search() %} + {% call form.form(method="get", use_csrf_token=false) %} + {% call field.text("search", class="has-addons", required=true, icon_left="search") %} + {{ field.submit(_("Search")) }} + {% endcall %} + {% endcall %} +{% endmacro %}