Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
django-cas-server
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Samir
django-cas-server
Commits
f4882c30
Commit
f4882c30
authored
Aug 02, 2016
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add powered by footer, set warn cookie using javascript, w3c validation
parent
64420400
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
100 additions
and
45 deletions
+100
-45
README.rst
README.rst
+1
-0
cas_server/default_settings.py
cas_server/default_settings.py
+2
-0
cas_server/static/cas_server/alert-version.js
cas_server/static/cas_server/alert-version.js
+0
-27
cas_server/static/cas_server/functions.js
cas_server/static/cas_server/functions.js
+40
-0
cas_server/static/cas_server/styles.css
cas_server/static/cas_server/styles.css
+20
-1
cas_server/templates/cas_server/base.html
cas_server/templates/cas_server/base.html
+24
-11
cas_server/templates/cas_server/form.html
cas_server/templates/cas_server/form.html
+1
-1
cas_server/templates/cas_server/login.html
cas_server/templates/cas_server/login.html
+12
-5
No files found.
README.rst
View file @
f4882c30
...
...
@@ -206,6 +206,7 @@ Template settings
templates. Set it to ``False`` to disable it.
* ``CAS_FAVICON_URL``: URL to the favicon (shortcut icon) used by the default templates.
Default is a key icon. Set it to ``False`` to disable it.
* ``CAS_SHOW_POWERED``: Set it to ``False`` to hide the powered by footer. The default is ``True``.
* ``CAS_COMPONENT_URLS``: URLs to css and javascript external components. It is a dictionnary
and it must have the five following keys: ``"bootstrap3_css"``, ``"bootstrap3_js"``,
``"html5shiv"``, ``"respond"``, ``"jquery"``. The default is::
...
...
cas_server/default_settings.py
View file @
f4882c30
...
...
@@ -20,6 +20,8 @@ from importlib import import_module
CAS_LOGO_URL
=
static
(
"cas_server/logo.png"
)
#: URL to the favicon (shortcut icon) used by the default templates. Default is a key icon.
CAS_FAVICON_URL
=
static
(
"cas_server/favicon.ico"
)
#: Show the powered by footer if set to ``True``
CAS_SHOW_POWERED
=
True
#: URLs to css and javascript external components.
CAS_COMPONENT_URLS
=
{
"bootstrap3_css"
:
"//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
,
...
...
cas_server/static/cas_server/alert-version.js
deleted
100644 → 0
View file @
64420400
function
alert_version
(
last_version
){
jQuery
(
function
(
$
){
$
(
"
#alert-version
"
).
click
(
function
(
e
){
e
.
preventDefault
();
var
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
+
(
10
*
365
*
24
*
60
*
60
*
1000
));
var
expires
=
"
; expires=
"
+
date
.
toGMTString
();
document
.
cookie
=
"
cas-alert-version=
"
+
last_version
+
expires
+
"
; path=/
"
;
});
var
nameEQ
=
"
cas-alert-version=
"
;
var
ca
=
document
.
cookie
.
split
(
"
;
"
);
var
value
;
for
(
var
i
=
0
;
i
<
ca
.
length
;
i
++
)
{
var
c
=
ca
[
i
];
while
(
c
.
charAt
(
0
)
===
"
"
){
c
=
c
.
substring
(
1
,
c
.
length
);
}
if
(
c
.
indexOf
(
nameEQ
)
===
0
){
value
=
c
.
substring
(
nameEQ
.
length
,
c
.
length
);
}
}
if
(
value
===
last_version
){
$
(
"
#alert-version
"
).
parent
().
hide
();
}
});
}
cas_server/static/cas_server/functions.js
0 → 100644
View file @
f4882c30
function
createCookie
(
name
,
value
,
days
)
{
if
(
days
)
{
var
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
+
(
days
*
24
*
60
*
60
*
1000
));
var
expires
=
"
; expires=
"
+
date
.
toGMTString
();
}
else
var
expires
=
""
;
document
.
cookie
=
name
+
"
=
"
+
value
+
expires
+
"
; path=/
"
;
}
function
readCookie
(
name
)
{
var
nameEQ
=
name
+
"
=
"
;
var
ca
=
document
.
cookie
.
split
(
"
;
"
);
for
(
var
i
=
0
;
i
<
ca
.
length
;
i
++
)
{
var
c
=
ca
[
i
];
while
(
c
.
charAt
(
0
)
==
"
"
){
c
=
c
.
substring
(
1
,
c
.
length
);
}
if
(
c
.
indexOf
(
nameEQ
)
==
0
){
return
c
.
substring
(
nameEQ
.
length
,
c
.
length
);
}
}
return
null
;
}
function
eraseCookie
(
name
)
{
createCookie
(
name
,
""
,
-
1
);
}
function
alert_version
(
last_version
){
jQuery
(
function
(
$
){
$
(
"
#alert-version
"
).
click
(
function
(
e
){
e
.
preventDefault
();
createCookie
(
"
cas-alert-version
"
,
last_version
,
10
*
365
)
});
if
(
readCookie
(
"
cas-alert-version
"
)
===
last_version
){
$
(
"
#alert-version
"
).
parent
().
hide
();
}
});
}
cas_server/static/cas_server/styles.css
View file @
f4882c30
html
,
body
{
height
:
100%
;
}
body
{
padding-top
:
40px
;
padding-bottom
:
4
0px
;
padding-bottom
:
0px
;
background-color
:
#eee
;
}
...
...
@@ -41,6 +44,22 @@ body {
width
:
110px
;
}
/* Wrapper for page content to push down footer */
#wrap
{
min-height
:
100%
;
height
:
auto
!important
;
height
:
100%
;
/* Negative indent footer by it's height */
margin
:
0
auto
-40px
;
}
#footer
{
height
:
40px
;
text-align
:
center
;
}
#footer
p
{
padding-top
:
10px
;
}
@media
screen
and
(
max-width
:
680px
)
{
#app-name
{
margin
:
0
;
...
...
cas_server/templates/cas_server/base.html
View file @
f4882c30
{% load i18n %}
{% load staticfiles %}
<!DOCTYPE html>
{% load i18n %}{% load staticfiles %}
<!DOCTYPE html>
<html
{%
if
request
.
LANGUAGE_CODE
%}
lang=
"{{ request.LANGUAGE_CODE }}"
{%
endif
%}
>
<head>
<meta
charset=
"utf-8"
>
...
...
@@ -18,12 +16,13 @@
<link
href=
"{% static "
cas_server
/
styles
.
css
"
%}"
rel=
"stylesheet"
>
</head>
<body>
<div
id=
"wrap"
>
<div
class=
"container"
>
{% if auto_submit %}
<noscript>
{% endif %}
<div
class=
"row"
>
<div
class=
"col-lg-12 col-md-12 col-sm-12 col-xs-12"
>
<h1
id=
"app-name"
>
{% if settings.CAS_LOGO_URL %}
<img
src=
"{{settings.CAS_LOGO_URL}}"
></img>
{% endif %}
{% if settings.CAS_LOGO_URL %}
<img
src=
"{{settings.CAS_LOGO_URL}}"
alt=
"cas-logo"
/>
{% endif %}
{% trans "Central Authentication Service" %}
</h1>
</div>
</div>
...
...
@@ -53,7 +52,7 @@
class=
"alert alert-danger"
{%
endif
%}
{%
endspaceless
%}
>
{{
message
}}
{{
message|safe
}}
</div>
{% endfor %}
{% if auto_submit %}
</noscript>
{% endif %}
...
...
@@ -62,11 +61,25 @@
<div
class=
"col-lg-3 col-md-3 col-sm-2 col-xs-0"
></div>
</div>
</div>
<!-- /container -->
<script
src=
"{{settings.CAS_COMPONENT_URLS.jquery}}"
></script>
<script
src=
"{{settings.CAS_COMPONENT_URLS.bootstrap3_js}}"
></script>
{% if settings.CAS_NEW_VERSION_HTML_WARNING and upgrade_available %}
<script
src=
"{% static "
cas_server
/
alert-version
.
js
"
%}"
></script>
<script>
alert_version
(
"
{{LAST_VERSION}}
"
)
</script>
{% endif %}
</div>
<div
style=
"clear: both;"
></div>
{% if settings.CAS_SHOW_POWERED %}
<div
id=
"footer"
>
<p><a
class=
"text-muted"
href=
"https://pypi.python.org/pypi/django-cas-server"
>
django-cas-server powered
</a></p>
</div>
{% endif %}
<script
src=
"{{settings.CAS_COMPONENT_URLS.jquery}}"
></script>
<script
src=
"{{settings.CAS_COMPONENT_URLS.bootstrap3_js}}"
></script>
<script
src=
"{% static "
cas_server
/
functions
.
js
"
%}"
></script>
{% if settings.CAS_NEW_VERSION_HTML_WARNING and upgrade_available %}
<script
type=
"text/javascript"
>
alert_version
(
"
{{LAST_VERSION}}
"
)
</script>
{% endif %}
{% block javascript %}{% endblock %}
</body>
</html>
<!--
Powered by django-cas-server version {{VERSION}}
Pypi: https://pypi.python.org/pypi/django-cas-server
github: https://github.com/nitmir/django-cas-server
-->
cas_server/templates/cas_server/form.html
View file @
f4882c30
...
...
@@ -14,7 +14,7 @@
{% endif %}"
{%
endspaceless
%}
>
{% spaceless %}
{% if field|is_checkbox %}
<div
class=
"checkbox"
><label
for=
"{{field.auto_id}}"
>
{{field}}{{field.label}}
</label>
<div
class=
"checkbox"
><label
for=
"{{field.auto_id}}"
>
{{field}}{{field.label}}
</label>
</div>
{% else %}
<label
class=
"control-label"
for=
"{{field.auto_id}}"
>
{{field.label}}
</label>
{{field}}
...
...
cas_server/templates/cas_server/login.html
View file @
f4882c30
...
...
@@ -14,10 +14,17 @@
<button
class=
"btn btn-primary btn-block btn-lg"
type=
"submit"
>
{% trans "Login" %}
</button>
{% if auto_submit %}
</noscript>
{% endif %}
</form>
{% if auto_submit %}
<script
type=
"text/javascript"
>
document
.
getElementById
(
'
login_form
'
).
submit
();
// SUBMIT FORM
</script>
{% endif %}
{% endblock %}
{% block javascript %}
<script
type=
"text/javascript"
>
jQuery
(
function
(
$
){
$
(
"
#id_warn
"
).
click
(
function
(
e
){
if
(
$
(
"
#id_warn
"
).
is
(
'
:checked
'
)){
createCookie
(
"
warn
"
,
"
on
"
,
10
*
365
);
}
else
{
eraseCookie
(
"
warn
"
);
}
});
});{
%
if
auto_submit
%
}
document
.
getElementById
(
'
login_form
'
).
submit
();
// SUBMIT FORM{% endif %}
</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