From 572eb07b54981fd3371290fa2414d95fe3df7481 Mon Sep 17 00:00:00 2001 From: Miet Date: Wed, 14 Aug 2024 13:42:45 +0200 Subject: [PATCH] Extend detail page summary (#1661) * Start reshuffling detail page summary and add some info * Add more info to publication detail page heading: metadata * Change sequence, add todo's * Work on responsiveness * Add and adapt contributors, title, page count, conference name * Restructure authors, editors, creators and add summary for datasets * Refine copy for license and access level * Refine copy for license and access level * Add access level, locked, license and reshuffle buttons for dataset detail page * Align positioning, icons, colours and spacing of licenses * Start making buttons and line breaks more responsive on detail pages * Align text behaviour * Remove superfluous spaces, align indentation, remove publisher for proceedings * Add colon to separate publication type and classification * Remove publication status * Remove superfluous nil checks and simply syntax * Fix cypress test * go mod tidy --------- Co-authored-by: Koen Verheyen Co-authored-by: Nicolas Steenlant --- cypress/e2e/shared/record-timestamps.cy.ts | 64 +- go.mod | 2 +- views/dataset/show.templ | 305 ++++++---- views/dataset/show_templ.go | 451 +++++++++++--- views/dataset/summary/summary.templ | 46 +- views/dataset/summary/summary_templ.go | 237 ++++---- views/publication/files.templ | 20 +- views/publication/files_templ.go | 16 +- views/publication/preview.templ | 2 +- views/publication/preview_templ.go | 2 +- views/publication/show.templ | 341 ++++++----- views/publication/show_templ.go | 648 +++++++++++++++++---- 12 files changed, 1510 insertions(+), 624 deletions(-) diff --git a/cypress/e2e/shared/record-timestamps.cy.ts b/cypress/e2e/shared/record-timestamps.cy.ts index 0ba777b74..6d9b03a14 100644 --- a/cypress/e2e/shared/record-timestamps.cy.ts +++ b/cypress/e2e/shared/record-timestamps.cy.ts @@ -52,8 +52,16 @@ describe("Record timestamps", () => { it("should display the date created and edited in the publication detail page", () => { cy.visitPublication(); - assertTimestamp("#summary .c-subline", "Created", "Biblio Researcher1"); - assertTimestamp("#summary .c-subline", "Edited", "Biblio Researcher2"); + assertTimestamp( + "#summary .c-body-small", + "Created", + "Biblio Researcher1", + ); + assertTimestamp( + "#summary .c-body-small", + "Edited", + "Biblio Researcher2", + ); }); }); @@ -83,8 +91,8 @@ describe("Record timestamps", () => { }); cy.visitPublication(); - assertTimestamp("#summary .c-subline", "Created", "Biblio Librarian1"); - assertTimestamp("#summary .c-subline", "Edited", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Created", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Edited", "Biblio Librarian1"); // as a non-curator cy.loginAsResearcher("researcher1"); @@ -105,8 +113,16 @@ describe("Record timestamps", () => { }); cy.visitPublication(); - assertTimestamp("#summary .c-subline", "Created", "a Biblio team member"); - assertTimestamp("#summary .c-subline", "Edited", "a Biblio team member"); + assertTimestamp( + "#summary .c-body-small", + "Created", + "a Biblio team member", + ); + assertTimestamp( + "#summary .c-body-small", + "Edited", + "a Biblio team member", + ); // as a different curator cy.loginAsLibrarian("librarian2"); @@ -127,8 +143,8 @@ describe("Record timestamps", () => { }); cy.visitPublication(); - assertTimestamp("#summary .c-subline", "Created", "Biblio Librarian1"); - assertTimestamp("#summary .c-subline", "Edited", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Created", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Edited", "Biblio Librarian1"); }); }); @@ -173,8 +189,16 @@ describe("Record timestamps", () => { it("should display the date created and edited in the dataset detail page", () => { cy.visitDataset(); - assertTimestamp("#summary .c-subline", "Created", "Biblio Researcher1"); - assertTimestamp("#summary .c-subline", "Edited", "Biblio Researcher2"); + assertTimestamp( + "#summary .c-body-small", + "Created", + "Biblio Researcher1", + ); + assertTimestamp( + "#summary .c-body-small", + "Edited", + "Biblio Researcher2", + ); }); }); @@ -204,8 +228,8 @@ describe("Record timestamps", () => { }); cy.visitDataset(); - assertTimestamp("#summary .c-subline", "Created", "Biblio Librarian1"); - assertTimestamp("#summary .c-subline", "Edited", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Created", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Edited", "Biblio Librarian1"); // as a non-curator cy.loginAsResearcher("researcher1"); @@ -226,8 +250,16 @@ describe("Record timestamps", () => { }); cy.visitDataset(); - assertTimestamp("#summary .c-subline", "Created", "a Biblio team member"); - assertTimestamp("#summary .c-subline", "Edited", "a Biblio team member"); + assertTimestamp( + "#summary .c-body-small", + "Created", + "a Biblio team member", + ); + assertTimestamp( + "#summary .c-body-small", + "Edited", + "a Biblio team member", + ); // as a different curator cy.loginAsLibrarian("librarian2"); @@ -248,8 +280,8 @@ describe("Record timestamps", () => { }); cy.visitDataset(); - assertTimestamp("#summary .c-subline", "Created", "Biblio Librarian1"); - assertTimestamp("#summary .c-subline", "Edited", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Created", "Biblio Librarian1"); + assertTimestamp("#summary .c-body-small", "Edited", "Biblio Librarian1"); }); }); diff --git a/go.mod b/go.mod index a82b2c936..43c79ec2b 100644 --- a/go.mod +++ b/go.mod @@ -38,6 +38,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a google.golang.org/grpc v1.59.0 google.golang.org/protobuf v1.33.0 + jaytaylor.com/html2text v0.0.0-20230321000545-74c2419ad056 mvdan.cc/xurls/v2 v2.5.0 ) @@ -115,7 +116,6 @@ require ( golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.7.0 // indirect - jaytaylor.com/html2text v0.0.0-20230321000545-74c2419ad056 // indirect ) require ( diff --git a/views/dataset/show.templ b/views/dataset/show.templ index 5d6432293..cde50743f 100644 --- a/views/dataset/show.templ +++ b/views/dataset/show.templ @@ -16,139 +16,212 @@ templ Show(c *ctx.Ctx, dataset *models.Dataset, redirectURL string) { }) {
-
-
- -
- if c.User.CanWithdrawDataset(dataset) { -
- -
- } - if c.User.CanPublishDataset(dataset) && dataset.Status == "returned" { -
- -
- } - if c.User.CanPublishDataset(dataset) && dataset.Status != "returned" { -
- +
+
+
+
+
+ @views.BadgeStatus(dataset.Status) + if dataset.Locked { + + + Locked + + } + + if dataset.AccessLevel != "" { + + if dataset.AccessLevel == "info:eu-repo/semantics/openAccess" { + + + { c.Loc.Get("dataset_access_levels." + dataset.AccessLevel) } + + } else if dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + + + { c.Loc.Get("dataset_access_levels." + dataset.AccessLevel) } + + } else if dataset.AccessLevel == "info:eu-repo/semantics/restrictedAccess" { + + + { c.Loc.Get("dataset_access_levels." + dataset.AccessLevel) } + + } else if dataset.AccessLevel == "info:eu-repo/semantics/closedAccess" { + + + { c.Loc.Get("dataset_access_levels." + dataset.AccessLevel) } + + } + + + if dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + + + + Closed access + + + + if dataset.AccessLevelAfterEmbargo == "info:eu-repo/semantics/openAccess" { + + } else { + + } + + { c.Loc.Get("dataset_access_levels." + dataset.AccessLevelAfterEmbargo) } + from + { dataset.EmbargoDate } + + + } + } + + + if dataset.License != "" { + if dataset.License == "LicenseNotListed" { + Licensed + } else { + { dataset.License } + } + } else { + Add license + } +
- } -
- if c.User.CanCurate() && dataset.Locked { - - } else if c.User.CanCurate() { - - }
- if c.User.CanDeleteDataset(dataset) { -
- -
-
-
-
-
-
+ if c.User.CanWithdrawDataset(dataset) {
- @views.BadgeStatus(dataset.Status) +
- if dataset.Locked { -
- @views.BadgeLocked() -
- } -
-
-
-
- - { views.CreatedBy(c, dataset.DateCreated, dataset.Creator) } - - - { views.UpdatedBy(c, dataset.DateUpdated, dataset.User, dataset.LastUser) } - + } + if c.User.CanPublishDataset(dataset) && dataset.Status == "returned" { +
+ +
+ } + if c.User.CanPublishDataset(dataset) && dataset.Status != "returned" { +
+ +
+ } +
+
+ +

+ if len(dataset.Author) == 1 && dataset.Author[0] != nil { + { dataset.Author[0].LastName() }, { dataset.Author[0].FirstName() }, creator. + } + if len(dataset.Author) >= 2 { + { dataset.Author[0].LastName() }, { dataset.Author[0].FirstName() }, et al., creators. + } + if dataset.Title != "" { + "{ dataset.Title }." + } else { + "Untitled record." + } + if dataset.Publisher !="" { + { dataset.Publisher }, + } + if dataset.Year !="" { + { dataset.Year }. + } + if dataset.IdentifierType() !="" { + { dataset.IdentifierType() }. + } +

+
+
+
+
+
+ + { dataset.ID }
-

- if dataset.Title != "" { - { dataset.Title } - } else { - Untitled record - } -

+
+
+

+ { views.CreatedBy(c, dataset.DateCreated, dataset.Creator) } +

+

+ { views.UpdatedBy(c, dataset.DateUpdated, dataset.User, dataset.LastUser) } +

+
+
-
diff --git a/views/dataset/show_templ.go b/views/dataset/show_templ.go index 6d9c36ba5..55de6bc12 100644 --- a/views/dataset/show_templ.go +++ b/views/dataset/show_templ.go @@ -44,16 +44,242 @@ func Show(c *ctx.Ctx, dataset *models.Dataset, redirectURL string) templ.Compone }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if dataset.Locked { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Locked ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if dataset.AccessLevel != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if dataset.AccessLevel == "info:eu-repo/semantics/openAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + dataset.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 37, Col: 72} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + dataset.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 42, Col: 72} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if dataset.AccessLevel == "info:eu-repo/semantics/restrictedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + dataset.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 47, Col: 72} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if dataset.AccessLevel == "info:eu-repo/semantics/closedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + dataset.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 52, Col: 72} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Closed access ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if dataset.AccessLevelAfterEmbargo == "info:eu-repo/semantics/openAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + dataset.AccessLevelAfterEmbargo)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 71, Col: 84} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" from ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(dataset.EmbargoDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 73, Col: 34} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if dataset.License != "" { + if dataset.License == "LicenseNotListed" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Licensed") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(dataset.License) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 84, Col: 29} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Add license") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if c.User.CanDeleteDataset(dataset) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if c.User.CanCurate() && dataset.Locked { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if c.User.CanCurate() { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -62,12 +288,12 @@ func Show(c *ctx.Ctx, dataset *models.Dataset, redirectURL string) templ.Compone if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(views.URL(c.PathTo("dataset_confirm_withdraw", "id", dataset.ID)).QuerySet("redirect-url", redirectURL).String()) + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(views.URL(c.PathTo("dataset_confirm_withdraw", "id", dataset.ID)).QuerySet("redirect-url", redirectURL).String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 34, Col: 131} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 143, Col: 132} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -81,16 +307,16 @@ func Show(c *ctx.Ctx, dataset *models.Dataset, redirectURL string) templ.Compone if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(views.URL(c.PathTo("dataset_confirm_republish", "id", dataset.ID)).QuerySet("redirect-url", redirectURL).String()) + var templ_7745c5c3_Var14 string + templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(views.URL(c.PathTo("dataset_confirm_republish", "id", dataset.ID)).QuerySet("redirect-url", redirectURL).String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 46, Col: 132} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 155, Col: 133} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#modals\">
Republish to Biblio
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#modals\">
Republish to Biblio
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -100,157 +326,202 @@ func Show(c *ctx.Ctx, dataset *models.Dataset, redirectURL string) templ.Compone if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(views.URL(c.PathTo("dataset_confirm_publish", "id", dataset.ID)).QuerySet("redirect-url", redirectURL).String()) + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(views.URL(c.PathTo("dataset_confirm_publish", "id", dataset.ID)).QuerySet("redirect-url", redirectURL).String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 57, Col: 130} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 166, Col: 131} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#modals\">
Publish to Biblio
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#modals\">
Publish to Biblio
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if c.User.CanCurate() && dataset.Locked { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", creator. ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - } else if c.User.CanCurate() { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", et al., creators. ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if c.User.CanDeleteDataset(dataset) { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(".\" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"Untitled record.\" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = views.BadgeStatus(dataset.Status).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if dataset.Publisher != "" { + var templ_7745c5c3_Var21 string + templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(dataset.Publisher) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 189, Col: 27} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - if dataset.Locked { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if dataset.Year != "" { + var templ_7745c5c3_Var22 string + templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(dataset.Year) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 192, Col: 22} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = views.BadgeLocked().Render(ctx, templ_7745c5c3_Buffer) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(". ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + } + if dataset.IdentifierType() != "" { + var templ_7745c5c3_Var23 string + templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(dataset.IdentifierType()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 195, Col: 34} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(".") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(views.UpdatedBy(c, dataset.DateUpdated, dataset.User, dataset.LastUser)) + var templ_7745c5c3_Var25 string + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(dataset.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 135, Col: 85} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 207, Col: 44} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if dataset.Title != "" { - var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(dataset.Title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 143, Col: 24} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Untitled record") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + var templ_7745c5c3_Var26 string + templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(views.CreatedBy(c, dataset.DateCreated, dataset.Creator)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 215, Col: 68} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var27 string + templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(views.UpdatedBy(c, dataset.DateUpdated, dataset.User, dataset.LastUser)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 218, Col: 83} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -262,12 +533,12 @@ func Show(c *ctx.Ctx, dataset *models.Dataset, redirectURL string) templ.Compone if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var13 string - templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("dataset_"+c.SubNav, "id", dataset.ID).String()) + var templ_7745c5c3_Var28 string + templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("dataset_"+c.SubNav, "id", dataset.ID).String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 168, Col: 70} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/show.templ`, Line: 241, Col: 70} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/dataset/summary/summary.templ b/views/dataset/summary/summary.templ index 8772be3ce..40a54baf3 100644 --- a/views/dataset/summary/summary.templ +++ b/views/dataset/summary/summary.templ @@ -57,26 +57,8 @@ templ Summary(c *ctx.Ctx, args SummaryArgs) { if args.Dataset.Locked { @views.BadgeLocked() } - - if args.Dataset.License != "" { - { args.Dataset.License } - } else if c.User.CanEditDataset(args.Dataset) { - - - Add license - - } else { - No license - } - if args.Dataset.AccessLevel == "info:eu-repo/semantics/openAccess" { @@ -107,14 +89,14 @@ templ Summary(c *ctx.Ctx, args SummaryArgs) { } > - Add document access level + Add access level } else { No document access level } if args.Dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { - + if args.Dataset.AccessLevelAfterEmbargo == "info:eu-repo/semantics/openAccess" { } else { @@ -125,6 +107,28 @@ templ Summary(c *ctx.Ctx, args SummaryArgs) { } + + + if args.Dataset.License != "" && args.Dataset.License != "LicenseNotListed" { + { args.Dataset.License } + } else if args.Dataset.License != "" && args.Dataset.License == "LicenseNotListed" { + Licensed + } else if c.User.CanEditDataset(args.Dataset) { + + + Add license + + } else { + No license + } + +

if c.UserRole != "curator" && c.User.CanViewDataset(args.Dataset) { diff --git a/views/dataset/summary/summary_templ.go b/views/dataset/summary/summary_templ.go index 2c0f1b7e8..ab8cfa253 100644 --- a/views/dataset/summary/summary_templ.go +++ b/views/dataset/summary/summary_templ.go @@ -113,77 +113,8 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if args.Dataset.License != "" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(args.Dataset.License) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 62, Col: 75} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else if c.User.CanEditDataset(args.Dataset) { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Add license") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("No license") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 = []any{"c-subline", "me-3", "pe-3", templ.KV("border-end", args.Dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess")} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) + var templ_7745c5c3_Var4 = []any{"c-subline", "pe-3", templ.KV("border-end", args.Dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess")} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var4...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -191,12 +122,12 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var7).String()) + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var4).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -209,12 +140,12 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var9 string - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 84, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 66, Col: 75} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -227,12 +158,12 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 89, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 71, Col: 75} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -245,12 +176,12 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 94, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 76, Col: 75} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -263,12 +194,12 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("dataset_access_levels." + args.Dataset.AccessLevel)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 99, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 81, Col: 75} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -281,8 +212,8 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var13 templ.SafeURL = views.URL(args.URL).SetQueryParam("show", "description").SafeURL() - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var13))) + var templ_7745c5c3_Var10 templ.SafeURL = views.URL(args.URL).SetQueryParam("show", "description").SafeURL() + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var10))) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -295,12 +226,12 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var14 string - templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(args.Target) + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(args.Target) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 106, Col: 32} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 88, Col: 32} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -309,7 +240,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("> Add document access level") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("> Add access level") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -324,7 +255,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { return templ_7745c5c3_Err } if args.Dataset.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -343,21 +274,91 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%s from %s", c.Loc.Get("dataset_access_levels_after_embargo."+args.Dataset.AccessLevelAfterEmbargo), args.Dataset.EmbargoDate)) + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%s from %s", c.Loc.Get("dataset_access_levels_after_embargo."+args.Dataset.AccessLevelAfterEmbargo), args.Dataset.EmbargoDate)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 106, Col: 154} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if args.Dataset.License != "" && args.Dataset.License != "LicenseNotListed" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(args.Dataset.License) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 113, Col: 75} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if args.Dataset.License != "" && args.Dataset.License == "LicenseNotListed" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Licensed") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 124, Col: 154} + return templ_7745c5c3_Err + } + } else if c.User.CanEditDataset(args.Dataset) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Add license") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("No license") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -383,7 +384,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(args.Target) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 134, Col: 31} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 138, Col: 31} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -424,7 +425,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(args.Dataset.Year) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 145, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 149, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { @@ -443,7 +444,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var19 string templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(args.Dataset.Publisher) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 148, Col: 57} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 152, Col: 57} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { @@ -462,7 +463,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var20 string templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(typ) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 151, Col: 38} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 155, Col: 38} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { @@ -475,7 +476,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var21 string templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(vals[0]) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 152, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 156, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) if templ_7745c5c3_Err != nil { @@ -494,7 +495,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var22 string templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(args.Dataset.Format[0]) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 155, Col: 57} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 159, Col: 57} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) if templ_7745c5c3_Err != nil { @@ -552,7 +553,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var24 string templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(args.Target) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 178, Col: 31} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 182, Col: 31} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) if templ_7745c5c3_Err != nil { @@ -585,7 +586,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var25 string templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d related publications", len(args.Dataset.RelatedPublication))) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 191, Col: 176} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 195, Col: 176} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) if templ_7745c5c3_Err != nil { @@ -598,7 +599,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var26 string templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(args.Dataset.RelatedPublication))) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 193, Col: 91} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 197, Col: 91} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) if templ_7745c5c3_Err != nil { @@ -622,7 +623,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var27 string templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(views.CreatedBy(c, args.Dataset.DateCreated, args.Dataset.Creator)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 203, Col: 77} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 207, Col: 77} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) if templ_7745c5c3_Err != nil { @@ -635,7 +636,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var28 string templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(views.UpdatedBy(c, args.Dataset.DateUpdated, args.Dataset.User, args.Dataset.LastUser)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 206, Col: 97} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 210, Col: 97} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) if templ_7745c5c3_Err != nil { @@ -648,7 +649,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var29 string templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(args.Dataset.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 211, Col: 109} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 215, Col: 109} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) if templ_7745c5c3_Err != nil { @@ -661,7 +662,7 @@ func Summary(c *ctx.Ctx, args SummaryArgs) templ.Component { var templ_7745c5c3_Var30 string templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(args.Dataset.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 215, Col: 47} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 219, Col: 47} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) if templ_7745c5c3_Err != nil { @@ -721,7 +722,7 @@ func datasetTitle(d *models.Dataset) templ.Component { var templ_7745c5c3_Var32 string templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(d.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 235, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `dataset/summary/summary.templ`, Line: 239, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) if templ_7745c5c3_Err != nil { diff --git a/views/publication/files.templ b/views/publication/files.templ index eb88ffd21..8eb79f7d4 100644 --- a/views/publication/files.templ +++ b/views/publication/files.templ @@ -107,17 +107,17 @@ templ FilesBody(c *ctx.Ctx, p *models.Publication) {
if f.AccessLevel == "info:eu-repo/semantics/openAccess" { -
- +
+ { c.Loc.Get("publication_file_access_levels." + f.AccessLevel) }
} else if f.AccessLevel == "info:eu-repo/semantics/restrictedAccess" { -
- +
+ { c.Loc.Get("publication_file_access_levels." + f.AccessLevel) }
} else if f.AccessLevel == "info:eu-repo/semantics/closedAccess" { -
+
{ c.Loc.Get("publication_file_access_levels." + f.AccessLevel) }
@@ -128,22 +128,22 @@ templ FilesBody(c *ctx.Ctx, p *models.Publication) {
if f.AccessLevelDuringEmbargo == "info:eu-repo/semantics/closedAccess" { - + } else { } { c.Loc.Get("publication_file_access_levels_during_embargo." + f.AccessLevelDuringEmbargo) }
-
+
if f.AccessLevelAfterEmbargo == "info:eu-repo/semantics/openAccess" { - + } else { - + } { c.Loc.Get("publication_file_access_levels_after_embargo." + f.AccessLevelAfterEmbargo) } from { f.EmbargoDate }
} -
+
if f.License != "" { { c.Loc.Get("publication_licenses." + f.License) } } else { diff --git a/views/publication/files_templ.go b/views/publication/files_templ.go index e9891fd19..314d52299 100644 --- a/views/publication/files_templ.go +++ b/views/publication/files_templ.go @@ -189,7 +189,7 @@ func FilesBody(c *ctx.Ctx, p *models.Publication) templ.Component { return templ_7745c5c3_Err } if f.AccessLevel == "info:eu-repo/semantics/openAccess" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -207,7 +207,7 @@ func FilesBody(c *ctx.Ctx, p *models.Publication) templ.Component { return templ_7745c5c3_Err } } else if f.AccessLevel == "info:eu-repo/semantics/restrictedAccess" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -225,7 +225,7 @@ func FilesBody(c *ctx.Ctx, p *models.Publication) templ.Component { return templ_7745c5c3_Err } } else if f.AccessLevel == "info:eu-repo/semantics/closedAccess" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -261,7 +261,7 @@ func FilesBody(c *ctx.Ctx, p *models.Publication) templ.Component { return templ_7745c5c3_Err } if f.AccessLevelDuringEmbargo == "info:eu-repo/semantics/closedAccess" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -284,17 +284,17 @@ func FilesBody(c *ctx.Ctx, p *models.Publication) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if f.AccessLevelAfterEmbargo == "info:eu-repo/semantics/openAccess" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -330,7 +330,7 @@ func FilesBody(c *ctx.Ctx, p *models.Publication) templ.Component { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/publication/preview.templ b/views/publication/preview.templ index 6bef5dd46..903b88aef 100644 --- a/views/publication/preview.templ +++ b/views/publication/preview.templ @@ -362,7 +362,7 @@ templ Preview(c *ctx.Ctx, p *models.Publication, actions, downloadMainFileAction
    if a.Person != nil {
  • - + UGent
  • } diff --git a/views/publication/preview_templ.go b/views/publication/preview_templ.go index 52a6753ba..d21927b01 100644 --- a/views/publication/preview_templ.go +++ b/views/publication/preview_templ.go @@ -757,7 +757,7 @@ func Preview(c *ctx.Ctx, p *models.Publication, actions, downloadMainFileAction return templ_7745c5c3_Err } if a.Person != nil { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • UGent
  • ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • UGent
  • ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/publication/show.templ b/views/publication/show.templ index 1bfc47401..369e61852 100644 --- a/views/publication/show.templ +++ b/views/publication/show.templ @@ -15,157 +15,232 @@ templ Show(c *ctx.Ctx, p *models.Publication, redirectURL string) { }, }) {
    -
    -
    -
    - -
    - if c.User.CanWithdrawPublication(p) { -
    - -
    - } - if c.User.CanPublishPublication(p) && p.Status == "returned" { -
    - -
    - } - if c.User.CanPublishPublication(p) && p.Status != "returned" { -
    - +
    +
    +
    +
    +
    +
    + @views.BadgeStatus(p.Status) + if p.Locked { + + + Locked + + } + + { c.Loc.Get("publication_types." + p.Type) }: + if p.Classification != "" { + { p.Classification } + } + + if mainFile := p.MainFile(); mainFile != nil { + + if mainFile.AccessLevel == "info:eu-repo/semantics/openAccess" { + + { c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel) } + } else if mainFile.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + + { c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel) } + } else if mainFile.AccessLevel == "info:eu-repo/semantics/restrictedAccess" { + + { c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel) } + } else if mainFile.AccessLevel == "info:eu-repo/semantics/closedAccess" { + + { c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel) } + } + + if mainFile.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + + if mainFile.AccessLevelDuringEmbargo == "info:eu-repo/semantics/closedAccess" { + + } else { + + } + { c.Loc.Get("publication_file_access_levels_during_embargo." + mainFile.AccessLevelDuringEmbargo) } + + + if mainFile.AccessLevelAfterEmbargo == "info:eu-repo/semantics/openAccess" { + + } else { + + } + { c.Loc.Get("publication_file_access_levels_after_embargo." + mainFile.AccessLevelAfterEmbargo) } from { mainFile.EmbargoDate } + + } + } else if !p.Extern { + + Add document type: full text + + }
    - } -
    - if c.User.CanCurate() && p.Locked { - - } else if c.User.CanCurate() { - - }
    - if c.User.CanDeletePublication(p) { +
    + if c.User.CanDeletePublication(p) { +
    + +
    + }
    - + } else if c.User.CanCurate() { + + }
    - } -
    -
    -
    -
    -
    -
    -
    -
    -
    + if c.User.CanWithdrawPublication(p) {
    - @views.BadgeStatus(p.Status) +
    - if p.PublicationStatus != "" { -
    -

    { c.Loc.Get("publication_publishing_statuses." + p.PublicationStatus) }

    -
    - } - if p.Locked { -
    - - - Locked - -
    - } + } + if c.User.CanPublishPublication(p) && p.Status == "returned" {
    - - { c.Loc.Get("publication_types." + p.Type) } - if p.Classification != "" { - { p.Classification } - } - +
    -
    -
    -
    -
    - - { views.CreatedBy(c, p.DateCreated, p.Creator) } - - - { views.UpdatedBy(c, p.DateUpdated, p.User, p.LastUser) } - + } + if c.User.CanPublishPublication(p) && p.Status != "returned" { +
    + +
    + } +
    +
    +

    + + if (p.Type == "issue_editor") || (p.Type == "book_editor") { + if len(p.Editor) == 1 { + { p.Editor[0].LastName() }, { p.Editor[0].FirstName() }, editor. + } + if len(p.Editor) > 1 { + { p.Editor[0].LastName() }, { p.Editor[0].FirstName() }, et al., editors. + } + } else { + if len(p.Author) > 0 { + { p.Author[0].LastName() }, { p.Author[0].FirstName() } + } + if len(p.Author) > 1 { + et al. + } + } + + if p.Title != "" { + "{ p.Title }." + } else { + "Untitled record." + } + if p.Publication != "" { + { p.Publication }, + } + if p.Volume != "" { + vol. { p.Volume }, + } + if p.Issue != "" { + no. { p.Issue }, + } + if p.PageFirst != "" || p.PageLast != "" { + if p.PageFirst != "" { + pp. { p.PageFirst } + } + - + if p.PageLast != "" { + { p.PageLast }, + } + } else { + if p.PageCount != "" { + { p.PageCount } pages, + } + } + if (p.Type != "conference") && p.Publisher != "" { + { p.Publisher }, + } + if (p.Type == "conference") && p.ConferenceName != "" { + { p.ConferenceName }, + } + if p.Year != "" { + { p.Year }. + } +

    +
    +
    +
    +
    +
    + + { p.ID }
    -

    - if p.Title != "" { - { p.Title } - } else { - Untitled record - } -

    +
    +
    +

    + { views.CreatedBy(c, p.DateCreated, p.Creator) } +

    +

    + { views.UpdatedBy(c, p.DateUpdated, p.User, p.LastUser) } +

    +
    +
    -
    diff --git a/views/publication/show_templ.go b/views/publication/show_templ.go index fb5106367..1fbce63a9 100644 --- a/views/publication/show_templ.go +++ b/views/publication/show_templ.go @@ -44,72 +44,248 @@ func Show(c *ctx.Ctx, p *models.Publication, redirectURL string) templ.Component }() } ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + templ_7745c5c3_Err = views.BadgeStatus(p.Status).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if c.User.CanWithdrawPublication(p) { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if mainFile := p.MainFile(); mainFile != nil { + var templ_7745c5c3_Var5 = []any{"c-subline", "me-3", "pe-3", templ.KV("border-end", mainFile.AccessLevel == "info:eu-repo/semantics/embargoedAccess")} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - } - if c.User.CanPublishPublication(p) && p.Status == "returned" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if mainFile.AccessLevel == "info:eu-repo/semantics/openAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 41, Col: 119} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if mainFile.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 44, Col: 116} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if mainFile.AccessLevel == "info:eu-repo/semantics/restrictedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 47, Col: 116} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if mainFile.AccessLevel == "info:eu-repo/semantics/closedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_file_access_levels." + mainFile.AccessLevel)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 50, Col: 116} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if mainFile.AccessLevel == "info:eu-repo/semantics/embargoedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if mainFile.AccessLevelDuringEmbargo == "info:eu-repo/semantics/closedAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_file_access_levels_during_embargo." + mainFile.AccessLevelDuringEmbargo)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 60, Col: 147} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if mainFile.AccessLevelAfterEmbargo == "info:eu-repo/semantics/openAccess" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_file_access_levels_after_embargo." + mainFile.AccessLevelAfterEmbargo)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 68, Col: 107} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" from ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(mainFile.EmbargoDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 68, Col: 137} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } else if !p.Extern { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Add document type: full text") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - if c.User.CanPublishPublication(p) && p.Status != "returned" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if c.User.CanDeletePublication(p) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -123,16 +299,16 @@ func Show(c *ctx.Ctx, p *models.Publication, redirectURL string) templ.Component if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("publication_unlock", "id", p.ID, "redirect-url", c.CurrentURL.String()).String()) + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("publication_unlock", "id", p.ID, "redirect-url", c.CurrentURL.String()).String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 68, Col: 110} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 109, Col: 111} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"none\"> Unlock record") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"none\"> Unlock record") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -141,16 +317,16 @@ func Show(c *ctx.Ctx, p *models.Publication, redirectURL string) templ.Component if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("publication_lock", "id", p.ID, "redirect-url", c.CurrentURL.String()).String()) + var templ_7745c5c3_Var16 string + templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("publication_lock", "id", p.ID, "redirect-url", c.CurrentURL.String()).String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 77, Col: 108} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 118, Col: 109} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"none\"> Lock record") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"none\"> Lock record") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -159,137 +335,391 @@ func Show(c *ctx.Ctx, p *models.Publication, redirectURL string) templ.Component if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if c.User.CanDeletePublication(p) { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#modals\"> Withdraw
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if c.User.CanPublishPublication(p) && p.Status == "returned" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - templ_7745c5c3_Err = views.BadgeStatus(p.Status).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if c.User.CanPublishPublication(p) && p.Status != "returned" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if p.PublicationStatus != "" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if (p.Type == "issue_editor") || (p.Type == "book_editor") { + if len(p.Editor) == 1 { + var templ_7745c5c3_Var20 string + templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(p.Editor[0].LastName()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 166, Col: 33} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var21 string + templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.Editor[0].FirstName()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 166, Col: 62} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", editor.") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(p.Editor) > 1 { + var templ_7745c5c3_Var22 string + templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(p.Editor[0].LastName()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 169, Col: 33} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var23 string + templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(p.Editor[0].FirstName()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 169, Col: 62} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", et al., editors. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } else { + if len(p.Author) > 0 { + var templ_7745c5c3_Var24 string + templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(p.Author[0].LastName()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 173, Col: 33} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var25 string + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(p.Author[0].FirstName()) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 173, Col: 62} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(p.Author) > 1 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("et al. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } + if p.Title != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_publishing_statuses." + p.PublicationStatus)) + var templ_7745c5c3_Var26 string + templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(p.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 125, Col: 129} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 181, Col: 22} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(".\" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"Untitled record.\" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - if p.Locked { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    Locked
    ") + if p.Publication != "" { + var templ_7745c5c3_Var27 string + templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(p.Publication) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 186, Col: 23} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if p.Volume != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("vol. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var28 string + templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(p.Volume) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 189, Col: 23} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(c.Loc.Get("publication_types." + p.Type)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 138, Col: 53} + if p.Issue != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("no. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var29 string + templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(p.Issue) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 192, Col: 21} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if p.PageFirst != "" || p.PageLast != "" { + if p.PageFirst != "" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("pp. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var30 string + templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(p.PageFirst) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 196, Col: 26} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" - ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.PageLast != "" { + var templ_7745c5c3_Var31 string + templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(p.PageLast) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 200, Col: 21} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } else { + if p.PageCount != "" { + var templ_7745c5c3_Var32 string + templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(p.PageCount) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 204, Col: 22} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" pages, ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if (p.Type != "conference") && p.Publisher != "" { + var templ_7745c5c3_Var33 string + templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(p.Publisher) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 208, Col: 21} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - if p.Classification != "" { - var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(p.Classification) + if (p.Type == "conference") && p.ConferenceName != "" { + var templ_7745c5c3_Var34 string + templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(p.ConferenceName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 211, Col: 26} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 140, Col: 30} + return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(", ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if p.Year != "" { + var templ_7745c5c3_Var35 string + templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(p.Year) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 214, Col: 16} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(".") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var14 string - templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(views.UpdatedBy(c, p.DateUpdated, p.User, p.LastUser)) + var templ_7745c5c3_Var37 string + templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 152, Col: 67} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 226, Col: 38} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if p.Title != "" { - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.Title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 160, Col: 18} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Untitled record") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + var templ_7745c5c3_Var38 string + templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(views.CreatedBy(c, p.DateCreated, p.Creator)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 234, Col: 56} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var39 string + templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(views.UpdatedBy(c, p.DateUpdated, p.User, p.LastUser)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 237, Col: 65} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -301,12 +731,12 @@ func Show(c *ctx.Ctx, p *models.Publication, redirectURL string) templ.Component if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var16 string - templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("publication_"+c.SubNav, "id", p.ID, "redirect-url", redirectURL).String()) + var templ_7745c5c3_Var40 string + templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathTo("publication_"+c.SubNav, "id", p.ID, "redirect-url", redirectURL).String()) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 185, Col: 97} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `publication/show.templ`, Line: 260, Col: 97} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }