Commit 02ea708d authored by hypsug0's avatar hypsug0
Browse files

style: restructure sightings edit form

parent 8c8fd3cb
# https://editorconfig.org/
root = true
[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8
# Docstrings and comments use max_line_length = 79
[*.py]
max_line_length = 99
# Use 2 spaces for the HTML files
[*.html]
indent_size = 2
# The JSON files contain newlines inconsistently
[*.json]
indent_size = 2
insert_final_newline = ignore
[**/admin/js/vendor/**]
indent_style = ignore
indent_size = ignore
# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = ignore
insert_final_newline = ignore
# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab
# Batch files use tabs for indentation
[*.bat]
indent_style = tab
[docs/**.txt]
max_line_length = 79
[*.yml]
indent_size = 2
......@@ -87,27 +87,32 @@ header h1 {
/*font-size: 80%;*/
/*}*/
.page-header {
/*background-color: #1a1a1a;*/
margin: 0px;
text-align: center;
text-align: right;
color: #fff;
height: 170px;
height: 65px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.page-header h1 {
color: #fff;
size: 0.8rem;
/* font-size: 25px; */
size: 0.5rem;
margin-top: 0.5rem;
display: none;
}
.page-header img {
margin-top: 20px;
height: 80px;
margin-top: 8px;
margin-right: 5px;
height: 50px;
}
/* xs < 768 */
@media screen and (max-width: 1280px) {
@media screen and (min-width: 768px) {
.page-header {
/*background-color: #1a1a1a;*/
margin: 0px;
......@@ -119,8 +124,10 @@ header h1 {
.page-header h1 {
color: #fff;
font-size: 25px;
margin-top: 5px;
/* font-size: 25px; */
size: 0.5rem;
margin-top: 0.2rem;
display: block;
}
.page-header img {
......@@ -129,6 +136,33 @@ header h1 {
}
}
@media screen and (min-width:1280px) {
.page-header {
/*background-color: #1a1a1a;*/
margin: 0px;
text-align: center;
color: #fff;
height: 170px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.page-header h1 {
color: #fff;
size: 0.8rem;
}
.page-header img {
margin-top: 20px;
height: 80px;
}
}
/* xs < 768 */
@media screen and (max-width: 1280px) {
}
/* Formulaires */
.form-control {
......@@ -816,3 +850,16 @@ BS Full screen Modal
background-color: white;
border-radius: 5px;
}
#sessionSightingEdit H1 {
margin: 10px;
}
#sessionSightingEditFormList {
background: white;
}
#sessionSightingEditFormDetails {
background: whitesmoke;
}
......@@ -1057,8 +1057,8 @@ const sigthingFormApp = (id_session) => {
},
computesRequired: true
});
VeeValidate.configure({
classes: {
valid: 'has-success',
......@@ -1088,9 +1088,13 @@ const sigthingFormApp = (id_session) => {
hover: true,
isVisible: false,
showRawData: false,
selectedItem: 0,
}
},
methods: {
selectItem(i) {
this.selectedItem = i;
},
showCountDetail(item) {
item.isVisible = !item.isVisible
this.$forceUpdate()
......@@ -1238,15 +1242,15 @@ const sigthingFormApp = (id_session) => {
},
},
computed: {},
watch: {
data: () => {
Countsum = (a, c) => a + c.count
console.log('TEST DATA', this.data);
this.data.forEach(
(e, i) => this.data[i].total_count = this.data[i].countdetails.reduce(Countsum, 0)
)
}
},
// watch: {
// data: () => {
// Countsum = (a, c) => a + c.count
// console.log('TEST DATA', this.data);
// this.data.forEach(
// (e, i) => this.data[i].total_count = this.data[i].countdetails.reduce(Countsum, 0)
// )
// }
// },
mounted() {
this.getDicts()
this.getData()
......
......@@ -2,119 +2,123 @@
{% load i18n %}
{% block content %}
<div class="row" style="text-align:center;font-size:2rem;">
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ placesicon }}"></i> {{ placescount }} {{ placestext }}
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ sessionsicon }}"></i> {{ sessionscount }} {{ sessionstext }}
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ sightingsicon }}"></i> {{ sightingscount }} {{ sightingstext }}
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ observersicon }}"></i> {{ observerscount }} {{ observerstext }}
</div>
</div>
</div>
<div class="row" style="text-align:center;font-size:2rem;">
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ placesicon }}"></i> {{ placescount }} {{ placestext }}
</div>
</div>
{% if user.is_authenticated %}
<div class="row" style="text-align:center;font-size:2rem;">
<div class="col-xs-12 col-sm-6">
<a href="{% url 'sights:place_search' %}" class="btn btn-success btn-lg btn-block">
<i class="fa fa-map"></i> Rechercher des localités / Saisir
</a>
</div>
<div class="col-xs-12 col-sm-6">
<a href="{% url 'sights:sighting_mylist' %}" class="btn btn-warning btn-lg btn-block">
<i class="fa fa-user"></i> Mes observations
</a>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ sessionsicon }}"></i> {{ sessionscount }} {{ sessionstext }}
</div>
</div>
{% endif %}
<h1>
<i class="{{ icon | safe }}"></i> {{ title }}
</h1>
<div class="row">
<div class="col-lg-12">
{% for object in object_list %}
<div class="panel panel-default panel-primary">
<div class="panel-heading">
<h2 class="panel-title"><a href="{% url 'blog:actu_detail' pk=object.id_actu %}"><i
class="fi-align-left"></i> {{ object.title }}</a></h2>
</div>
<div class="panel-body">
<p>
<small>
{% if user.is_resp or user.access_all_data or user.edit_all_data or user.is_staff or user.is_superuser %}
<a href="{% url 'blog:actu_update' pk=object.id_actu %}"
class="btn btn-xs btn-primary"><i
class="fa fa-fw fa-edit"></i></a> {% endif %}
créé le <b>{{ object.timestamp_create }}</b>
par <b>{{ object.created_by }}</b>
{% if object.updated_by %}| mis à jour le {{ object.timestamp_update }} par
{{ object.updated_by }}{% endif %}
</small>
</p>
<div class="well well-sm">{{ object.briefdescr|safe }}</div>
<p class="text-right"><a href="{% url 'blog:actu_detail' pk=object.id_actu %}"
class="btn btn-sm btn-primary">Lire la suite
...</a></p>
</div>
</div>
{% empty %}
<div class="well">
<div class="columns callout">Aucune actualité pour le moment.</div>
</div>
{% endfor %}
{% if is_paginated %}
<nav aria-label="table_navigation" class="pull-right"
style="margin-top:5px;margin-bottom:5px">
<ul class="pagination pagination-sm">
{% if page_obj.has_previous %}
{% block pagination.previous %}
<li class="page-item">
<a class="page-link"
href="{% url 'blog:actu_list' page_obj.previous_page_number %}">Previous</a>
</li>
{% endblock pagination.previous %}
{% endif %}
{% if table.page.has_previous or table.page.has_next %}
{% block pagination.cardinality %}
<li class="page-item">
<a class="page-link" href="#">
{% blocktrans with page_obj.number as current and page_obj.paginator.num_pages as total %}
Page
{{ current }} of {{ total }}{% endblocktrans %}</a>
</li>
{% endblock pagination.cardinality %}
{% endif %}
{% if page_obj.has_next %}
{% block pagination.next %}
<li class="page-item">
<a class="page-link"
href="{% url 'blog:actu_list' page_obj.next_page_number %}">Next</a>
</li>
{% endblock pagination.next %}
{% endif %}
</ul>
</nav>
{% endif %}
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ sightingsicon }}"></i> {{ sightingscount }} {{ sightingstext }}
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-3">
<div class="panel panel-default">
<div class="panel-body">
<i class="{{ observersicon }}"></i> {{ observerscount }} {{ observerstext }}
</div>
</div>
</div>
</div>
{% if user.is_authenticated %}
<div class="row" style="text-align:center;font-size:2rem;">
<div class="col-xs-12 col-sm-6">
<a href="{% url 'sights:place_search' %}" class="btn btn-success btn-lg btn-block">
<i class="fa fa-map"></i> Rechercher des localités / Saisir
</a>
</div>
<div class="col-xs-12 col-sm-6">
<a href="{% url 'sights:sighting_mylist' %}" class="btn btn-warning btn-lg btn-block">
<i class="fa fa-user"></i> Mes observations
</a>
</div>
</div>
{% else %}
<div class="row" style="text-align:center;font-size:2rem;">
<div class="col-xs-12" >
<a href="{% url 'auth_login' %}" class="btn btn-info btn-lg btn-block" alt="{% trans 'Se connecter' %}"><i class="fa fa-fw fa-sign-in-alt" aria-hidden="true"
></i>
{% trans 'Se connecter' %}</a>
</div>
</div>
{% endif %}
<h1>
<i class="{{ icon | safe }}"></i> {{ title }}
</h1>
<div class="row">
<div class="col-lg-12">
{% for object in object_list %}
<div class="panel panel-default panel-primary">
<div class="panel-heading">
<h2 class="panel-title"><a href="{% url 'blog:actu_detail' pk=object.id_actu %}"><i class="fi-align-left"></i>
{{ object.title }}</a></h2>
</div>
<div class="panel-body">
<p>
<small>
{% if user.is_resp or user.access_all_data or user.edit_all_data or user.is_staff or user.is_superuser %}
<a href="{% url 'blog:actu_update' pk=object.id_actu %}" class="btn btn-xs btn-primary"><i
class="fa fa-fw fa-edit"></i></a> {% endif %}
créé le <b>{{ object.timestamp_create }}</b>
par <b>{{ object.created_by }}</b>
{% if object.updated_by %}| mis à jour le {{ object.timestamp_update }} par
{{ object.updated_by }}{% endif %}
</small>
</p>
<div class="well well-sm">{{ object.briefdescr|safe }}</div>
<p class="text-right"><a href="{% url 'blog:actu_detail' pk=object.id_actu %}"
class="btn btn-sm btn-primary">Lire la suite
...</a></p>
</div>
</div>
{% empty %}
<div class="well">
<div class="columns callout">Aucune actualité pour le moment.</div>
</div>
{% endfor %}
{% if is_paginated %}
<nav aria-label="table_navigation" class="pull-right" style="margin-top:5px;margin-bottom:5px">
<ul class="pagination pagination-sm">
{% if page_obj.has_previous %}
{% block pagination.previous %}
<li class="page-item">
<a class="page-link" href="{% url 'blog:actu_list' page_obj.previous_page_number %}">Previous</a>
</li>
{% endblock pagination.previous %}
{% endif %}
{% if table.page.has_previous or table.page.has_next %}
{% block pagination.cardinality %}
<li class="page-item">
<a class="page-link" href="#">
{% blocktrans with page_obj.number as current and page_obj.paginator.num_pages as total %}
Page
{{ current }} of {{ total }}{% endblocktrans %}</a>
</li>
{% endblock pagination.cardinality %}
{% endif %}
{% if page_obj.has_next %}
{% block pagination.next %}
<li class="page-item">
<a class="page-link" href="{% url 'blog:actu_list' page_obj.next_page_number %}">Next</a>
</li>
{% endblock pagination.next %}
{% endif %}
</ul>
</nav>
{% endif %}
</div>
</div>
{% endblock %}
{% load staticfiles %}
<header>
<div class="page-header">
<img src="{% static 'img/logo_site.png' %}">
<img src="{% static 'img/logo_site.png' %}" loading="lazy">
<h1>{{ SITE_NAME }}</h1>
</div>
</header>
\ No newline at end of file
</header>
{% load i18n %}
{% load staticfiles %}
<nav class="navbar navbar-default navbar-fixed-top" id="sidebar-wrapper" role="navigation">
<ul class="nav sidebar-nav">
<li class="sidebar-brand">
<a href="/"><img src="{% static 'img/dbchiro_main_logo.svg' %}" width="30"> dbChiro<sub>[web]</sub></a>
<ul class="nav sidebar-nav">
<li class="sidebar-brand">
<a href="/"><img src="{% static 'img/dbchiro_main_logo.svg' %}" width="30"> dbChiro<sub>[web]</sub></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-fw fa-chart-pie" aria-hidden="true"></i> {% trans 'Synthèse' %} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{% url 'synthesis:global_contrib' %}"><i class="fa fa-fw fa-chart-line" aria-hidden="true"></i>
{% trans 'Contributions' %}</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-fw fa-chart-pie" aria-hidden="true"></i> {% trans 'Synthèse' %} <span
class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{% url 'synthesis:global_contrib' %}"><i class="fa fa-fw fa-chart-line"
aria-hidden="true"></i>
{% trans 'Contributions' %}</a>
</li>
</ul>
</ul>
</li>
{% if user.is_authenticated %} {# Début du menu des Observations #}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-eye"></i>
{% trans 'Observations' %} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{% url 'sights:place_map' %}"><i class="far fa-map"></i> {% trans 'Carte' %}<span
class="hide-for-small-only"> {% trans 'des localités et métasites' %}</span></a></li>
<li class="dropdown-header">
<i class="fa fa-fw fa-map-pin"></i> {% trans 'Localités' %}</a>
</li>
{% if user.is_authenticated %} {# Début du menu des Observations #}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-eye"></i>
{% trans 'Observations' %} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{% url 'sights:place_map' %}"><i class="far fa-map"></i> {% trans 'Carte' %}<span
class="hide-for-small-only"> {% trans 'des localités et métasites' %}</span></a></li>
<li class="dropdown-header">
<i class="fa fa-fw fa-map-pin"></i> {% trans 'Localités' %}</a>
</li>
<li><a href="{% url 'sights:place_search' %}"><i class="fa fa-fw fa-search"></i>
{% trans 'Rechercher' %}<span class="hide-for-small-only">
{% trans 'des localités' %}</span></a></li>
<li><a href="{% url 'sights:place_create' %}"><i class="fa fa-fw fa-map-marker-alt"></i>
{% trans 'Nouvelle localité' %}</a></li>
</li>
<li class="dropdown-header">
<i class="fa fa-fw fa-map-pin"></i> {% trans 'Métasite' %}</a>
</li>
<li><a href="{% url 'sights:metaplace_search' %}"><i class="fa fa-fw fa-search"></i>
{% trans 'Rechercher un métasite' %}</a></li>
</li>
<li><a href="{% url 'sights:metaplace_create' %}"><i class="fa fa-fw fa-draw-polygon"></i>
{% trans 'Nouveau métasite' %}</a></li>
</li>
<li><a href="{% url 'sights:place_search' %}"><i class="fa fa-fw fa-search"></i>
{% trans 'Rechercher' %}<span class="hide-for-small-only">
{% trans 'des localités' %}</span></a></li>
<li><a href="{% url 'sights:place_create' %}"><i class="fa fa-fw fa-map-marker-alt"></i>
{% trans 'Nouvelle localité' %}</a></li>
</li>
<li class="dropdown-header">
<i class="fa fa-fw fa-map-pin"></i> {% trans 'Métasite' %}</a>
</li>
<li><a href="{% url 'sights:metaplace_search' %}"><i class="fa fa-fw fa-search"></i>
{% trans 'Rechercher un métasite' %}</a></li>
</li>
<li><a href="{% url 'sights:metaplace_create' %}"><i class="fa fa-fw fa-draw-polygon"></i>
{% trans 'Nouveau métasite' %}</a></li>
</li>
{% if user.is_resp or user.access_all_data or user.edit_all_data or user.is_staff or user.is_superuser or SEE_ALL_NON_SENSITIVE_DATA %}
<li class="dropdown-header">
<i class="fa fa-fw fa-eye"></i> {% trans 'Observations' %}
</li>
<li>
<a href="{% url 'sights:sighting_search' %}"><i class="fa fa-fw fa-list"></i>
{% trans 'Rechercher des observations' %}</a>
</li>
{% endif %}
</ul>
</li>
{# Fin du menu des Observations #} {# Début du menu de gestion #}
{% comment %} <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-paperclip"></i>
{% trans 'Metadonnées' %}<span class="caret"></span>
</a>
{% if user.is_resp or user.access_all_data or user.edit_all_data or user.is_staff or user.is_superuser or SEE_ALL_NON_SENSITIVE_DATA %}
<li class="dropdown-header">
<i class="fa fa-fw fa-eye"></i> {% trans 'Observations' %}
</li>
<li>
<a href="{% url 'sights:sighting_search' %}"><i class="fa fa-fw fa-list"></i>
{% trans 'Rechercher des observations' %}</a>
</li>
{% endif %}
<ul class="dropdown-menu">
<li>
<a href="{% url 'metadata:organisms_list' %}"><i
class="fa fa-fw fa-user-plus"></i>
{% trans 'Organismes' %}</a>
</li>
<li><a href="{% url 'metadata:acquisition_framework_create' %}"><i class="fa fa-fw fa-list-alt"></i>
{% trans "Cadres d'acquisitions" %}</a>
</li>
<li><a href="{% url 'metadata:acquisition_framework_create' %}"><i
class="fa fa-fw fa-user-plus"></i>
{% trans 'Jeux de données' %}</a>
</li>
</ul>
</li> {% endcomment %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-paperclip"></i>
{% trans 'Gestion' %}<span class="caret"></span>
</a>
</ul>
</li>
{# Fin du menu des Observations #} {# Début du menu de gestion #}
{% comment %} <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-fw fa-paperclip"></i>
{% trans 'Metadonnées' %}<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{% if user.is_resp or user.access_all_data or user.edit_all_data or user.is_staff or user.is_superuser %}
<li class="dropdown-header">
<i class="fa fa-fw fa-users" aria-hidden="true"></i> {% trans 'Observateurs' %}
</li>
<li><a href="{% url 'accounts:user_search' %}"><i class="fa fa-fw fa-list-alt"></i>
{% trans 'Liste des observateurs' %}</a>
</li>
<li><a href="{% url 'accounts:user_create' %}"><i class="fa fa-fw fa-user-plus"></i>
{% trans 'Nouvel observateur' %}</a>
</li>
<li class="dropdown-header">
<i class="far fa-newspaper" aria-hidden="true"></i> {% trans 'Actualités' %}</a>
</li>
<li><a href="{% url 'blog:actu_create' %}"><i
class="fa fa-fw fa-plus"></i> {% trans 'Nouvel article' %}</a>
</li>
{% endif %}
<li class="dropdown-header">
<i class="far fa-folder-open"></i> {% trans 'Etudes' %}</a>
</li>
<li><a href="{% url 'management:study_list' %}"><i class="fa fa-fw fa-list"></i>
{% trans 'Liste des études' %}</a></li>
<li><a href="{% url 'management:study_create' %}"><i class="fa fa-fw fa-plus"></i>
{% trans 'Nouvelle étude' %}</a></li>
<li class="dropdown-header">
<i class="fa fa-fw fa-podcast"></i> {% trans 'Emetteurs télémétriques' %}</a>
</li>
<li><a href="{% url 'management:transmitter_list' %}"><i class="fa fa-fw fa-list"></i>
{% trans 'Liste des émetteurs' %}</span></a>
</li>
<li><a href="{% url 'management:transmitter_create' %}"><i class="fa fa-fw fa-plus"></i>
{% trans 'Nouvel émetteur' %}</a>
</li>
</li>
<li class="dropdown-header">
<i class="fa fa-fw fa-gavel"></i> {% trans 'Arrêtés dérogatoires' %}
<li><a href="{% url 'management:catchauth_list' %}"><i class="fa fa-fw fa-list"></i>
{% trans 'Liste des arrêtés' %}</a>
</li>
<li><a href="{% url 'management:catchauth_create' %}"><i class="fa fa-fw fa-plus"></i>
{% trans 'Nouvel arrêté' %}</a>
</li>