mirror of https://gitlab.crans.org/bde/nk20
Merge branch 'more_front' into 'beta'
More front See merge request bde/nk20!96
This commit is contained in:
commit
ac0e9b9da2
|
@ -0,0 +1,43 @@
|
||||||
|
/**
|
||||||
|
* On form submit, create a new alias
|
||||||
|
*/
|
||||||
|
function create_alias (e) {
|
||||||
|
// Do not submit HTML form
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// Get data and send to API
|
||||||
|
const formData = new FormData(e.target);
|
||||||
|
$.post("/api/note/alias/", {
|
||||||
|
"csrfmiddlewaretoken": formData.get("csrfmiddlewaretoken"),
|
||||||
|
"name": formData.get("name"),
|
||||||
|
"note": formData.get("note")
|
||||||
|
}).done(function () {
|
||||||
|
// Reload table
|
||||||
|
$("#alias_table").load(location.pathname + " #alias_table");
|
||||||
|
addMsg("Alias ajouté", "success");
|
||||||
|
}).fail(function (xhr, _textStatus, _error) {
|
||||||
|
errMsg(xhr.responseJSON);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On click of "delete", delete the alias
|
||||||
|
* @param Integer button_id Alias id to remove
|
||||||
|
*/
|
||||||
|
function delete_button (button_id) {
|
||||||
|
$.ajax({
|
||||||
|
url: "/api/note/alias/" + button_id + "/",
|
||||||
|
method: "DELETE",
|
||||||
|
headers: { "X-CSRFTOKEN": CSRF_TOKEN }
|
||||||
|
}).done(function () {
|
||||||
|
addMsg('Alias supprimé', 'success');
|
||||||
|
$("#alias_table").load(location.pathname + " #alias_table");
|
||||||
|
}).fail(function (xhr, _textStatus, _error) {
|
||||||
|
errMsg(xhr.responseJSON);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
// Attach event
|
||||||
|
document.getElementById("form_alias").addEventListener("submit", create_alias);
|
||||||
|
})
|
|
@ -1,12 +0,0 @@
|
||||||
{% load django_tables2 crispy_forms_tags i18n %}
|
|
||||||
<div class="d-flex justify-content-center">
|
|
||||||
<input id="alias_input" type="text" value=""/>
|
|
||||||
<button id="alias_submit" class="btn btn-primary mx-2" onclick="create_alias( {{ object.note.pk }} )" type="submit">
|
|
||||||
{% trans "Add alias" %}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="card bg-light shadow">
|
|
||||||
<div class="card-body">
|
|
||||||
{% render_table aliases %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -1,10 +1,25 @@
|
||||||
{% extends "member/club_detail.html" %}
|
{% extends "member/club_detail.html" %}
|
||||||
{% load i18n static pretty_money django_tables2 crispy_forms_tags %}
|
{% load static django_tables2 i18n %}
|
||||||
|
|
||||||
{% block profile_content %}
|
{% block profile_content %}
|
||||||
{% include "member/alias_update.html" %}
|
<div class="card bg-light">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
|
{% trans "Note aliases" %}
|
||||||
|
</h3>
|
||||||
|
<div class="card-body">
|
||||||
|
<form class="input-group" method="POST" id="form_alias">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input type="hidden" name="note" value="{{ object.note.pk }}">
|
||||||
|
<input type="text" name="name" class="form-control">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<input type="submit" class="btn btn-success" value="{% trans "Add" %}">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% render_table aliases %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrajavascript %}
|
{% block extrajavascript %}
|
||||||
<script src="/static/js/alias.js"></script>
|
<script src="{% static "member/js/alias.js" %}"></script>
|
||||||
{% endblock%}
|
{% endblock%}
|
|
@ -9,10 +9,10 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrajavascript %}
|
{% block extrajavascript %}
|
||||||
<script>
|
<script>
|
||||||
function refreshHistory() {
|
function refreshHistory() {
|
||||||
$("#history_list").load("{% url 'member:club_detail' pk=object.pk %} #history_list");
|
$("#history_list").load("{% url 'member:club_detail' pk=object.pk %} #history_list");
|
||||||
$("#profile_infos").load("{% url 'member:club_detail' pk=object.pk %} #profile_infos");
|
$("#profile_infos").load("{% url 'member:club_detail' pk=object.pk %} #profile_infos");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,11 +1,12 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% load static i18n pretty_money %}
|
||||||
{% load i18n %}
|
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
{% load pretty_money %}
|
|
||||||
|
{# Use a fluid-width container #}
|
||||||
|
{% block containertype %}container-fluid{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row mt-4">
|
<div class="row mt-4">
|
||||||
<div class="col-xl-4">
|
<div class="col-xl-4">
|
||||||
{% block profile_info %}
|
{% block profile_info %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -14,19 +15,18 @@
|
||||||
{% block profile_content %}
|
{% block profile_content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block extra_content %}
|
{% block extra_content %}{% endblock %}
|
||||||
{% endblock %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrajavascript %}
|
{% block extrajavascript %}
|
||||||
<script>
|
<script>
|
||||||
{% if object %}
|
{% if object %}
|
||||||
function refreshHistory() {
|
function refreshHistory() {
|
||||||
$("#history_list").load("{% url 'member:user_detail' pk=object.pk %} #history_list");
|
$("#history_list").load("{% url 'member:user_detail' pk=object.pk %} #history_list");
|
||||||
$("#profile_infos").load("{% url 'member:user_detail' pk=object.pk %} #profile_infos");
|
$("#profile_infos").load("{% url 'member:user_detail' pk=object.pk %} #profile_infos");
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,10 +1,25 @@
|
||||||
{% extends "member/profile_detail.html" %}
|
{% extends "member/profile_detail.html" %}
|
||||||
{% load i18n static pretty_money django_tables2 crispy_forms_tags %}
|
{% load static django_tables2 i18n %}
|
||||||
|
|
||||||
{% block profile_content %}
|
{% block profile_content %}
|
||||||
{% include "member/alias_update.html"%}
|
<div class="card bg-light">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
|
{% trans "Note aliases" %}
|
||||||
|
</h3>
|
||||||
|
<div class="card-body">
|
||||||
|
<form class="input-group" method="POST" id="form_alias">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input type="hidden" name="note" value="{{ object.note.pk }}">
|
||||||
|
<input type="text" name="name" class="form-control">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<input type="submit" class="btn btn-success" value="{% trans "Add" %}">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% render_table aliases %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrajavascript %}
|
{% block extrajavascript %}
|
||||||
<script src="/static/js/alias.js"></script>
|
<script src="{% static "member/js/alias.js" %}"></script>
|
||||||
{% endblock%}
|
{% endblock%}
|
|
@ -1,8 +1,5 @@
|
||||||
{% extends "member/noteowner_detail.html" %}
|
{% extends "member/noteowner_detail.html" %}
|
||||||
|
|
||||||
{# Use a fluid-width container #}
|
|
||||||
{% block containertype %}container-fluid{% endblock %}
|
|
||||||
|
|
||||||
{% block profile_info %}
|
{% block profile_info %}
|
||||||
{% include "member/profile_info.html" %}
|
{% include "member/profile_info.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -4,15 +4,16 @@ Font-Awesome attribution is already done inside SVG files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#login-form input[type="text"] {
|
#login-form input[type="text"] {
|
||||||
background: #fff right 1rem top 50% / 5% no-repeat url('fa-user.svg');
|
background: #fff right 1rem top 50% / 5% no-repeat url('../img/fa-user.svg');
|
||||||
padding-right: 3rem;
|
padding-right: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login-form input[type="password"] {
|
#login-form input[type="password"] {
|
||||||
background: #fff right 1rem top 50% / 5% no-repeat url('fa-lock.svg');
|
background: #fff right 1rem top 50% / 5% no-repeat url('../img/fa-lock.svg');
|
||||||
padding-right: 3rem;
|
padding-right: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login-form select {
|
#login-form select {
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 529 B |
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 573 B |
|
@ -41,6 +41,7 @@ select.language {
|
||||||
color: #6c757d;
|
color: #6c757d;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Last BDE colors */
|
/* Last BDE colors */
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
|
|
||||||
$("#alias_input").on('keypress',function(e) {
|
|
||||||
if(e.which == 13) {
|
|
||||||
$("#alias_submit").click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function create_alias(note_id){
|
|
||||||
$.post("/api/note/alias/",
|
|
||||||
{
|
|
||||||
"csrfmiddlewaretoken": CSRF_TOKEN,
|
|
||||||
"name": $("#alias_input").val(),
|
|
||||||
"note": note_id
|
|
||||||
}
|
|
||||||
).done(function(){
|
|
||||||
$("#alias_table").load(location.pathname+ " #alias_table");
|
|
||||||
addMsg("Alias ajouté","success");
|
|
||||||
})
|
|
||||||
.fail(function(xhr, textStatus, error){
|
|
||||||
errMsg(xhr.responseJSON);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// on click of button "delete" , call the API
|
|
||||||
function delete_button(button_id){
|
|
||||||
$.ajax({
|
|
||||||
url:"/api/note/alias/"+button_id+"/",
|
|
||||||
method:"DELETE",
|
|
||||||
headers: {"X-CSRFTOKEN": CSRF_TOKEN}
|
|
||||||
})
|
|
||||||
.done(function(){
|
|
||||||
addMsg('Alias supprimé','success');
|
|
||||||
$("#alias_table").load(location.pathname + " #alias_table");
|
|
||||||
})
|
|
||||||
.fail(function(xhr,textStatus, error){
|
|
||||||
errMsg(xhr.responseJSON);
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
{% block contenttitle %}{% endblock %}
|
{% block contenttitle %}{% endblock %}
|
||||||
|
|
||||||
{% block extracss %}
|
{% block extracss %}
|
||||||
<link rel="stylesheet" href="{% static "registration/login.css" %}">
|
<link rel="stylesheet" href="{% static "registration/css/login.css" %}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
Loading…
Reference in New Issue