Changes for page ngi-0-logo


From version 3.1
edited by OW2
on 2024/09/18 14:20
Change comment: There is no comment for this version
To version 2.3
edited by OW2
on 2024/09/18 14:06
Change comment: Added class property

Summary

Details

Page properties
Content
... ... @@ -5,28 +5,6 @@
5 5  // Récupérer l'image en pièce jointe
6 6  def img = doc.getAttachment(attachmentName)
7 7  
8 -// Accéder à l'objet et à la propriété 'count'
9 -def obj = doc.getObject(doc.toString())
10 -def countProperty = obj.getProperty('count')
11 -def countValue = countProperty.value
12 -
13 -// Initialiser un compteur pour la date du jour
14 -def currentDate = new Date().format('yyyy-MM-dd')
15 -def jsonSlurper = new groovy.json.JsonSlurper()
16 -def json = countValue ? jsonSlurper.parseText(countValue) : [:]
17 -
18 -// Incrémenter le compteur pour la date actuelle
19 -if (json.containsKey(currentDate)) {
20 - json[currentDate] += 1
21 -} else {
22 - json[currentDate] = 1
23 -}
24 -
25 -// Mettre à jour la propriété 'count' avec le nouveau JSON
26 -def jsonOutput = new groovy.json.JsonBuilder(json).toPrettyString()
27 -obj.set('count',jsonOutput)
28 -doc.save()
29 -
30 30  if (img != null) {
31 31   def outs = response.outputStream
32 32   response.setContentType("image/png")
... ... @@ -40,6 +40,5 @@
40 40  } else {
41 41   response.sendError(404, "L'image n'existe pas.")
42 42  }
43 -
44 44  {{/groovy}}
45 45  
commonsfund.ngi-0-logo[0]
count
... ... @@ -1,3 +1,0 @@
1 -{
2 - "2024-09-18": 1
3 -}
count
Editor
... ... @@ -1,1 +1,0 @@
1 ----
Restricted
... ... @@ -1,1 +1,0 @@
1 -0
Use Suggest
... ... @@ -1,1 +1,0 @@
1 -1