Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
112bba7b
Commit
112bba7b
authored
Jul 16, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
88030a10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
85 deletions
+0
-85
wiki/search_indexes.py
+0
-19
wiki/templates/search/indexes/wiki/article_text.txt
+0
-2
wiki/templates/search/search.html
+0
-64
No files found.
wiki/search_indexes.py
deleted
100644 → 0
View file @
88030a10
from
haystack
import
indexes
from
wiki
import
models
class
ArticleIndex
(
indexes
.
SearchIndex
,
indexes
.
Indexable
):
text
=
indexes
.
CharField
(
document
=
True
,
use_template
=
True
)
created
=
indexes
.
DateTimeField
(
model_attr
=
'created'
)
modified
=
indexes
.
DateTimeField
(
model_attr
=
'modified'
)
#default because indexing fails with whoosh. see.
#http://stackoverflow.com/questions/11995367/how-do-i-use-a-boolean-field-in-django-haystack-search-query
#https://github.com/toastdriven/django-haystack/issues/382
other_read
=
indexes
.
BooleanField
(
model_attr
=
'other_read'
,
default
=
False
)
def
get_model
(
self
):
return
models
.
Article
def
index_queryset
(
self
,
using
=
None
):
"""Used when the entire index for model is updated."""
return
self
.
get_model
()
.
objects
.
all
()
wiki/templates/search/indexes/wiki/article_text.txt
deleted
100644 → 0
View file @
88030a10
{{ object.current_revision.title }}
{{ object.current_revision.content }}
wiki/templates/search/search.html
deleted
100644 → 0
View file @
88030a10
{% extends "wiki/base.html" %}
{% load wiki_tags i18n humanize highlight %}
{% load url from future %}
{% block pagetitle %}{% trans "Search results for:" %} {{ search_query }}{% endblock %}
{% block wiki_contents %}
<h1
class=
"page-header"
>
{% trans "Search results for:" %} {{ search_query }}
</h1>
<form
class=
"form-search directory-toolbar"
>
<p
class=
"lead"
>
<div
class=
"pull-right"
>
{{ query }}
<button
class=
"btn"
><span
class=
"icon-search"
></span></button>
</div>
<p>
{% blocktrans with page.paginator.count as cnt %}Your search returned
<strong>
{{ cnt }}
</strong>
results.{% endblocktrans %}
</p>
<div
class=
"clearfix"
></div>
</p>
</form>
<table
class=
"table table-striped"
>
<tr>
<th
style=
"width: 75%"
>
{% trans "Title" %}
</th>
<th>
{% trans "Last modified" %}
</th>
</tr>
{% with articles=page.object_list %}
{% for article in articles %}
{% with article=article.object %}
<tr>
<td>
{% for urlpath in article.urlpath_set.all %}
<a
href=
"{% url 'wiki:get' path=urlpath.path %}"
>
{{ article.current_revision.title }}
<br
/><small
class=
"muted"
>
/{{ urlpath.path }}
</small></a>
{% empty %}
<a
href=
"{% url 'wiki:get' article_id=article.id %}"
>
{{ article.current_revision.title }}
</a>
{% endfor %}
{% if article.current_revision.deleted %}
<span
class=
"icon-trash"
></span>
{% endif %}
{% if article.current_revision.locked %}
<span
class=
"icon-lock"
></span>
{% endif %}
<p
class=
"muted"
><small>
{% if article.current_revision %}{% highlight article.current_revision.content with query html_tag "strong" max_length 400 %}{% endif %}
</small></p>
</td>
<td
style=
"white-space: nowrap"
>
{{ article.current_revision.created|naturaltime }}
</td>
</tr>
{% endwith %}
{% empty%}
<tr>
<td
colspan=
"100"
>
<em>
{% trans "There are no articles in this level" %}
</em>
</td>
</tr>
{% endfor %}
{% endwith %}
</table>
{% include "wiki/includes/pagination.html" %}
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment