Page Menu
Home
Search
Configure Global Search
Log In
Files
F13102223
index.pug
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
3 KB
Subscribers
None
index.pug
View Options
| {% extends 'layout.html' %}
| {% block page_title %}Users{% endblock %}
| {% block head %}
style
.
span
.field-description
{
font-size:
smaller;
color:
#999;
}
#search-container
{
min-height:
800px !important;
}
#search-details
, #search-list {
overflow:
auto;
}
| {% endblock %}
| {% block body %}
#search-container
#search-sidebar
input
.search-field
(
type=
"text"
,
name=
"q"
,
id=
"q"
,
what=
"/user"
,
autocomplete=
"off"
,
spellcheck=
"false"
,
autocorrect=
"false"
,
placeholder=
"Search by Full Name, Username..."
)
.search-list-filters
#accordion
.panel-group.accordion
(
role=
"tablist"
,
aria-multiselectable=
"true"
)
#facets
#pagination
.search-list-stats
#stats
#search-list
#hits
#search-details
#search-hit-container
| {% raw %}
// Facet template
script
(
type=
"text/template"
,
id=
"facet-template"
)
.panel.panel-default
a
(
data-toggle=
'collapse'
,
data-parent=
'#accordion'
,
href=
'#filter_{{ facet }}'
,
aria-expanded=
'true'
,
aria-controls=
'filter_{{ facet }}'
)
.panel-heading
(
role=
'tab'
)
.panel-title
{{ title }}
.panel-collapse.collapse.in
(
id=
'filter_{{ facet }}'
,
role=
'tabpanel'
,
aria-labelledby=
'headingOne'
)
.panel-body
| {{#values}}
a
.facet_link.toggleRefine
(
class=
'{{#refined}}refined{{/refined}}'
,
data-facet=
'{{ facet }}'
,
data-value=
'{{ value }}'
,
href=
'#'
)
span
| {{ label }}
small
.facet_count.text-muted.pull-right
{{ count }}
| {{/values}}
// Hit template
script
(
type=
"text/template"
,
id=
"hit-template"
)
.search-hit.users
(
data-user-id=
'{{ objectID }}'
)
.search-hit-name
| {{ full_name }}
small
({{ username }})
.search-hit-roles
| {{ roles }}
// Pagination template
script
(
type=
"text/template"
,
id=
"pagination-template"
)
ul
.search-pagination
.
<
li
{{^prev_page}}class="disabled"{{/prev_page}}><a href="#" {{#prev_page}} class="gotoPage" data-page="{{ prev_page }}" {{/prev_page}}><i class="pi-angle-left"></i></a></li>
{{
#pages
}}
<
li
class="{{#current}}active{{/current}}{{#disabled}}disabled{{/disabled}}"><a href="#" {{^disabled}} class="gotoPage" data-page="{{ number }}" {{/disabled}}>{{ number }}</a></li>
{{
/pages}}
<
li
{{^next_page}}class="disabled"{{/next_page}}><a href="#" {{#next_page}} class="gotoPage" data-page="{{ next_page }}" {{/next_page}}><i class="pi-angle-right"></i></a></li>
// Stats template
script
(
type=
"text/template"
,
id=
"stats-template"
)
h5
{{ nbHits }} result{{#nbHits_plural}}s{{/nbHits_plural}}
span
({{ processingTimeMS }}ms)
| {% endraw %}
| {% endblock %}
| {% block footer_scripts %}
script
(
src=
"{{ url_for('static_pillar', filename='assets/js/vendor/hogan.common-3.0.0.js') }}"
)
script
(
src=
"{{ url_for('static_pillar', filename='assets/js/elasticsearch.min.js') }}"
)
script
(
src=
"{{ url_for('static_pillar', filename='assets/js/vendor/jquery.select2.min.js') }}"
)
script
(
type=
"text/javascript"
).
// This function is also used in edit_embed.pug.
function
displayUser(userId) {
var
url = '/u/' + userId + '/edit';
return
$.get(url, function(dataHtml){
$('
#search-hit-container
')
.html
(
dataHtml
)
.show
();
})
.fail
(
function
(
jqXHR
,
textStatus
,
errorThrown
) {
var
$userbox = $(".search-hit.users[data-user-id='" + userId + "']");
var
$msgbox = $userbox.find('.search-hit-roles');
if
(console) console.log('Error fetching user', userId, '; jqXHR=', jqXHR);
$
userbox
.addClass
(
'
alert
alert-warning
'
);
if
(jqXHR.status == 404) {
$
msgbox
.text
(
'
This
user
does
not
seem
to
exist
.'
);
}
else
{
$
msgbox
.text
(
'
There
was
an
error
fetching
the
user:
'
+
jqXHR
.
responseText
+
'.'
)
}
})
;
}
$('
body
').on('click', '.search-hit', function(){
displayUser
(
$(
this
)
.data
(
'
user-id
'
));
});
// Remove focus from search input so that the click event bound to .user-hit
// can be fired on the first click.
$('
#search-list
').hover(function(){
$('
#q
').blur();
});
| {% endblock %}
| {% block footer_navigation %}{% endblock %}
| {% block footer %}{% endblock %}
File Metadata
Details
Attached
Mime Type
text/html
Expires
Thu, May 26, 8:41 AM (2 d)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2e/a9/6343a29d2dada0403d6f06d11612
Attached To
rPS Pillar
Event Timeline
Log In to Comment