aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/indexedsearch/templates
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-02-28 10:20:36 +0800
committerJesús <heckyel@hyperbola.info>2022-02-28 10:20:36 +0800
commit51b14efa4807dcfb1ce5c35556166ae17acac154 (patch)
tree7ddb997bfe6f03dbf7934f3fb59bc44ed3f42d95 /mediagoblin/plugins/indexedsearch/templates
parent1079d1cee4a1389a6b697ae7e08a1c6835adcd52 (diff)
downloadmediagoblin-51b14efa4807dcfb1ce5c35556166ae17acac154.tar.lz
mediagoblin-51b14efa4807dcfb1ce5c35556166ae17acac154.tar.xz
mediagoblin-51b14efa4807dcfb1ce5c35556166ae17acac154.zip
Add Search plugin: indexedsearch
Diffstat (limited to 'mediagoblin/plugins/indexedsearch/templates')
-rw-r--r--mediagoblin/plugins/indexedsearch/templates/indexedsearch/base_search_link.html21
-rw-r--r--mediagoblin/plugins/indexedsearch/templates/indexedsearch/results.html36
-rw-r--r--mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_button.html24
-rw-r--r--mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_form.html30
-rw-r--r--mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_link.html24
-rw-r--r--mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_none.html17
6 files changed, 152 insertions, 0 deletions
diff --git a/mediagoblin/plugins/indexedsearch/templates/indexedsearch/base_search_link.html b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/base_search_link.html
new file mode 100644
index 00000000..84868379
--- /dev/null
+++ b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/base_search_link.html
@@ -0,0 +1,21 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+
+{% if request.user or not global_config['plugins']['mediagoblin.plugins.indexedsearch']['USERS_ONLY']%}
+ {% block search_link_header %}{% endblock %}
+{% endif %}
diff --git a/mediagoblin/plugins/indexedsearch/templates/indexedsearch/results.html b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/results.html
new file mode 100644
index 00000000..785a276f
--- /dev/null
+++ b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/results.html
@@ -0,0 +1,36 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{% extends "mediagoblin/base.html" %}
+{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
+
+{% from "mediagoblin/utils/object_gallery.html" import object_gallery %}
+
+{% block mediagoblin_head -%}
+{%- endblock mediagoblin_head %}
+
+{% block mediagoblin_content %}
+ {% if form.show == true %}
+ <form id="search" method="GET" action="{{ request.urlgen('mediagoblin.plugins.indexedsearch') }}">
+ {{ wtforms_util.render_divs(form) }}
+ <input type="submit" value="{% trans %}Search{% endtrans %}" class="button_action" />
+ </form>
+ {% endif %}
+
+ <h2>{% trans %}Search results{% endtrans %}</h2>
+ {{ object_gallery(request, media_entries, pagination) }}
+{% endblock %}
diff --git a/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_button.html b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_button.html
new file mode 100644
index 00000000..3095fea9
--- /dev/null
+++ b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_button.html
@@ -0,0 +1,24 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+
+{% extends "indexedsearch/base_search_link.html" %}
+{% block search_link_header %}
+ <a class="button_action" href="{{ request.urlgen('mediagoblin.plugins.indexedsearch') }}">
+ {%- trans %}Search{% endtrans -%}
+ </a>
+{% endblock %}
diff --git a/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_form.html b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_form.html
new file mode 100644
index 00000000..9bc4dc21
--- /dev/null
+++ b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_form.html
@@ -0,0 +1,30 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+
+<style>
+ .indexedsearch {
+ display: inline;
+ }
+</style>
+
+{% extends "indexedsearch/base_search_link.html" %}
+{% block search_link_header %}
+ <form class="indexedsearch" method="GET" action="{{ request.urlgen('mediagoblin.plugins.indexedsearch') }}">
+ <input type="text" name="q" placeholder="{%- trans %}Search...{% endtrans -%}">
+ </form>
+{% endblock %}
diff --git a/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_link.html b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_link.html
new file mode 100644
index 00000000..15dd2a6a
--- /dev/null
+++ b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_link.html
@@ -0,0 +1,24 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+
+{% extends "indexedsearch/base_search_link.html" %}
+{% block search_link_header %}
+ <a href="{{ request.urlgen('mediagoblin.plugins.indexedsearch') }}">
+ {%- trans %}Search{% endtrans -%}
+ </a>&nbsp;&nbsp;
+{% endblock %}
diff --git a/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_none.html b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_none.html
new file mode 100644
index 00000000..6fa5ae59
--- /dev/null
+++ b/mediagoblin/plugins/indexedsearch/templates/indexedsearch/search_link_none.html
@@ -0,0 +1,17 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}