mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-11 17:19:42 +00:00
Added javascript cookie check, if blocked, login in new tab
This commit is contained in:
@@ -58,7 +58,7 @@ class EventOembed(generic.View):
|
|||||||
full_url = "{0}://{1}{2}".format(request.scheme, request.META['HTTP_HOST'], embed_url)
|
full_url = "{0}://{1}{2}".format(request.scheme, request.META['HTTP_HOST'], embed_url)
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'html': '<iframe src="{0}" frameborder="0" width="100%" height="300"></iframe>'.format(full_url),
|
'html': '<iframe src="{0}" frameborder="0" width="100%" height="250"></iframe>'.format(full_url),
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'type': 'rich',
|
'type': 'rich',
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -150,10 +150,16 @@ ins {
|
|||||||
|
|
||||||
html.embedded{
|
html.embedded{
|
||||||
min-height:100%;
|
min-height:100%;
|
||||||
|
display: table;
|
||||||
|
background: #e9e9e9;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
body{
|
body{
|
||||||
min-height:100%;
|
|
||||||
padding:0;
|
padding:0;
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: middle;
|
||||||
|
background: none;
|
||||||
|
width:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.embed_container{
|
.embed_container{
|
||||||
@@ -161,6 +167,7 @@ html.embedded{
|
|||||||
padding:12px 0px;
|
padding:12px 0px;
|
||||||
min-height:100%;
|
min-height:100%;
|
||||||
width:100%;
|
width:100%;
|
||||||
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.source{
|
.source{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<body>
|
<body>
|
||||||
{% include "analytics.html" %}
|
{% include "analytics.html" %}
|
||||||
|
|
||||||
<div class="embed_container" style="border: 5px solid #e9e9e9;">
|
<div class="embed_container">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
|
|
||||||
{% block title %}Login{% endblock %}
|
{% block title %}Login{% endblock %}
|
||||||
|
|
||||||
|
{% block js %}
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
console.log("Cookies Enabled: " + navigator.cookieEnabled)
|
||||||
|
if(!navigator.cookieEnabled){
|
||||||
|
$('#loginForm').prop("target", "_blank");
|
||||||
|
$('#cookieWarning').removeClass('hidden');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
|
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
|
||||||
@@ -10,9 +22,11 @@
|
|||||||
|
|
||||||
|
|
||||||
{% include 'form_errors.html' %}
|
{% include 'form_errors.html' %}
|
||||||
|
|
||||||
|
|
||||||
<div class="col-sm-6 col-sm-offset-3 col-lg-4 col-lg-offset-4">
|
<div class="col-sm-6 col-sm-offset-3 col-lg-4 col-lg-offset-4">
|
||||||
|
|
||||||
<form action="" method="post" role="form" target="_self">{% csrf_token %}
|
<form id="loginForm" action="" method="post" role="form" target="_self">{% csrf_token %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="id_username">{{ form.username.label }}</label>
|
<label for="id_username">{{ form.username.label }}</label>
|
||||||
{% render_field form.username class+="form-control" placeholder=form.username.label %}
|
{% render_field form.username class+="form-control" placeholder=form.username.label %}
|
||||||
@@ -21,9 +35,14 @@
|
|||||||
<label for="{{ form.password.id_for_label }}">{{ form.password.label }}</label>
|
<label for="{{ form.password.id_for_label }}">{{ form.password.label }}</label>
|
||||||
{% render_field form.password class+="form-control" placeholder=form.password.label %}
|
{% render_field form.password class+="form-control" placeholder=form.password.label %}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-right">
|
||||||
<input type="submit" value="Login" class="btn btn-primary pull-right"/>
|
<span id="cookieWarning" class="text-warning hidden">
|
||||||
|
Login will happen in new tab (cookies blocked)
|
||||||
|
</span>
|
||||||
|
<input type="submit" value="Login" class="btn btn-primary"/>
|
||||||
|
</div>
|
||||||
<input type="hidden" name="next" value="{{ next }}"/>
|
<input type="hidden" name="next" value="{{ next }}"/>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user