This repository has been archived by the owner on Feb 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: zoo search * refactor: CR fixes * refactor: rename meilisearch to globalsearch app Co-authored-by: Jurica Grgicevic <[email protected]>
- Loading branch information
Showing
39 changed files
with
640 additions
and
238 deletions.
There are no files selected for viewing
File renamed without changes.
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
File renamed without changes.
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
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,32 @@ | ||
$(document).ready(function() { | ||
const URI = require('urijs') | ||
const searchInput = $('.ui.search input') | ||
const enterKeyCode = 13 | ||
const slashKeyCode = 47 | ||
const currentUrl = URI(window.location.href) | ||
const currentQuery = URI.parseQuery(currentUrl.query()).q | ||
|
||
$(document).keypress(function(event) { | ||
if(event.which == slashKeyCode) { | ||
event.preventDefault(); | ||
searchInput.focus() | ||
searchInput.selectionStart = searchInput.selectionEnd = searchInput.value.length | ||
} | ||
}); | ||
|
||
searchInput.keypress((event) => { | ||
if(event.which === enterKeyCode) { | ||
let newUrl = currentUrl.pathname('search') | ||
newUrl.search("") | ||
|
||
if(searchInput.val()) | ||
newUrl.addSearch(URI.parseQuery('?q=' + searchInput.val())) | ||
window.location.href = newUrl.toString() | ||
} | ||
}) | ||
|
||
if(currentQuery) { | ||
searchInput.val(currentQuery) | ||
} | ||
|
||
}); |
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
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,98 @@ | ||
{% load utils %} | ||
|
||
{% for object in object_list %} | ||
<div class="ui project segment"> | ||
<h3 class="ui header"> | ||
<span> | ||
<a href="{{ object.get_absolute_url }}">{{ object.name }}</a> | ||
<small> | ||
· | ||
owned by | ||
{% if object.owner_url %} | ||
<a href="{{ object.owner_url }}">{{ object.owner }}</a> | ||
{% else %} | ||
{{ object.owner }} | ||
{% endif %} | ||
</small> | ||
</span> | ||
|
||
{% spaceless %} | ||
<div class="flex-horizontal tags-wrapper"> | ||
{% if object.status %} | ||
<a class="ui {% label_color 'status' object.status %} circular label">status:{{ object.status }}</a> | ||
{% endif %} | ||
{% if object.impact %} | ||
<a class="ui {% label_color 'impact' object.impact %} circular label">impact:{{ object.impact }}</a> | ||
{% endif %} | ||
</div> | ||
{% endspaceless %} | ||
|
||
</h3> | ||
<div class="flex-horizontal actions-wrapper"> | ||
{% if 'Support' in project_links %} | ||
{% project_link 'Support' object.slack_url icon='comment alternate' %} | ||
{% endif %} | ||
{% if 'Repository' in project_links %} | ||
{% project_link 'Repository' object.gitlab_url icon='code' %} | ||
{% endif %} | ||
{% if 'Dashboard' in project_links %} | ||
{% project_link 'Dashboard' object.dashboard_url icon='chart pie' %} | ||
{% endif %} | ||
{% if 'Alerts' in project_links %} | ||
{% project_link 'Alerts' object.pagerduty_url icon='warning' %} | ||
{% endif %} | ||
{% if 'Documentation' in project_links %} | ||
{% project_link 'Documentation' object.docs_url icon='graduation cap' %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% empty %} | ||
<div class="ui basic segment"> | ||
<div class="ui very padded placeholder segment"> | ||
<div class="ui icon header"> | ||
<i class="huge grin beam sweat outline icon"></i> | ||
<br> | ||
<div class="content"> | ||
Oops! We couldn't find your thing... | ||
<div class="sub header"> | ||
Make sure the query is correct or add the project if needed | ||
</div> | ||
</div> | ||
</div> | ||
<br> | ||
<a href="{% url project_create_view %}" class="ui yellow black-text button">Add project</a> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% if is_paginated %} | ||
<div class="ui basic center aligned segment"> | ||
<div class="ui pagination menu"> | ||
{% if page_obj.has_previous %} | ||
<a href="?page={{ page_obj.previous_page_number }}{% for key, value in request.GET.items %}{% if key != 'page' %}&{{ key }}={{ value }}{% endif %}{% endfor %}" class="item"> | ||
<i class="chevron left icon"></i> | ||
</a> | ||
{% else %} | ||
<div class="active item"> | ||
<i class="chevron left icon"></i> | ||
</div> | ||
{% endif %} | ||
<div class="item">Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</div> | ||
{% if page_obj.has_next %} | ||
<a href="?page={{ page_obj.next_page_number }}{% for key, value in request.GET.items %}{% if key != 'page' %}&{{ key }}={{ value }}{% endif %}{% endfor %}" class="item"> | ||
<i class="chevron right icon"></i> | ||
</a> | ||
{% else %} | ||
<div class="active item"> | ||
<i class="chevron right icon"></i> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% if project_create_view %} | ||
<a href="{% url project_create_view %}"> | ||
<button class="ui huge yellow corner circular icon button"> | ||
<i class="ui plus icon"></i> | ||
</button> | ||
</a> | ||
{% endif %} |
Oops, something went wrong.