Commit 6dc932bf authored by hypsug0's avatar hypsug0
Browse files

fix: remove delete action buttons from search pages

parent 5c8681e2
......@@ -160,12 +160,12 @@ const placeActionButtonGroup = (id, model, id_session = null) => {
'fa-calendar-alt',
`/${model}/${id}/session/add`
),
actionButtons(
'Supprimer',
'danger',
'fa-trash',
`/${model}/${id}/delete`
)
// actionButtons(
// 'Supprimer',
// 'danger',
// 'fa-trash',
// `/${model}/${id}/delete`
// )
)
return btnGroup.outerHTML
}
......@@ -213,6 +213,8 @@ const placeSearchBlock = () => {
comment,
is_managed,
convention,
creator,
timestamp_create,
} = d.properties
const div = document.createElement('ul')
const dataToDisplay = [
......@@ -221,6 +223,25 @@ const placeSearchBlock = () => {
moreInfoElement('Commentaire', comment),
moreInfoElement('Site géré', is_managed ? 'Oui' : 'Non'),
moreInfoElement('Convention refuge', convention ? 'Oui' : 'Non'),
moreInfoElement(
'Création',
creator != null
? `le ${new Date(
timestamp_create
).toLocaleDateString()} par ${creator.get_full_name}`
: new Date(timestamp_create).toLocaleDateString()
),
// data: (row) => {
// const creationDate = new Date(
// row.properties.timestamp_create
// ).toLocaleDateString()
// const creationContent =
// row.properties.creator != null
// ? `${creationDate} par ${row.properties.creator.get_full_name}`
// : creationDate
// return creationContent
// },
// },
]
div.append(...dataToDisplay.filter((p) => p !== null))
return div
......@@ -272,25 +293,6 @@ const placeSearchBlock = () => {
: null
},
},
// {
// data: (row) => {
// return row.properties.total_sessions
// ? row.properties.total_sessions
// : 'Aucune'
// },
// },
{
data: (row) => {
const creationDate = new Date(
row.properties.timestamp_create
).toLocaleDateString()
const creationContent =
row.properties.creator != null
? `${creationDate} par ${row.properties.creator.get_full_name}`
: creationDate
return creationContent
},
},
],
})
......@@ -489,26 +491,24 @@ const placeSearchBlock = () => {
const locationLayer = L.geoJson(data, {
onEachFeature: function onEachFeature(feature, layer) {
const props = feature.properties
const content =
'<h3>Site&nbsp;:&nbsp;' +
props.name +
'</h3><p><ul><li><b>Type</b>: ' +
(props.type_data
? props.type_data.descr
: 'Non défini') +
'</li><li><b>Nombre de sessions</b> ' +
(props.total_sessions
? props.total_sessions
: 'Aucune') +
'&nbsp;(Dernière: ' +
(props.last_session
? props.last_session.date_start__max
: 'Aucune') +
')</li></ul> </p><div class="text-right"><div class="btn-group" role="group"><a type="button" class="btn btn-default btn-sm" align="center" style="color:white;" href="/place/' +
feature.id +
'/detail" target="_blank"><i class="fa fa-fw fa-info-circle"></i></a><a type="button" class="btn btn-info btn-sm" align="center" style="color:white;" href="/place/' +
feature.id +
'/update" target="_blank"><i class="fa fa-fw fa-edit"></i></a></div></div>'
const content = `
<p>
<h4>${props.name}</h4>
<span class="label label-${props.type_data ? 'success':'default'}">${
props.type_data
? props.type_data.code
: 'nd'
}</span> ${props.type_data
? props.type_data.descr
: 'Type non défini'}
</p>
<p>
<span class="pull-right">
${placeActionButtonGroup(feature.id, 'place')}
</span>
</p>
`
layer.bindPopup(content)
if (feature.id) {
markersById[feature.id] = layer
......@@ -1834,10 +1834,16 @@ Vue.component('session-group-item', {
<dd>
<ul class="list-unstyled">
<li v-for='(o, io) in se.observations' :class="{'text-muted':!o.codesp.sp_true}">
<i v-show="o.breed_colo" class="fas fa-baby fa-fw text-success"></i>
<small><span v-show="o.breed_colo" class="fa-stack">
<i class="fas fa-circle fa-stack-2x text-success"></i>
<i class="fas fa-baby fa-stack-1x fa-inverse"></i>
</span></small>
<!--<i v-show="o.breed_colo" class="fas fa-baby fa-fw text-success"></i>-->
<strong>{{o.codesp.common_name_fr}}</strong>
(<i>{{o.codesp.sci_name}}</i>)
: {{o.total_count ? o.total_count: '-'}}
</li>
</ul>
</dd>
......@@ -2093,8 +2099,7 @@ const studyListApp = (userId) => {
if (this.search.myStudies) {
filteredStudies = filteredStudies.filter(
(e) =>
e.project_manager &&
e.project_manager?.id == userId
e.project_manager && e.project_manager?.id == userId
)
}
if (this.search.manager) {
......
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