Ajout des lieux plus clair
This commit is contained in:
parent
59e1840308
commit
8dd35a6207
3 changed files with 78 additions and 31 deletions
|
@ -171,36 +171,68 @@ div.lieuform p {
|
||||||
|
|
||||||
div#candidats ul {
|
div#candidats ul {
|
||||||
list-style:none;
|
list-style:none;
|
||||||
padding:0;
|
padding:10px;
|
||||||
margin:0;
|
margin:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#candidats li, div#candidats #addcandidat {
|
div#candidats li{
|
||||||
list-style:none;
|
list-style:none;
|
||||||
display:block;
|
display:block;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
background:#5AC99C;
|
padding:0;
|
||||||
cursor:pointer;
|
|
||||||
padding:10px;
|
|
||||||
border:2px #fff;
|
border:2px #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#candidats #addcandidat {
|
div#candidats li a, div#candidats #addcandidat {
|
||||||
width:90%;
|
display:block;
|
||||||
margin:15px auto;
|
background:#5AC99C;
|
||||||
|
padding:10px;
|
||||||
|
color:#000;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#candidats li input {
|
div#candidats li a .choice_btn {
|
||||||
float:right;
|
float:right;
|
||||||
background:none;
|
background:none;
|
||||||
text-decoration:underline;
|
text-decoration:underline;
|
||||||
border:none;
|
border:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#candidats #addcandidat {
|
||||||
|
width:90%;
|
||||||
|
margin:15px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
div#candidats input {
|
||||||
|
float:none;
|
||||||
|
}
|
||||||
|
|
||||||
div#candidats #addcandidat {
|
div#candidats #addcandidat {
|
||||||
font-size:20px;
|
font-size:20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#addlieu_win .win_content{
|
||||||
|
max-width:600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn_like {
|
||||||
|
display:block;
|
||||||
|
background:#5AC99C;
|
||||||
|
padding:10px;
|
||||||
|
color:#000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#addlieu_btn {
|
||||||
|
text-align:center;
|
||||||
|
font-size:1.5em;
|
||||||
|
padding:30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#addlieu_btn:before {
|
||||||
|
content:"+";
|
||||||
|
margin-right:12px;
|
||||||
|
}
|
||||||
|
|
||||||
/* stages */
|
/* stages */
|
||||||
#stage_present {
|
#stage_present {
|
||||||
display:table;
|
display:table;
|
||||||
|
@ -270,9 +302,9 @@ ul.bigger li:hover{
|
||||||
color:#B8741A;
|
color:#B8741A;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* feedback */
|
/* Fenêtre */
|
||||||
|
|
||||||
#feedback_bg {
|
.win_bg {
|
||||||
display:none;
|
display:none;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
width:100%;
|
width:100%;
|
||||||
|
@ -283,36 +315,39 @@ ul.bigger li:hover{
|
||||||
left:0;
|
left:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#feedback_centrer {
|
.win_centrer {
|
||||||
display:table-cell;
|
display:table-cell;
|
||||||
vertical-align:middle;
|
vertical-align:middle;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
overflow-y:auto;
|
overflow-y:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#feedback_close {
|
.win_close {
|
||||||
float:right;
|
float:right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#feedback_win {
|
.win_content {
|
||||||
text-align:left;
|
text-align:left;
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
padding:0;
|
padding:0;
|
||||||
max-width:500px;
|
max-width:500px;
|
||||||
|
width:90%;
|
||||||
background:#fff;
|
background:#fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#feedback_win h2 {
|
.win_content h2 {
|
||||||
background:#000;
|
background:#000;
|
||||||
color:#fff;
|
color:#fff;
|
||||||
padding:20px;
|
padding:20px;
|
||||||
margin-top:0;
|
margin-top:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#feedback_win textarea {
|
.win_content textarea {
|
||||||
min-height:150px;
|
min-height:150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fenêtres spéciales */
|
||||||
|
|
||||||
#feedback_btn {
|
#feedback_btn {
|
||||||
position:fixed;
|
position:fixed;
|
||||||
top:65%;
|
top:65%;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Modifier les lieux du stage "{{ stage.sujet }}"</h1>
|
<h1>Lieux du stage "{{ stage.sujet }}"</h1>
|
||||||
<p><a href="{% url 'monstage:stage' stage.id %}">Retour</a></p>
|
<p><a href="{% url 'monstage:stage' stage.id %}">Retour</a></p>
|
||||||
|
|
||||||
<form action="{% url 'monstage:stage_edit_lieu' stage.id %}" method="post">
|
<form action="{% url 'monstage:stage_edit_lieu' stage.id %}" method="post">
|
||||||
|
@ -24,11 +24,18 @@
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
<a id="addlieu_btn" class="btn_like" href="javascript:showAddLieu(true);">Ajouter un lieu</a>
|
||||||
|
|
||||||
<h2>Ajouter un autre lieu</h2>
|
<div id="addlieu_win" class="win_bg">
|
||||||
|
<div class="win_centrer">
|
||||||
|
<div class="win_content">
|
||||||
|
<h2>Ajouter un autre lieu<a class="win_close" href="javascript:showAddLieu(false)">X</a></h2>
|
||||||
<p><input id="addlieu" type="text" placeholder="Chercher un établissement" /></p>
|
<p><input id="addlieu" type="text" placeholder="Chercher un établissement" /></p>
|
||||||
<div id="map_addlieu"></div>
|
<div id="map_addlieu"></div>
|
||||||
<div id="candidats"></div>
|
<div id="candidats"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="submit" value="Enregistrer" onclick="return checkForm();"/>
|
<input type="submit" value="Enregistrer" onclick="return checkForm();"/>
|
||||||
</form>
|
</form>
|
||||||
|
@ -41,7 +48,7 @@
|
||||||
$("#addlieu").geocomplete({
|
$("#addlieu").geocomplete({
|
||||||
map: "#map_addlieu",
|
map: "#map_addlieu",
|
||||||
types: ["geocode", "establishment"],
|
types: ["geocode", "establishment"],
|
||||||
}).on("geocode:result", function(event, result){ $("#map_addlieu").css("display", "block"); digere(result); console.log(result); });
|
}).on("geocode:result", function(event, result){ digere(result); console.log(result); });
|
||||||
});
|
});
|
||||||
var fieldcount = {{ numforms }};
|
var fieldcount = {{ numforms }};
|
||||||
var places = $("#places");
|
var places = $("#places");
|
||||||
|
@ -59,8 +66,8 @@
|
||||||
fieldcount++;
|
fieldcount++;
|
||||||
document.getElementById('numplaces').value = fieldcount;
|
document.getElementById('numplaces').value = fieldcount;
|
||||||
predata = undefined;
|
predata = undefined;
|
||||||
|
showAddLieu(false);
|
||||||
clearCandidats();
|
clearCandidats();
|
||||||
$("#map_addlieu").css("display", "none");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addKnownPlace(data) {
|
function addKnownPlace(data) {
|
||||||
|
@ -73,6 +80,7 @@
|
||||||
fieldcount++;
|
fieldcount++;
|
||||||
document.getElementById('numplaces').value = fieldcount;
|
document.getElementById('numplaces').value = fieldcount;
|
||||||
predata = undefined;
|
predata = undefined;
|
||||||
|
showAddLieu(false);
|
||||||
clearCandidats();
|
clearCandidats();
|
||||||
$("#map_addlieu").css("display", "none");
|
$("#map_addlieu").css("display", "none");
|
||||||
}
|
}
|
||||||
|
@ -112,18 +120,18 @@
|
||||||
for (var i in candidats.lieux) {
|
for (var i in candidats.lieux) {
|
||||||
lieu = candidats.lieux[i];
|
lieu = candidats.lieux[i];
|
||||||
console.log(lieu)
|
console.log(lieu)
|
||||||
liste.append($("<li>", {html: lieu.name + " ("+lieu.distance+") <input type=\"button\" value=\"Choisir cet établissement\" />"}).prop("data", lieu).click(clickCandidat));
|
liste.append($("<li>", {html: "<a class=\"choose_lieu\" href=\"javascript:void(0);\"> "+lieu.name + " ("+lieu.distance+") <span class=\"choice_btn\">Choisir cet établissement</span></a>"}).prop("data", lieu).click(clickCandidat));
|
||||||
}
|
}
|
||||||
var candi = $("#candidats");
|
var candi = $("#candidats");
|
||||||
clearCandidats();
|
clearCandidats();
|
||||||
if (candidats.lieux.length == 0) {
|
if (candidats.lieux.length == 0) {
|
||||||
candi.append($("<h3>", {text:"(Aucun établissement déjà référencé à proximité)"}));
|
candi.append($("<h3>", {text:"(Aucun établissement déjà référencé à proximité)"}));
|
||||||
candi.append($("<input>", {id:"addcandidat", type:"button", value:"Enregistrer une nouvelle institution"})
|
candi.append($("<input>", {id:"addcandidat", type:"button", class:"btn_like", value:"Enregistrer une nouvelle institution"})
|
||||||
.click(function(){addNewPlace(predata)}) );
|
.click(function(){addNewPlace(predata)}) );
|
||||||
} else {
|
} else {
|
||||||
candi.append($("<h3>", {text:"Choisir parmi les lieux déjà référencés :"}));
|
candi.append($("<h3>", {text:"Choisir parmi les lieux déjà référencés :"}));
|
||||||
candi.append(liste);
|
candi.append(liste);
|
||||||
candi.append($("<input>", {id:"addcandidat", type:"button", value:"Ou bien créer une nouvelle institution"})
|
candi.append($("<input>", {id:"addcandidat", type:"button", class:"btn_like", value:"Ou bien créer une nouvelle institution"})
|
||||||
.click(function(){addNewPlace(predata)}) );
|
.click(function(){addNewPlace(predata)}) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,6 +156,10 @@
|
||||||
}else
|
}else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showAddLieu(show) {
|
||||||
|
document.getElementById("addlieu_win").style.display=show?"table":"none";
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<title>{% block title %}ExperiENS{% endblock %}</title>
|
<title>{% block title %}ExperiENS{% endblock %}</title>
|
||||||
<link type="text/css" rel="stylesheet" href="{% static 'style.css' %}" />
|
<link type="text/css" rel="stylesheet" href="{% static 'style.css' %}" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
<script type="text/javascript">function showFeedback(show){document.getElementById("feedback_bg").style.display=show?"table":"none";}</script>
|
<script type="text/javascript">function showFeedback(show){document.getElementById("feedback_win").style.display=show?"table":"none";}</script>
|
||||||
{% block extra_head %}{% endblock %}
|
{% block extra_head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{% if user.username %}
|
{% if user.username %}
|
||||||
<div id="feedback_bg">
|
<div id="feedback_win" class="win_bg">
|
||||||
<div id="feedback_centrer">
|
<div class="win_centrer">
|
||||||
<div id="feedback_win">
|
<div class="win_content">
|
||||||
<h2>Envoyer un avis sur le site<a id="feedback_close" href="javascript:showFeedback(false)">X</a></h2>
|
<h2>Envoyer un avis sur le site<a class="win_close" href="javascript:showFeedback(false)">X</a></h2>
|
||||||
<form method="POST" action="{% url 'monstage:send_feedback' %}?next={{ request.path|urlencode }}">
|
<form method="POST" action="{% url 'monstage:send_feedback' %}?next={{ request.path|urlencode }}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<p>Connecté en tant que {{ user.profil }}</p>
|
<p>Connecté en tant que {{ user.profil }}</p>
|
||||||
|
|
Loading…
Reference in a new issue