lots of fixes
This commit is contained in:
@@ -3,16 +3,7 @@
|
||||
|
||||
{% block page_content %}
|
||||
<div class="col-lg-7 col-md-12">
|
||||
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading" role="tab" id="notesHeading">
|
||||
<h3 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseNotes" aria-expanded="true" aria-controls="collapseOne">
|
||||
Notes</a>
|
||||
</h3>
|
||||
</div>
|
||||
{% block pre_content %}{% endblock %}
|
||||
<table class="table table-striped table-bordered">
|
||||
<table class="table table-bordered">
|
||||
{% for note in notes %}
|
||||
{% if maraude %}
|
||||
{% inline_table note header="sujet" %}
|
||||
@@ -21,9 +12,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% block post_content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% block pagination %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-5 col-md-12">
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block right_column %}
|
||||
<div class="card position-fixed">
|
||||
<div class="card ml-auto position-fixed">
|
||||
<h6 class="card-header">Informations</h6>
|
||||
<div class="card-body">
|
||||
<p><strong>Maraudeurs :</strong> {{ maraude.binome }} & {{ maraude.referent }}</p>
|
||||
|
||||
@@ -6,55 +6,27 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ block.super }}
|
||||
<li><a href="{% url "notes:liste-sujet" %}">Sujets</a></li>
|
||||
<li>{{ sujet }}</li>
|
||||
<h6 class="navbar-text text-white my-2">{{ sujet }}</h6>
|
||||
{% endblock %}
|
||||
|
||||
{% block pre_content %}
|
||||
<div id="collapseNotes" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="notesHeading">
|
||||
{% endblock %}
|
||||
|
||||
{% block post_content %}
|
||||
{% if notes.has_other_pages %}<div class="panel-footer text-center">
|
||||
<ul class="pagination">
|
||||
{% block pagination %}
|
||||
<div class="d-flex justify-content-center">
|
||||
{% if notes.has_other_pages %}<ul class="pagination">
|
||||
{% for num in notes.paginator.page_range %}
|
||||
<li {% if notes.number == num %} class="active" {%endif%}><a href="?page={{num}}">{{num}}</a></li>
|
||||
<li class="page-item {% if notes.number == num %}active{%endif%}"><a class="page-link" href="?page={{num}}">{{num}}</a></li>
|
||||
{%endfor%}
|
||||
</ul>
|
||||
</div>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" role="tab" id="notesAjoutHeading">
|
||||
<h4 class="panel-title">
|
||||
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseNotesAjout" aria-expanded="false" aria-controls="collapseTwo">
|
||||
Ajouter une note
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseNotesAjout" class="panel-collapse collapse" role="tabpanel" aria-labelledby="notesAjoutHeading">
|
||||
<div class="panel-body">
|
||||
<form method="POST" action="">{% csrf_token %}
|
||||
{% bootstrap_form note_form show_label=False %}
|
||||
</div>
|
||||
<div class="panel-footer text-right">
|
||||
{% bootstrap_button "Enregistrer" button_type="submit" %}
|
||||
</form>
|
||||
</div>
|
||||
</ul>{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block right_column %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">Informations</h4>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h6 class="card-header">Informations</h6>
|
||||
{% include "notes/details_sujet_inner.html" %}
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><h4 class="panel-title">Statistiques</h4></div>
|
||||
<div class="card mt-2">
|
||||
<h6 class="card-header">Statistiques</h6>
|
||||
<div id="stats-content">
|
||||
{% include "statistiques/fiche_stats_details.html" with object=sujet.statistiques %}
|
||||
</div>
|
||||
@@ -89,6 +61,7 @@
|
||||
|
||||
{% block sidebar %}
|
||||
{{ block.super }}
|
||||
<h6 class="sidebar-heading mt-4 px-3 text-danger">TODO: Ajouter une note</h6>
|
||||
{% if user.is_superuser %}
|
||||
<h6 class="sidebar-heading mt-4 px-3">Administration</h6>
|
||||
<div class="px-3 btn-group-vertical d-flex justify-content-center" role="group" aria-label="...">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div id="sujet-content">
|
||||
<table class="table table-striped">
|
||||
<table class="table table-sm table-striped">
|
||||
{% with "-" as none %}
|
||||
<tr><th>Nom</th><th>Surnom</th><th>Prénom</th></tr>
|
||||
<tr><td>{{ sujet.nom|default:none }}</td><td>{{ sujet.surnom|default:none}}</td><td>{{ sujet.prenom|default:none}}</td></tr>
|
||||
@@ -7,9 +7,7 @@
|
||||
<tr><td>{{ sujet.age|default_if_none:none }}</td><td colspan="2">{{ sujet.premiere_rencontre|default_if_none:none }}</td></tr>
|
||||
{% endwith %}
|
||||
</table>
|
||||
<div class="panel-footer text-right" id="sujet-buttons">
|
||||
<span class="text-right"><span class="btn btn-primary btn-sm" id="update-sujet">Mettre à jour</a></span>
|
||||
</div>
|
||||
<button class="btn btn-primary btn-sm btn-block" id="update-sujet">Mettre à jour</a></span>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
{% load bootstrap3 %}
|
||||
{% load bootstrap4 %}
|
||||
<form action="{% url "notes:update-sujet" form.instance.pk %}" method="post">{% csrf_token %}
|
||||
<table class="table table-striped">
|
||||
{% with "-" as none %}
|
||||
<table class="table table-sm table-striped">
|
||||
{% with none="-" sz="small" %}
|
||||
<tr><th>Nom</th><th>Surnom</th><th>Prénom</th></tr>
|
||||
<tr><td>{% bootstrap_field form.nom show_label=False %}</td><td>{% bootstrap_field form.surnom show_label=False %}</td><td>{% bootstrap_field form.prenom show_label=False %}</td></tr>
|
||||
<tr><td>{% bootstrap_field form.nom size=sz show_label=False %}</td><td>{% bootstrap_field form.surnom size=sz show_label=False %}</td><td>{% bootstrap_field form.prenom size=sz show_label=False %}</td></tr>
|
||||
<tr><th>Âge</th><th>Genre</th><th>Première rencontre</th></tr>
|
||||
<tr><td>{% bootstrap_field form.age show_label=False %}</td><td>{% bootstrap_field form.genre show_label=False %}</td><td>{% bootstrap_field form.premiere_rencontre show_label=False %}</td></tr>
|
||||
<tr><td>{% bootstrap_field form.age size=sz show_label=False %}</td><td>{% bootstrap_field form.genre size=sz show_label=False %}</td><td>{% bootstrap_field form.premiere_rencontre size=sz show_label=False %}</td></tr>
|
||||
{% endwith %}
|
||||
</table>
|
||||
<div class="panel-footer text-right">
|
||||
<span class="text-right">{% bootstrap_button "Enregistrer" button_type="submit" %}
|
||||
<span class="btn btn-primary btn-sm" id="cancel">Annuler</span></span>
|
||||
<div class="btn-group d-flex flex-fill">
|
||||
{% bootstrap_button "Enregistrer" button_type="submit" button_class="btn btn-success btn-sm" %}
|
||||
<button class="btn btn-primary btn-sm" id="cancel">Annuler</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<tr >
|
||||
<tr class="d-table-row shadow">
|
||||
<th class="border-{{bg_color}}" width="20%">
|
||||
{% if link %}
|
||||
<a href="{{link}}"><strong>{{header}}</strong></a>
|
||||
@@ -6,7 +6,7 @@
|
||||
<strong>{{header}}</strong>
|
||||
{% endif %} <small>{{small}}</small>
|
||||
<br />
|
||||
<div style="margin:5px 0px;">
|
||||
<div style="mt-2">
|
||||
{% for label in labels %}
|
||||
<span class="badge badge-{{bg_label_color}}" style="padding:2px 5px;">{{label}}</span>
|
||||
{% endfor %}
|
||||
|
||||
@@ -88,7 +88,8 @@ class MaraudeListView(ListView):
|
||||
queryset = Maraude.objects.get_past().order_by("-date")
|
||||
|
||||
filters = [
|
||||
("Ce mois-ci", lambda qs: qs.filter(date__month=timezone.now().date().month)),
|
||||
("Ce mois-ci", lambda qs: qs.filter(date__month=timezone.now().date().month,
|
||||
date__year=timezone.now().date().year)),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{% load boolean_icons bootstrap4 %}
|
||||
<table class="table">
|
||||
{% with th_css="bg-dark text-white" %}
|
||||
<table class="table table-sm">
|
||||
<tr>
|
||||
<th colspan="4" class="active">Problématiques</th>
|
||||
<th colspan="4" class="{{th_css}}">Problématiques</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Psychiatrique</th>
|
||||
@@ -16,7 +17,7 @@
|
||||
<td>{{ object.prob_somatique|as_icon }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4" class="active">Habitation</th>
|
||||
<th colspan="4" class="{{th_css}}">Habitation</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
@@ -25,13 +26,13 @@
|
||||
<td>{{ object.connu_siao|as_icon }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4" class="active">Ressources</th>
|
||||
<th colspan="4" class="{{th_css}}">Ressources</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">{{ object.ressources }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4" class="active">Parcours de vie</th>
|
||||
<th colspan="4" class="{{th_css}}">Parcours de vie</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{{ object.parcours_de_vie }}</td>
|
||||
@@ -39,4 +40,4 @@
|
||||
<td>{{ object.lien_familial|as_icon }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{% endwith %}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{% load bootstrap3 %}
|
||||
{% load bootstrap4 %}
|
||||
<form action="{% url "statistiques:update" form.instance.pk %}" method="post" id="update-stats-form">{% csrf_token%}
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th colspan="4" class="active">Problématiques</th>
|
||||
<th colspan="4" class="bg-dark text-white">Problématiques</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Psychiatrique</th>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<table class="table table-striped table-borderless shadow">
|
||||
<table class="table table-borderless shadow">
|
||||
{% if header %}<tr>
|
||||
<th colspan="{{ cols_number }}" class="thead-dark text-center">{{ header }}</th>
|
||||
</tr>{% endif %}
|
||||
|
||||
@@ -4,11 +4,11 @@ register = template.Library()
|
||||
|
||||
@register.filter
|
||||
def as_icon(value):
|
||||
icons = {True: "ok",
|
||||
False: "remove",
|
||||
None: "asterisk"
|
||||
icons = {True: "circle-check",
|
||||
False: "circle-x",
|
||||
None: "question-mark"
|
||||
}
|
||||
if not value in icons:
|
||||
raise ValueError(value, 'is not a boolean or empty value !')
|
||||
else:
|
||||
return format_html('<span class="glyphicon glyphicon-{}"></span>', icons[value])
|
||||
return format_html('<span class="oi oi-{}" aria-hidden="true"></span>', icons[value])
|
||||
|
||||
Reference in New Issue
Block a user