This repository has been archived by the owner on Apr 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
[wip] Search all documents #658
Open
janno42
wants to merge
4
commits into
fsr-de:master
Choose a base branch
from
julkw:search_all_documents
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% extends 'base_with_sidebar.html' %} | ||
{% load i18n %} | ||
|
||
{% block title %} | ||
{% blocktrans count counter=2 %}Documents{% plural %}Documents{% endblocktrans %} | ||
{% endblock %} | ||
|
||
{% block sidebar %} | ||
<div class="toc hidden-print"> | ||
<ul> | ||
{% for type, documents in searched_documents %} | ||
<li><a href="#type{{ type }}">{{ type }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{% for type, documents in searched_documents %} | ||
<h3 id="type{{ type }}">{{ type }}</h3> | ||
<table class="table table-striped"> | ||
{% for document, lines in documents %} | ||
<tr> | ||
<td style="width: 55%;"> | ||
<a href="{{ document.get_view_url }}">{{ document.title}} {{ document.date| date:"d.m.Y" }}</a> | ||
<ul class="minutes-lines"> | ||
{% for line in lines %} | ||
<li>{{ line }}</li> | ||
{% endfor %} | ||
</ul> | ||
</td> | ||
<td style="width: 5%; text-align: center;"> | ||
{% if document.attachments.count > 0 %} | ||
<span class="text-gray" data-toggle="tooltip" data-placement="left" data-container="body" title="{{ document.attachments.all|join:', ' }}"> | ||
<span class="glyphicon glyphicon-file" aria-hidden="true"></span> | ||
</span> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% empty %} | ||
{% block searched_documentsempty %} | ||
<em> | ||
{% blocktrans %}No documents containing "{{ phrase }}" found.{% endblocktrans %} | ||
</em> | ||
{% url "login" as anchor_url %} | ||
{% if not user.is_authenticated %} | ||
<em> | ||
{% blocktrans with anchor='<a href="'|add:anchor_url|add:'">'|safe anchor_end='</a>'|safe %}You might have to {{ anchor }} login {{ anchor_end }} first.{% endblocktrans %} | ||
</em> | ||
{% endif %} | ||
{% endblock %} | ||
{% endfor %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,18 @@ | |
</ul> | ||
</li> | ||
{% endif %} | ||
{# Search form #} | ||
<li class ="pull-right"> | ||
<a href="#" id="popover" data-placement="bottom"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please make the popover dismissable (http://getbootstrap.com/docs/4.1/components/popovers/#dismiss-on-next-click) |
||
<span class="glyphicon glyphicon-search" aria-hidden="true"></span> | ||
</a> | ||
<div id="popover-content" class="hide"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the indentation here is wrong |
||
<form action='/search' method='post'> | ||
{% csrf_token %} | ||
<input type='text' name='search_phrase'> | ||
</form> | ||
</div> | ||
</li> | ||
</ul> | ||
</nav> | ||
|
||
|
@@ -244,5 +256,17 @@ | |
$(this).parent().removeClass('menu-hover'); | ||
}); | ||
}); | ||
|
||
// initialize popovers | ||
$(function () { | ||
$('[data-toggle="popover"]').popover() | ||
}); | ||
|
||
$('#popover').popover({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you combine these two method calls into one? |
||
html : true, | ||
content: function() { | ||
return $("#popover-content").html(); | ||
} | ||
}); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add some javascript that automatically focuses the search text field on opening the popover