Commit 1a9c5369 authored by hypsug0's avatar hypsug0
Browse files

wip: Update sighting form

parent 95d27740
......@@ -1188,12 +1188,16 @@ Vue.component('specieSelect', {
},
template: `
<span>
<v-select :disabled="disabled" class="form-control v-select-style" :options="options" :reduce="e => e.id" label="codesp" v-model="model">
<v-select
:disabled="disabled" class="form-control v-select-style"
:options="options" :reduce="e => e.id" label="codesp" v-model="model"
data-toggle="tooltip" data-placement="bottom"
title="Cliquez sur l'icone d'édition pour modifier le taxon">
<template v-slot:option="option">
<span class="label label-default" :class="option.sp_true?'label-success':'label-default' ">{{option.codesp}}</span> {{option.sci_name}}
<span class="label label-default" :class="option.sp_true?'label-success':option.codesp.startsWith('0') ? 'label-primary':'label-default' ">{{option.codesp}}</span> {{option.sci_name}}
</template>
<template #selected-option="{ sp_true, codesp, sci_name }">
<span class="label" :class="sp_true?'label-success':'label-default' ">{{codesp}}</span>&nbsp;{{sci_name}}
<span class="label" :class="sp_true?'label-success':codesp.startsWith('0') ? 'label-primary':'label-default' ">{{codesp}}</span>&nbsp;{{sci_name}}
</template>
</v-select>
<i class="fas fa-edit" :class="disabled ? 'text-muted':'text-warning'" @click="editState()"></i>
......@@ -1576,20 +1580,23 @@ const sigthingFormApp = (id_session, type_contact) => {
},
getDictSpecie() {},
getDicts() {
$http
.get('/api/v1/dicts')
.then((response) => {
this.dicts = response.data
this.dictSpecies = this.dicts.Specie.sort((a, b) => {
const ca = a.codesp,
cb = b.codesp
return ca < cb ? -1 : ca > cb ? 1 : 0
}).sort((a, b) => Number(b.sp_true) - Number(a.sp_true))
this.dictsLoaded = true
})
.catch((err) => {
console.error(err)
})
this.dicts = JSON.parse(localStorage.getItem('dicts'))
this.dictSpecies = JSON.parse(localStorage.getItem('dictSpecies'))
// $http
// .get('/api/v1/dicts')
// .then((response) => {
// this.dicts = response.data
// this.dictSpecies = this.dicts.Specie.sort((a, b) => {
// const ca = a.codesp,
// cb = b.codesp
// return ca < cb ? -1 : ca > cb ? 1 : 0
// }).sort((a, b) => Number(b.sp_true) - Number(a.sp_true))
// this.dictsLoaded = true
// })
// .catch((err) => {
// console.error(err)
// })
// console.debug('LocalStorageDIct status', localStorage.getItem('dicts') )
// if (localStorage.getItem('dicts') == null) {
......@@ -1635,10 +1642,11 @@ const sigthingFormApp = (id_session, type_contact) => {
},
sumCountDetails(is) {
const CountSum = (a, c) => a + parseInt(c.count)
return this.data[is].countdetails.reduce(CountSum, 0)
// const notNullData = this.data[is].countdetails.filter(e => e.count !== null)
return this.data[is].countdetails.filter(e => e.count !== null).reduce(CountSum, 0)
},
getData() {
if (this.dicts != null) {
if (Object.entries(this.dicts).length === 0) {
this.getDicts()
}
$http
......
......@@ -7,7 +7,7 @@ const asyncForEach = async (array, callback) => {
}
}
Vue.component('ValidationProvider', VeeValidate.ValidationProvider);
Vue.component('ValidationProvider', VeeValidate.ValidationProvider)
const getCookie = (name) => {
let cookieValue = null
......@@ -38,6 +38,33 @@ if (csrftoken) {
$http.defaults.headers.common['X-CSRFToken'] = csrftoken
}
const storeDicts = () => {
// if (localStorage.getItem('dicts') === null) {
if (true) {
$http
.get('/api/v1/dicts')
.then((response) => {
console.debug('Prepare to store dicts in localStorage')
localStorage.setItem('dicts', JSON.stringify(response.data))
localStorage.setItem(
'dictSpecies',
JSON.stringify(
response.data.Specie.sort((a, b) => {
const ca = a.codesp,
cb = b.codesp
return ca < cb ? -1 : ca > cb ? 1 : 0
}).sort((a, b) => Number(b.sp_true) - Number(a.sp_true))
)
)
})
.catch((err) => {
console.error(err)
})
}
}
storeDicts()
const dataTableLanguage = {
processing: 'Traitement en cours...',
search: 'Rechercher&nbsp;:',
......
......@@ -133,6 +133,20 @@ CACHES = {
}
}
# CACHES = {
# "default": {
# "BACKEND": "django_redis.cache.RedisCache",
# "LOCATION": "redis://127.0.0.1:6379/1",
# "OPTIONS": {
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
# },
# }
# }
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"
CACHE_TTL = 60 * 15
WSGI_APPLICATION = "dbchiro.wsgi.application"
# Database
......@@ -149,8 +163,6 @@ DATABASES = {
}
}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
# Customizing User model
......
......@@ -2,12 +2,19 @@ import json
import logging
from django.apps import apps
from django.conf import settings
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from django.http import Http404, HttpResponse
from django.views.decorators.cache import cache_page
# Get an instance of a logger
logger = logging.getLogger(__name__)
CACHE_TTL = getattr(settings, "CACHE_TTL", DEFAULT_TIMEOUT)
@cache_page(CACHE_TTL)
def apiDicts(req):
"""List all values from all dicts in one single request"""
......@@ -24,6 +31,7 @@ def apiDicts(req):
return HttpResponse(jsondicts, content_type="application/json")
@cache_page(CACHE_TTL)
def apiDict(req, model):
"""List all values from all dicts in one single request"""
......
......@@ -919,6 +919,7 @@ django-tables2 = [
]
djangorestframework = [
{file = "djangorestframework-3.12.2-py3-none-any.whl", hash = "sha256:0209bafcb7b5010fdfec784034f059d512256424de2a0f084cb82b096d6dd6a7"},
{file = "djangorestframework-3.12.2.tar.gz", hash = "sha256:0898182b4737a7b584a2c73735d89816343369f259fea932d90dc78e35d8ac33"},
]
djangorestframework-gis = [
{file = "djangorestframework-gis-0.16.tar.gz", hash = "sha256:19a873740bcdac5c963779a1755d0d4acf96c4f5b63915d452f4b866d50f77d7"},
......@@ -994,20 +995,39 @@ markupsafe = [
{file = "MarkupSafe-1.1.1-cp35-cp35m-win32.whl", hash = "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1"},
{file = "MarkupSafe-1.1.1-cp35-cp35m-win_amd64.whl", hash = "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl", hash = "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d53bc011414228441014aa71dbec320c66468c1030aae3a6e29778a3382d96e5"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:3b8a6499709d29c2e2399569d96719a1b21dcd94410a586a18526b143ec8470f"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:84dee80c15f1b560d55bcfe6d47b27d070b4681c699c572af2e3c7cc90a3b8e0"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:b1dba4527182c95a0db8b6060cc98ac49b9e2f5e64320e2b56e47cb2831978c7"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-win32.whl", hash = "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66"},
{file = "MarkupSafe-1.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:bf5aa3cbcfdf57fa2ee9cd1822c862ef23037f5c832ad09cfea57fa846dec193"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:6fffc775d90dcc9aed1b89219549b329a9250d918fd0b8fa8d93d154918422e1"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:a6a744282b7718a2a62d2ed9d993cad6f5f585605ad352c11de459f4108df0a1"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:195d7d2c4fbb0ee8139a6cf67194f3973a6b3042d742ebe0a9ed36d8b6f0c07f"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-win32.whl", hash = "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2"},
{file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"},
{file = "MarkupSafe-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15"},
{file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2"},
{file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42"},
{file = "MarkupSafe-1.1.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:acf08ac40292838b3cbbb06cfe9b2cb9ec78fce8baca31ddb87aaac2e2dc3bc2"},
{file = "MarkupSafe-1.1.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:d9be0ba6c527163cbed5e0857c451fcd092ce83947944d6c14bc95441203f032"},
{file = "MarkupSafe-1.1.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:caabedc8323f1e93231b52fc32bdcde6db817623d33e100708d9a68e1f53b26b"},
{file = "MarkupSafe-1.1.1-cp38-cp38-win32.whl", hash = "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b"},
{file = "MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"},
{file = "MarkupSafe-1.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d73a845f227b0bfe8a7455ee623525ee656a9e2e749e4742706d80a6065d5e2c"},
{file = "MarkupSafe-1.1.1-cp39-cp39-manylinux1_i686.whl", hash = "sha256:98bae9582248d6cf62321dcb52aaf5d9adf0bad3b40582925ef7c7f0ed85fceb"},
{file = "MarkupSafe-1.1.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:2beec1e0de6924ea551859edb9e7679da6e4870d32cb766240ce17e0a0ba2014"},
{file = "MarkupSafe-1.1.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:7fed13866cf14bba33e7176717346713881f56d9d2bcebab207f7a036f41b850"},
{file = "MarkupSafe-1.1.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:6f1e273a344928347c1290119b493a1f0303c52f5a5eae5f16d74f48c15d4a85"},
{file = "MarkupSafe-1.1.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:feb7b34d6325451ef96bc0e36e1a6c0c1c64bc1fbec4b854f4529e51887b1621"},
{file = "MarkupSafe-1.1.1-cp39-cp39-win32.whl", hash = "sha256:22c178a091fc6630d0d045bdb5992d2dfe14e3259760e713c490da5323866c39"},
{file = "MarkupSafe-1.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:b7d644ddb4dbd407d31ffb699f1d140bc35478da613b441c582aeb7c43838dd8"},
{file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"},
]
mccabe = [
......@@ -1034,21 +1054,25 @@ pillow = [
{file = "Pillow-8.1.0-cp36-cp36m-macosx_10_10_x86_64.whl", hash = "sha256:d355502dce85ade85a2511b40b4c61a128902f246504f7de29bbeec1ae27933a"},
{file = "Pillow-8.1.0-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:93a473b53cc6e0b3ce6bf51b1b95b7b1e7e6084be3a07e40f79b42e83503fbf2"},
{file = "Pillow-8.1.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:2353834b2c49b95e1313fb34edf18fca4d57446675d05298bb694bca4b194174"},
{file = "Pillow-8.1.0-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:1d208e670abfeb41b6143537a681299ef86e92d2a3dac299d3cd6830d5c7bded"},
{file = "Pillow-8.1.0-cp36-cp36m-win32.whl", hash = "sha256:dd9eef866c70d2cbbea1ae58134eaffda0d4bfea403025f4db6859724b18ab3d"},
{file = "Pillow-8.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:b09e10ec453de97f9a23a5aa5e30b334195e8d2ddd1ce76cc32e52ba63c8b31d"},
{file = "Pillow-8.1.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:b02a0b9f332086657852b1f7cb380f6a42403a6d9c42a4c34a561aa4530d5234"},
{file = "Pillow-8.1.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:ca20739e303254287138234485579b28cb0d524401f83d5129b5ff9d606cb0a8"},
{file = "Pillow-8.1.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:604815c55fd92e735f9738f65dabf4edc3e79f88541c221d292faec1904a4b17"},
{file = "Pillow-8.1.0-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cf6e33d92b1526190a1de904df21663c46a456758c0424e4f947ae9aa6088bf7"},
{file = "Pillow-8.1.0-cp37-cp37m-win32.whl", hash = "sha256:47c0d93ee9c8b181f353dbead6530b26980fe4f5485aa18be8f1fd3c3cbc685e"},
{file = "Pillow-8.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:96d4dc103d1a0fa6d47c6c55a47de5f5dafd5ef0114fa10c85a1fd8e0216284b"},
{file = "Pillow-8.1.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:7916cbc94f1c6b1301ac04510d0881b9e9feb20ae34094d3615a8a7c3db0dcc0"},
{file = "Pillow-8.1.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:3de6b2ee4f78c6b3d89d184ade5d8fa68af0848f9b6b6da2b9ab7943ec46971a"},
{file = "Pillow-8.1.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:cdbbe7dff4a677fb555a54f9bc0450f2a21a93c5ba2b44e09e54fcb72d2bd13d"},
{file = "Pillow-8.1.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:f50e7a98b0453f39000619d845be8b06e611e56ee6e8186f7f60c3b1e2f0feae"},
{file = "Pillow-8.1.0-cp38-cp38-win32.whl", hash = "sha256:cb192176b477d49b0a327b2a5a4979552b7a58cd42037034316b8018ac3ebb59"},
{file = "Pillow-8.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:6c5275bd82711cd3dcd0af8ce0bb99113ae8911fc2952805f1d012de7d600a4c"},
{file = "Pillow-8.1.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:165c88bc9d8dba670110c689e3cc5c71dbe4bfb984ffa7cbebf1fac9554071d6"},
{file = "Pillow-8.1.0-cp39-cp39-manylinux1_i686.whl", hash = "sha256:5e2fe3bb2363b862671eba632537cd3a823847db4d98be95690b7e382f3d6378"},
{file = "Pillow-8.1.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:7612520e5e1a371d77e1d1ca3a3ee6227eef00d0a9cddb4ef7ecb0b7396eddf7"},
{file = "Pillow-8.1.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d673c4990acd016229a5c1c4ee8a9e6d8f481b27ade5fc3d95938697fa443ce0"},
{file = "Pillow-8.1.0-cp39-cp39-win32.whl", hash = "sha256:dc577f4cfdda354db3ae37a572428a90ffdbe4e51eda7849bf442fb803f09c9b"},
{file = "Pillow-8.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:22d070ca2e60c99929ef274cfced04294d2368193e935c5d6febfd8b601bf865"},
{file = "Pillow-8.1.0-pp36-pypy36_pp73-macosx_10_10_x86_64.whl", hash = "sha256:a3d3e086474ef12ef13d42e5f9b7bbf09d39cf6bd4940f982263d6954b13f6a9"},
......@@ -1145,18 +1169,26 @@ pyyaml = [
{file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"},
{file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"},
{file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"},
{file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"},
{file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"},
{file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"},
{file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"},
{file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"},
{file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"},
{file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"},
{file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"},
{file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"},
{file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"},
{file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"},
{file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"},
{file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"},
{file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"},
{file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"},
{file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"},
{file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"},
{file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"},
{file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"},
{file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"},
{file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"},
{file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"},
{file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"},
......
......@@ -2,7 +2,10 @@
import logging
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from rest_framework import generics
from rest_framework_extensions.cache.decorators import cache_response
from rest_framework_gis.filters import InBBoxFilter
from sights.mixins import LargeGeoJsonPageNumberPagination, PlaceFilteredListWithPermissions
......
......@@ -41,7 +41,7 @@ Observations de la session {{object.name}}
<validation-observer tag="form" v-slot="{ invalid, valid }" slim>
<div id="sessionSightingEditFormList" class="col-sm-4 col-md-3">
<div class="panel" role="group" aria-label="...">
<span @click="postData()" type="submit" class="btn btn-sm btn-block btn-success"
<span @click="postData()" type="submit" class="btn btn-block btn-success"
><i class="fa fa-fw fa-save"></i>
<strong>Enregistrer</strong></span>
<!-- <span @click="postData()" type="submit" class="btn btn-xs" :class="{'btn-warning':invalid,'btn-success':valid}"
......@@ -52,7 +52,7 @@ Observations de la session {{object.name}}
</div>
<div class="panel panel-default">
<div style="height: 500px" v-if="!(initialDataLoaded && dictsLoaded)">
<div style="height: 500px" v-if="!(initialDataLoaded)">
<div align="center">Chargement en cours...</div>
<div id="spinner"></div>
</div>
......@@ -85,24 +85,23 @@ Observations de la session {{object.name}}
</div>
</div>
</div>
<span @click="addNewSighting()" class="btn btn-info btn-sm btn-block"><i class="fa fa-plus"></i> <strong>Nouveau
taxon</strong></span>
<span @click="addNewSighting()" class="btn btn-primary btn-block"><i class="fa fa-plus"></i> <strong>Nouveau taxon</strong></span>
</div>
<div id="sessionSightingEditFormDetails" class="col-sm-8 col-md-9">
<div v-if="data[selectedItem]" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<span class="btn-group pull-right">
<span class="text-danger pull-right" @click="deleteSighting(selectedItem)">
<i class="fa fa-fw fa-trash"></i>
<span class="btn btn-xs btn-danger pull-right" @click="deleteSighting(selectedItem)">
<i class="fa fa-fw fa-trash"></i> Supprimer
</span>
<span class="text-info pull-right" @click="postOneData(selectedItem)"><i
class="fa fa-fw fa-save"></i></span>
{% comment %} <span class="text-info pull-right" @click="postOneData(selectedItem)"><i
class="fa fa-fw fa-save"></i></span> {% endcomment %}
</span>
{% comment %} <span v-if="data[selectedItem].id_sighting" class="text-muted">
#[[data[selectedItem].id_sighting]]
</span> {% endcomment %}
<span v-else class="label label-success">new</span>
{% comment %} <span v-if="!data[selectedItem].id_sighting" class="label label-success">new</span> {% endcomment %}
[[ data[selectedItem].codesp ?
getSpecieValue(data[selectedItem].codesp, 'common_name_fr'):
'Choisissez une espèce']]
......@@ -125,7 +124,7 @@ Observations de la session {{object.name}}
<input id="codeSp" type="number" class="form-control input-sm" placeholder="Nombre total"
class="form-control" min="0" v-model:title="data[selectedItem].total_count"
v-model="data[selectedItem].total_count" disabled>
<p class="help-block"><i class="fa fa-exclamation-triangle fa-fw"></i>Le nombre total est estimé à partir des données détaillées</p>
<p class="help-block text-warning"><i class="fa fa-exclamation-triangle fa-fw"></i>Le nombre total est estimé à partir des données détaillées</p>
</div>
<div class="checkbox">
......@@ -167,6 +166,7 @@ Observations de la session {{object.name}}
<th v-if="form_fields.includes('poids')">Poids</th>
<th v-if="form_fields.includes('count')">Dénombrement</th>
</tr>
<template v-for="(cd, icd) in data[selectedItem].countdetails">
<tr @click="displayCountDetailForm(icd)" :class="{'info' : countDetailSelectedItem == icd}" >
<td><span class="text-muted"><small>[[icd]]</small></td>
......@@ -387,7 +387,7 @@ Observations de la session {{object.name}}
<div class="panel-footer">
<div class="btn btn-sm btn-info btn-block" @click="addNewCountDetail(selectedItem)">
<div class="btn btn-primary btn-block" @click="addNewCountDetail(selectedItem)">
<i class="fa fa-plus"></i>
<strong>Nouveau dénombrement</strong>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment