Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
John James
whats-open
Commits
9a99479b
Commit
9a99479b
authored
Mar 07, 2018
by
Daniel W Bond
Browse files
use django's built-in js library, and abstracted static information out to new template
parent
6e3fcd8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
whats-open/api/templates/base_bulk_schedules_intermediate.html
0 → 100644
View file @
9a99479b
{% extends "admin/base_site.html" %}
{% load static %}
{% block extrahead %}
<link
href=
"{% static "
admin
/
css
/
vendor
/
select2
/
select2.min.css
"
%}"
type=
"text/css"
media=
"screen"
rel=
"stylesheet"
/>
<link
href=
"{% static "
admin
/
css
/
autocomplete.css
"
%}"
type=
"text/css"
media=
"screen"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
src=
"{% static "
admin
/
js
/
vendor
/
jquery
/
jquery.min.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
admin
/
js
/
vendor
/
select2
/
select2.full.min.js
"
%}"
></script>
<!-- Django changes jQuery to django.jQuery in case the version bundled with Django is not the version
you want to use in your app -->
<script
type=
"text/javascript"
src=
"{% static "
admin
/
js
/
jquery.init.js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
admin
/
js
/
cancel.js
"
%}"
></script>
<script>
/**
Django's admin inferface uses select2 for its new autocompletion selects
Unfortunately, use of that specific widget and the associated support attributes
are limited to admin.ModelAdmin change views
You need instead to use it manually
See
https://docs.djangoproject.com/en/2.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields
https://docs.djangoproject.com/en/2.0/ref/contrib/admin/#reversing-admin-urls
https://select2.org/getting-started/basic-usage
for more information
**/
(
function
(
$
)
{
$
(
document
).
ready
(
function
()
{
$
(
'
.select2-basic-single
'
).
select2
();
});
})(
django
.
jQuery
);
</script>
{{ block.super }}
{% endblock %}
{% block extrastyle %}
{{ block.super }}
<link
href=
"{% static "
admin
/
css
/
forms.css
"
%}"
type=
"text/css"
rel=
"stylesheet"
/>
<style
type=
"text/css"
>
a
.button.cancel-link
{
display
:
inline-block
;
vertical-align
:
middle
;
height
:
15px
;
line-height
:
15px
;
background
:
#ddd
;
border-radius
:
4px
;
padding
:
10px
15px
;
color
:
#333
;
margin
:
0
0
0
10px
;
}
a
.button.cancel-link
:active
,
a
.button.cancel-link
:focus
,
a
.button.cancel-link
:hover
{
background
:
#ccc
;
}
</style>
{% endblock %}
whats-open/api/templates/bulk_schedules_intermediate.html
View file @
9a99479b
{% extends "admin/base_site.html" %}
{% block extrahead %}
{{ block.super }}
<!-- neither jQuery proper nor Django's version is loaded by default on this page -->
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"
></script>
{% endblock %}
{% block extrastyle %}
{{ block.super }}
<link
href=
"https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css"
rel=
"stylesheet"
/>
{% endblock %}
{% extends "base_bulk_schedules_intermediate.html" %}
{% block title %}
Set main schedule for multiple facilities
...
...
@@ -47,24 +35,7 @@ Set main schedule for multiple facilities
</ul>
<input
type=
"hidden"
name=
"action"
value=
"assign_bulk_schedules"
/>
<input
type=
"submit"
name=
"bulk_schedule"
value=
"Yes, I'm sure"
/>
<a
href=
"#"
class=
"button cancel-link"
>
No, take me back
</a>
</form>
<script>
/**
Django's admin inferface uses this library for its new autocompletion selects
Unfortunately, use of that specific widget and the associated support attributes
are limited to admin.ModelAdmin change views
See
https://docs.djangoproject.com/en/2.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields
https://docs.djangoproject.com/en/2.0/ref/contrib/admin/#reversing-admin-urls
for more information
**/
$
(
document
).
ready
(
function
()
{
$
(
'
.select2-basic-single
'
).
select2
({
});
});
</script>
{% endblock %}
whats-open/api/templates/bulk_special_schedules_intermediate.html
View file @
9a99479b
{% extends "admin/base_site.html" %}
{% block extrahead %}
{{ block.super }}
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"
></script>
{% endblock %}
{% block extrastyle %}
{{ block.super }}
<link
href=
"https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css"
rel=
"stylesheet"
/>
{% endblock %}
{% extends "base_bulk_schedules_intermediate.html" %}
{% block title %}
Add special schedule to multiple facilities
...
...
@@ -46,12 +35,7 @@ Add special schedule to multiple facilities
</ul>
<input
type=
"hidden"
name=
"action"
value=
"assign_bulk_special_schedules"
/>
<input
type=
"submit"
name=
"bulk_special_schedule"
value=
"Yes, I'm sure"
/>
<a
href=
"#"
class=
"button cancel-link"
>
No, take me back
</a>
</form>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'
.select2-basic-single
'
).
select2
({
});
});
</script>
{% 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