god save me
This commit is contained in:
parent
bf51819cbc
commit
4d60016ef4
|
|
@ -12,8 +12,7 @@
|
||||||
<link rel="stylesheet" href="{% static 'dist/css/adminlte.css' %}">
|
<link rel="stylesheet" href="{% static 'dist/css/adminlte.css' %}">
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet" href="{% static 'plugins/select2/css/select2.min.css' %}">
|
||||||
href="{% static 'plugins/fontawesome-free/css/all.min.css' %}">
|
|
||||||
</head>
|
</head>
|
||||||
<body class="layout-top-nav" style="height: auto;">
|
<body class="layout-top-nav" style="height: auto;">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
|
@ -52,16 +51,17 @@
|
||||||
</ul>
|
</ul>
|
||||||
<div class="float-right" style="width:100%">
|
<div class="float-right" style="width:100%">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<div id="searchsuggestions"></div>
|
||||||
|
<select class="select2" style="width: 200px;"></select>
|
||||||
|
-->
|
||||||
|
|
||||||
<form class="form-inline ml-0 ml-md-3 float-right">
|
<form class="form-inline ml-0 ml-md-3 float-right">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input class="form-control form-control-navbar"
|
<input class="form-control form-control-navbar"
|
||||||
type="search"
|
type="search"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
aria-label="Search"
|
aria-label="Search">
|
||||||
id="searchinput">
|
|
||||||
<!--
|
|
||||||
<div id="searchsuggestions"></div>
|
|
||||||
-->
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button class="btn btn-navbar" type="submit">
|
<button class="btn btn-navbar" type="submit">
|
||||||
<i class="fas fa-search"></i>
|
<i class="fas fa-search"></i>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ urlpatterns = [
|
||||||
path('auth/', include('django.contrib.auth.urls')),
|
path('auth/', include('django.contrib.auth.urls')),
|
||||||
path('', include('core.urls')),
|
path('', include('core.urls')),
|
||||||
path('api/', include('api.urls')),
|
path('api/', include('api.urls')),
|
||||||
#path('api/', include('sage_stream.api.urls')),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
|
|
|
||||||
25
static/dist/js/searchsuggestions.js
vendored
25
static/dist/js/searchsuggestions.js
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
|
$(document).ready(() => {
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
const searchinput = document.querySelector("#searchinput");
|
const searchinput = document.querySelector("#searchinput");
|
||||||
const searchsuggestions = document.querySelector("#searchsuggestions");
|
const searchsuggestions = document.querySelector("#searchsuggestions");
|
||||||
|
|
@ -24,4 +27,24 @@ function setSuggestions(o, s) {
|
||||||
}
|
}
|
||||||
o.replaceChildren(...newSuggestions);
|
o.replaceChildren(...newSuggestions);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.select2').select2({
|
||||||
|
placeholder: 'Search for videos',
|
||||||
|
ajax: {
|
||||||
|
url: '/api/search/',
|
||||||
|
data: (params) => { return { q: params.term } },
|
||||||
|
dataType: 'json',
|
||||||
|
processResults: function(data) {
|
||||||
|
for(const vid of data) {
|
||||||
|
vid.text = vid.name + " " + vid.id;
|
||||||
|
delete vid['name'];
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
results: data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
*/
|
||||||
Loading…
Reference in New Issue
Block a user