From 79aff422282e52ae50187a15c25a15587d787cc8 Mon Sep 17 00:00:00 2001
From: soukainna
Date: Wed, 1 Feb 2023 09:55:18 +0100
Subject: [PATCH 1/6] add template to update and delete event
---
config.yaml | 8 +
web/layouts/agenda/_partials/address.html | 67 +++++
.../agenda/_partials/subscribers-table.html | 17 +-
web/layouts/agenda/delete-event.html | 32 +++
web/layouts/agenda/display-event.html | 19 ++
web/layouts/agenda/home.html | 2 +
web/layouts/agenda/updateEvent.html | 231 ++++++++++++++++++
7 files changed, 372 insertions(+), 4 deletions(-)
create mode 100644 web/layouts/agenda/_partials/address.html
create mode 100644 web/layouts/agenda/delete-event.html
create mode 100644 web/layouts/agenda/updateEvent.html
diff --git a/config.yaml b/config.yaml
index 9344cc3..06de35b 100644
--- a/config.yaml
+++ b/config.yaml
@@ -92,6 +92,14 @@ views:
files:
- web/layouts/_partials/address_autocomplete.html
- web/layouts/agenda/create-event.html
+ update:
+ files:
+ - web/layouts/agenda/_partials/address.html
+ - web/layouts/_partials/address_autocomplete.html
+ - web/layouts/agenda/updateEvent.html
+ delete:
+ files:
+ - web/layouts/agenda/delete-event.html
directory:
home:
files:
diff --git a/web/layouts/agenda/_partials/address.html b/web/layouts/agenda/_partials/address.html
new file mode 100644
index 0000000..06fc040
--- /dev/null
+++ b/web/layouts/agenda/_partials/address.html
@@ -0,0 +1,67 @@
+{{ define "address" }}
+
+
+
+
+
+
+
+
+
+{{ end }}
\ No newline at end of file
diff --git a/web/layouts/agenda/_partials/subscribers-table.html b/web/layouts/agenda/_partials/subscribers-table.html
index 9eb12ed..bda5b2b 100644
--- a/web/layouts/agenda/_partials/subscribers-table.html
+++ b/web/layouts/agenda/_partials/subscribers-table.html
@@ -17,8 +17,10 @@
+ {{$groupId := .ViewState.event.ID}}
{{range .ViewState.event.Subscriptions}}
+
@@ -32,10 +34,17 @@
|
{{(timeFormat .CreatedAt "02/01/2006")}}
|
-
-
- |
+
{{end}}
diff --git a/web/layouts/agenda/delete-event.html b/web/layouts/agenda/delete-event.html
new file mode 100644
index 0000000..af7d15f
--- /dev/null
+++ b/web/layouts/agenda/delete-event.html
@@ -0,0 +1,32 @@
+{{define "content"}}
+
+{{end}}
diff --git a/web/layouts/agenda/display-event.html b/web/layouts/agenda/display-event.html
index 787d596..2a632f9 100644
--- a/web/layouts/agenda/display-event.html
+++ b/web/layouts/agenda/display-event.html
@@ -12,7 +12,26 @@
{{end}}
+ {{$gr := .Group.ID}}
+ {{$event := .ViewState.event.ID}}
+ {{range .ViewState.event.Owners}}
+ {{$id := .}}
+
+
+ {{end}}
+ {{end}}
+
diff --git a/web/layouts/agenda/home.html b/web/layouts/agenda/home.html
index 9a5882a..06769e1 100644
--- a/web/layouts/agenda/home.html
+++ b/web/layouts/agenda/home.html
@@ -50,6 +50,7 @@
{{range .ViewState.events}}
+ {{if eq .Deleted false}}
@@ -99,6 +100,7 @@
|
{{end}}
+ {{end}}
diff --git a/web/layouts/agenda/updateEvent.html b/web/layouts/agenda/updateEvent.html
new file mode 100644
index 0000000..4533761
--- /dev/null
+++ b/web/layouts/agenda/updateEvent.html
@@ -0,0 +1,231 @@
+{{ define "content" }}
+
+
+
Modifier votre agenda
+
+{{$sdate := (timeFrom .ViewState.event.Startdate).Format ("2006-01-02")}}
+{{$edate := (timeFrom .ViewState.event.Enddate).Format ("2006-01-02")}}
+
+
+{{end}}
\ No newline at end of file
From 759e8f810ac5d3309c364d80bdabd162788c63ef Mon Sep 17 00:00:00 2001
From: soukainna
Date: Fri, 3 Feb 2023 16:12:47 +0100
Subject: [PATCH 2/6] add condition to display modify button
---
web/layouts/agenda/display-event.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/layouts/agenda/display-event.html b/web/layouts/agenda/display-event.html
index 2a632f9..61e0ed7 100644
--- a/web/layouts/agenda/display-event.html
+++ b/web/layouts/agenda/display-event.html
@@ -17,10 +17,10 @@
{{range .ViewState.event.Owners}}
{{$id := .}}
-
+ {{if eq $gr $id}}
- {{if eq $gr $id}}
+
From b004cf847a7d46e6188f8f0ec4f346a65689a610 Mon Sep 17 00:00:00 2001
From: soukainna
Date: Mon, 13 Feb 2023 10:29:50 +0100
Subject: [PATCH 3/6] make the subscriber_by clickable
---
web/layouts/agenda/_partials/subscribers-table.html | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/web/layouts/agenda/_partials/subscribers-table.html b/web/layouts/agenda/_partials/subscribers-table.html
index bda5b2b..9c182f5 100644
--- a/web/layouts/agenda/_partials/subscribers-table.html
+++ b/web/layouts/agenda/_partials/subscribers-table.html
@@ -28,23 +28,12 @@
- {{.Data.subscribed_by.user.display_name}}
+ {{.Data.subscribed_by.user.display_name}}
{{.Data.subscribed_by.group.name}}
|
{{(timeFormat .CreatedAt "02/01/2006")}}
|
-
{{end}}
From 39d4713ebfeaa586a33ba85df36589581102115f Mon Sep 17 00:00:00 2001
From: soukainna
Date: Wed, 15 Feb 2023 11:32:27 +0100
Subject: [PATCH 4/6] add the member page and not the beneficaire page
---
web/layouts/agenda/_partials/subscribers-table.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/web/layouts/agenda/_partials/subscribers-table.html b/web/layouts/agenda/_partials/subscribers-table.html
index 9c182f5..35e81d5 100644
--- a/web/layouts/agenda/_partials/subscribers-table.html
+++ b/web/layouts/agenda/_partials/subscribers-table.html
@@ -28,6 +28,7 @@
+
{{.Data.subscribed_by.user.display_name}}
{{.Data.subscribed_by.group.name}}
|
From b7eb73a4bdea23322cdabb62965dba92a24f5d4f Mon Sep 17 00:00:00 2001
From: soukainna
Date: Fri, 17 Feb 2023 10:53:57 +0100
Subject: [PATCH 5/6] fix some err
---
web/layouts/agenda/delete-event.html | 26 ++++++++++++++++++++++++++
web/layouts/agenda/updateEvent.html | 24 ++++++++++++++++++++++++
web/layouts/members/update.html | 23 +++++++++++++++++++++++
3 files changed, 73 insertions(+)
diff --git a/web/layouts/agenda/delete-event.html b/web/layouts/agenda/delete-event.html
index af7d15f..a4148d1 100644
--- a/web/layouts/agenda/delete-event.html
+++ b/web/layouts/agenda/delete-event.html
@@ -1,4 +1,6 @@
{{define "content"}}
+{{ if eq (index .ViewState.event.Owners 0) .Group.ID }}
+
+ {{else}}
+
+
+
+
+
+
+
+
+ {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
+
+
+
Vous avez pas le droit de supprimer cet événement
+
+
+
+
+
+
+ {{end}}
{{end}}
diff --git a/web/layouts/agenda/updateEvent.html b/web/layouts/agenda/updateEvent.html
index 4533761..a8e2c7b 100644
--- a/web/layouts/agenda/updateEvent.html
+++ b/web/layouts/agenda/updateEvent.html
@@ -1,4 +1,5 @@
{{ define "content" }}
+{{ if eq (index .ViewState.event.Owners 0) .Group.ID }}
Modifier votre agenda
@@ -227,5 +228,28 @@
+{{else}}
+
+
+
+
+
+
+
+ {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
+
+
+
Vous avez pas le droit de modifier cet événement
+
+
+
+
+
+
+{{end}}
{{end}}
\ No newline at end of file
diff --git a/web/layouts/members/update.html b/web/layouts/members/update.html
index b7b28b0..bfe9db0 100644
--- a/web/layouts/members/update.html
+++ b/web/layouts/members/update.html
@@ -1,4 +1,5 @@
{{define "content"}}
+{{if eq .UserID .ViewState.ID}}
Modifier vos informations
@@ -128,4 +129,26 @@
+{{else}}
+
+
+
+
+
+
+
+
+ {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
+
+
+
Vous avez pas le droit de modifier ce profile
+
+
+
+
+
+
+{{end}}
{{end}}
\ No newline at end of file
From 1a67ee50bb070d3a8eabf916d7dc9ec19f459ec6 Mon Sep 17 00:00:00 2001
From: soukainna
Date: Fri, 17 Feb 2023 17:24:45 +0100
Subject: [PATCH 6/6] modify text
---
web/layouts/agenda/delete-event.html | 2 +-
web/layouts/agenda/updateEvent.html | 2 +-
web/layouts/members/update.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/layouts/agenda/delete-event.html b/web/layouts/agenda/delete-event.html
index a4148d1..57952bf 100644
--- a/web/layouts/agenda/delete-event.html
+++ b/web/layouts/agenda/delete-event.html
@@ -43,7 +43,7 @@
{{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
-
Vous avez pas le droit de supprimer cet événement
+ Vous n'avez pas le droit de supprimer cet événement
diff --git a/web/layouts/agenda/updateEvent.html b/web/layouts/agenda/updateEvent.html
index a8e2c7b..976a58e 100644
--- a/web/layouts/agenda/updateEvent.html
+++ b/web/layouts/agenda/updateEvent.html
@@ -240,7 +240,7 @@
{{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
-
Vous avez pas le droit de modifier cet événement
+ Vous n'avez pas le droit de modifier cet événement
diff --git a/web/layouts/members/update.html b/web/layouts/members/update.html
index bfe9db0..2349fe5 100644
--- a/web/layouts/members/update.html
+++ b/web/layouts/members/update.html
@@ -141,7 +141,7 @@
{{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
-
Vous avez pas le droit de modifier ce profile
+ Vous n'avez pas le droit de modifier ce profil