Browse Source

remove not functional old search

Casper Van Gheluwe 11 years ago
parent
commit
cffb529947

+ 1 - 19
flaskbb/forum/views.py

@@ -500,22 +500,4 @@ def untrack_topic(topic_id, slug=None):
     topic = Topic.query.filter_by(id=topic_id).first_or_404()
     topic = Topic.query.filter_by(id=topic_id).first_or_404()
     current_user.untrack_topic(topic)
     current_user.untrack_topic(topic)
     current_user.save()
     current_user.save()
-    return redirect(topic.url)
-
-
-@forum.route("/search", methods=['GET', 'POST'])
-def search_forum():
-
-    if not current_user.is_authenticated():
-        flash("You need to be logged in for that feature.", "danger")
-        return redirect(url_for("forum.index"))
-
-    form = SearchForm()
-    if form.validate_on_submit():
-        result_type = form.get_types()
-        result_list = form.get_results()
-        print(result_list)
-        return render_template("forum/search_result.html",
-                               results=result_list)
-    else:
-        return render_template("forum/search.html", form=form)
+    return redirect(topic.url)

+ 0 - 21
flaskbb/templates/forum/search.html

@@ -1,21 +0,0 @@
-{% set page_title = "Search Forum" %}
-{% set active_forum_nav=True %}
-
-{% extends theme("layout.html") %}
-
-{% block navigation %}
-{% endblock %}
-
-{% block content %}
-{% from theme("macros.html") import render_field %}
-
-<form class="form" role="form" method="post">
-    {{ form.hidden_tag() }}
-    <h3>Search Forum</h3>
-
-    {{ render_field(form.search_types) }}
-    {{ render_field(form.search_query) }}
-
-    <button type="submit" class="btn btn-success">Search</button>
-</form>
-{% endblock %}

+ 0 - 99
flaskbb/templates/forum/search_result.html

@@ -1,99 +0,0 @@
-{% set page_title = "Search Results" %}
-{% set active_forum_nav=True %}
-
-{% extends theme("layout.html") %}
-{% block content %}
-    {% from theme('macros.html') import render_pagination %}
-
-    {% if results['user'] %}
-    <table class="table table-bordered" style="vertical-align: middle">
-        <thead>
-        <tr>
-            <th colspan="7">
-                Users
-            </th>
-        </tr>
-        </thead>
-
-        <tbody>
-        <tr>
-            <td colspan="2">Username</td>
-            <td>E-mail</td>
-            <td>Joined</td>
-            <td>Last seen</td>
-            <td>Post count</td>
-        </tr>
-
-        {% for user in results['user'] %}
-            <tr>
-                <td>
-                    {% if user|is_online %}
-                        <span class="label label-success">Online</span>
-                    {% else %}
-                        <span class="label label-default">Offline</span>
-                    {% endif %}
-                </td>
-                <td>
-                    <a href="{{ user.url }}">{{ user.username }}</a>
-                </td>
-                <td>
-                    <a href="mailto:{{ user.email }}">{{ user.email }}</a>
-                </td>
-                <td>
-                    {{ user.date_joined|format_date('%b %d %Y') }}
-                </td>
-                <td>
-                    {%- if user.lastseen -%} {{ user.lastseen|time_since }} {%- else -%} Never seen {%- endif -%}
-                </td>
-                <td>
-                    {{ user.post_count }}
-                </td>
-            </tr>
-        {% endfor %}
-        </tbody>
-    </table>
-    {% endif %}
-
-    {% if results['post'] %}
-        <table class="table table-bordered" style="vertical-align: middle">
-            <thead>
-            <tr>
-                <th colspan="7">
-                    Posts
-                </th>
-            </tr>
-            </thead>
-
-            <tbody>
-
-            {% for post in results['post'] %}
-                <tr>
-                    <td >
-                <span class="pull-right">
-                    <strong>#{%- if posts.page == 1 -%} {{ loop.index }} {%- else -%} {{ loop.index + (posts.page - 1) * config["POSTS_PER_PAGE"] }} {%- endif -%}</strong>
-                </span>
-                <span class="pull-left">
-                    <a href="
-                    {%- if posts.page > 1 -%}
-                        {{ topic.url }}?page={{ posts.page }}#pid{{ post.id }}
-                    {%- else -%}
-                        {{ topic.url }}#pid{{ post.id }}
-                    {%- endif -%}
-                        ">{{ post.date_created|format_date('%d %B %Y') }}</a>
-                    {% if post.user_id and post.date_modified %}
-                        <small>
-                            (Last modified: {{ post.date_modified|format_date }} by
-                            <a href="{{ url_for('user.profile', username=post.modified_by) }}">
-                                {{ post.modified_by }}
-                            </a>.)
-                        </small>
-                    {% endif %}
-                </span>
-                    </td>
-                </tr>
-            {% endfor %}
-            </tbody>
-        </table>
-    {% endif %}
-
-{% endblock %}