Commit c2cfcc2a by benjaoming

A few search related things... adding search bar (doesnt work yet)

parent 56d8e574
......@@ -350,4 +350,5 @@ class PermissionsForm(PluginSettingsFormMixin, forms.ModelForm):
class DirFilterForm(forms.Form):
query = forms.CharField(widget=forms.TextInput(attrs={'placeholder': _(u'Filter...')}))
query = forms.CharField(widget=forms.TextInput(attrs={'placeholder': _(u'Filter...'),
'class': 'search-query'}))
......@@ -62,6 +62,8 @@
color: #CCC;
}
.directory-toolbar .filter-clear { margin-right: 10px; position: relative; top: 5px; }
.accordion-heading h3 {margin: 0;}
.breadcrumb .icon-bar {
......@@ -74,6 +76,9 @@
margin-top: 3px;
}
.breadcrumb .icon-bar:first-child{margin-top: 0;}
#navbar_wiki_search input.search-query {width: 80px;}
</style>
<script src="{{ STATIC_URL }}wiki/js/jquery.min.js"></script>
......@@ -103,6 +108,10 @@
<span class="icon-bar"></span>
</a>
<a class="brand" href="{% url 'wiki:root' %}">django-wiki</a>
<form class="navbar-search pull-right" id="navbar_wiki_search" method="GET" action="asdsd">
<span class="icon-search"></span>
<input type="text" class="search-query" placeholder="{% trans "Search..." %}" />
</form>
<div class="pull-right">
{% if user.is_authenticated %}
<ul class="nav">
......
......@@ -6,32 +6,35 @@
{% block wiki_contents_tab %}
<form class="form-search">
{% url 'wiki:dir' urlpath.path as self_url %}
<form class="form-search directory-toolbar">
<div class="well well-small">
<div class="btn-group pull-left">
{% if urlpath.parent %}
<a href="{% url 'wiki:dir' path=urlpath.parent.path %}" class="btn">
<span class="icon-arrow-up"></span>
{% trans "Go up one level" %}
{% trans "Up one level" %}
</a>
{% endif %}
<a href="{% url 'wiki:create' path=urlpath.path %}" class="btn">
<span class="icon-plus"></span>
{% trans "Add article in this level" %}
{% trans "Add article" %}
</a>
</div>
<div class="pull-right">
{{ filter_form.query }}
<button class="btn">
<span class="icon-search"></span>
</button>
</div>
{% if filter_query %}
<div class="pull-right filter-clear">
<a href="{{ self_url }}">({% trans "clear" %})</a>
</div>
{% endif %}
<div class="clearfix"></div>
</div>
</form>
{% url 'wiki:get' urlpath.path as self_url %}
<p>
{% with paginator.object_list.count as cnt %}
{% blocktrans with urlpath.path as path and cnt|pluralize:_("article,articles") as articles_plur and cnt|pluralize:_("is,are") as articles_plur_verb %}
......@@ -40,10 +43,6 @@
{% endwith %}
</p>
{% if filter_query %}
<p>{% trans "Filtering by" %} <strong>{{ filter_query }}</strong> (<a href="{{ self_url }}">{% trans "clear" %}</a>).</p>
{% endif %}
<table class="table table-striped">
<tr>
<th>{% trans "Title" %}</th>
......
......@@ -400,7 +400,7 @@ class History(ListView, ArticleMixin):
return super(History, self).dispatch(request, article, *args, **kwargs)
class Dir(ListView, ArticleMixin, FormView):
class Dir(ListView, ArticleMixin):
template_name="wiki/dir.html"
allow_empty = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment