multiple fixes in compterendu and related scripts

This commit is contained in:
artus
2018-10-13 14:15:31 +02:00
parent 87b0b218a1
commit a7858d22b0
9 changed files with 72 additions and 100 deletions

View File

@@ -6,7 +6,7 @@
var formAjaxSubmit = function(form, modal)
{
$(form).submit(function (e) {
e.preventDefault();
e.preventDefault();
$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
@@ -16,8 +16,8 @@
$(modal).find('.modal-body').html(xhr);
formAjaxSubmit(form, modal);
} else {
$(modal).modal('toggle');
// Reload page ?
$(modal).modal('hide');
// Reload page ?
location.reload()
}
},

View File

@@ -25,12 +25,9 @@
};
$('#minus-5').click(function() {
$.fn.editHeureValue(-5)
//console.log('minus 5')
});
$('#plus-5').click(function() {
$.fn.editHeureValue(5)
//console.log('plus 5')
});
$('#minus-10').click(function() { $.fn.editHeureValue(-10) });
$('#minus-5').click(function() { $.fn.editHeureValue(-5) });
$('#plus-5').click(function() { $.fn.editHeureValue(5) });
$('#plus-10').click(function() { $.fn.editHeureValue(10) });
});

View File

@@ -15,7 +15,7 @@
<body {% block extra_body_attrs %}{% endblock %}>
<!-- START: Navigation Bar -->
<nav class="navbar fixed-top navbar-dark bg-dark navbar-expand-md shadow p-0">
<a class="navbar-brand" href="/">Maraude ALSA</a>
<a class="navbar-brand ml-3" href="/">Maraude ALSA</a>
{% if user.is_authenticated %}
<ul class="navbar-nav ml-auto">
<li class="nav-item">
@@ -31,24 +31,18 @@
</nav>
<!-- END: Navigation Bar -->
<div class="container-fluid">
<!-- BEGIN: Sidebar -->
<div class="row">
<nav class="col-md-2 d-none d-md-block bg-light sidebar">
<div class="sidebar-sticky">
{% if user.is_authenticated %}
<h6 class="sidebar-heading px-3 mt-4 text-muted">Menu</h6>
<ul class="nav flex-column">
<li class="nav-item pt-3">
<li class="nav-item">
<a href="{% url 'maraudes:index' %}" class="nav-link {% active namespace="maraudes" append=True %}">Maraudes</a>
</li>
</ul>
<h6 class="sidebar-heading px-3 mt-4 mb-1 text-muted">
<span>Notes</span>
</h6>
<ul class="nav flex-column">
<li class="nav-item">
<a href="{% url 'notes:liste-maraude' %}" class="nav-link {% active namespace="notes" append=True %}">Par maraudes</a>
</li>
<li class="nav-item">
<a href="{% url 'notes:liste-sujet' %}" class="nav-link {% active namespace="notes" append=True %}">Par sujets</a>
<a href="{% url 'notes:liste-sujet' %}" class="nav-link {% active namespace="notes" append=True %}">Suivi</a>
</li>
</ul>
{% else %}
@@ -64,6 +58,7 @@
{% block sidebar %}{% endblock %}
</div>
</nav>
<!-- END: Sidebar -->
<main role="main" class="col-md-10 ml-sm-auto px-4">
<div class="container-fluid">
<div class="row pt-4 d-flex justify-content-center">

View File

@@ -1,23 +1,11 @@
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Connexion</h3>
</div>
<div class="panel-body text-center">
<h6 class="sidebar-heading px-3 mt-4 mb-2 text-muted">Connexion</h6>
{% if user.is_authenticated %}
<p>{{ user.first_name|default:user.username }}, vous êtes connecté !</p>
<p class="px-3">{{ user.first_name|default:user.username }}, vous êtes connecté !</p>
{% if next %}
<div class="alert alert-warning">
<p>Votre compte ne donne pas accès à cette page. Veuillez vous connecter avec un autre compte.</p>
</div>
<a href="{% url 'logout' %}" class="btn btn-danger">Déconnexion</a>
{% else %}
<div class="btn-group-vertical">
<a href="{% url 'maraudes:index' %}" class="btn btn-sm btn-primary">Entrer</a>
{% if user.is_superuser %}
<a href="admin/" class="btn btn-sm btn-default">Administration</a>
{% endif %}
<a href="{% url 'logout' %}" class="btn btn-sm btn-default">Déconnexion</a>
</div>
{% endif %}
{% else %}
<form class="form" method="post" action="{% url "login" %}">
@@ -28,24 +16,16 @@
</div>
<input name="next" value="{{next}}" hidden />
{% endif %}
<div class="form-group form-horizontal">
<div class="form-group form-horizontal px-3">
<div class="form-group">
<label class="col-md-2 sr-only control-label" for="id_username">Username</label>
<div class="input-group col-md-9">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input autofocus="" class="form-control" id="id_username" maxlength="254" name="username" placeholder="Username" title="" type="text" required />
</div>
<input autofocus="" class="form-control" id="id_username" maxlength="254" name="username" placeholder="Username" title="" type="text" required />
</div>
<div class="form-group">
<label class="col-md-2 sr-only control-label" for="id_password">Password</label>
<div class="input-group col-md-9">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input class="form-control" id="id_password" name="password" placeholder="Password" title="" type="password" required />
</div>
<input class="form-control" id="id_password" name="password" placeholder="Password" title="" type="password" required />
</div>
</div>
<div class="text-center">
<button class="btn btn-primary navbar-button" type="submit">Connexion</button>
<button class="btn btn-primary btn-block" type="submit">Connexion</button>
</div>
</form>
{% endif %}