diff --git a/build.sbt b/build.sbt index 2261543564..19b3005bad 100644 --- a/build.sbt +++ b/build.sbt @@ -151,7 +151,6 @@ val commonSettings = Seq( // tests. Additionally, set the path to the test config // file as an env var. Test / javaOptions ++= Seq( - "-XX:+CMSClassUnloadingEnabled", s"-Dconfig.file=${(LocalRootProject / baseDirectory).value / "conf" / "test.conf"}", s"-Dlogger.file=${(LocalRootProject / baseDirectory).value / "conf" / "logback-play-dev.xml"}" ), @@ -163,6 +162,7 @@ val commonSettings = Seq( "-unchecked", "-deprecation", "-Wconf:cat=unused-imports&site=.*views.html.*:s", // Silence import warnings in Play html files + "-Wconf:cat=unused-imports&site=.*views.txt.*:s", // Silence import warnings in Play txt files ), resolvers ++= additionalResolvers, @@ -346,7 +346,7 @@ lazy val xslt = Project(appName + "-xslt", file("modules/xslt")) "org.slf4j" % "slf4j-api" % "2.0.13", // We need JSON here... - "com.typesafe.play" %% "play-json" % "2.10.0", + "com.typesafe.play" %% "play-json" % "2.10.6", // Saxon for XSLT transformation "net.sf.saxon" % "Saxon-HE" % "10.2", diff --git a/modules/admin/app/controllers/admin/AdminAssets.scala b/modules/admin/app/controllers/admin/AdminAssets.scala index a67cb1b876..7a8245cbd3 100644 --- a/modules/admin/app/controllers/admin/AdminAssets.scala +++ b/modules/admin/app/controllers/admin/AdminAssets.scala @@ -1,11 +1,12 @@ package controllers.admin import play.api.http.HttpErrorHandler -import javax.inject.{Inject, Singleton} +import javax.inject.{Inject, Singleton} import controllers.AssetsMetadata +import play.api.Environment @Singleton -case class AdminAssets @Inject()(errorHandler: HttpErrorHandler, meta: AssetsMetadata) extends controllers.AssetsBuilder(errorHandler, meta) +case class AdminAssets @Inject()(errorHandler: HttpErrorHandler, meta: AssetsMetadata, env: Environment) extends controllers.AssetsBuilder(errorHandler, meta, env) diff --git a/modules/admin/app/models/IngestParams.scala b/modules/admin/app/models/IngestParams.scala index c738a5c41b..92bde2260a 100644 --- a/modules/admin/app/models/IngestParams.scala +++ b/modules/admin/app/models/IngestParams.scala @@ -38,7 +38,7 @@ object PayloadHandle { implicit val _writes: Writes[PayloadHandle] = Writes { case FilePayload(f) => Json.toJson(f.map(_.toAbsolutePath.toString)) - case UrlMapPayload(urls) => Json.toJson(urls.mapValues(_.toString)) + case UrlMapPayload(urls) => Json.toJson(urls.view.mapValues(_.toString).toMap) } } diff --git a/modules/admin/app/services/datasets/SqlImportDatasetService.scala b/modules/admin/app/services/datasets/SqlImportDatasetService.scala index 6ba2cf61c8..6e57486100 100644 --- a/modules/admin/app/services/datasets/SqlImportDatasetService.scala +++ b/modules/admin/app/services/datasets/SqlImportDatasetService.scala @@ -97,16 +97,16 @@ case class SqlImportDatasetService @Inject()(db: Database, actorSystem: ActorSys db.withTransaction { implicit conn => val inserts = info.map { item => Seq[NamedParameter]( - Symbol("repo_id") -> repoId, - Symbol("id") -> item.id, - Symbol("name") -> item.name, - Symbol("type") -> item.src, - Symbol("content_type") -> item.contentType, - Symbol("item_id") -> item.fonds.filter(_.trim.nonEmpty), - Symbol("nest") -> item.nest, - Symbol("sync") -> item.sync, - Symbol("status") -> item.status, - Symbol("comments") -> item.notes + "repo_id" -> repoId, + "id" -> item.id, + "name" -> item.name, + "type" -> item.src, + "content_type" -> item.contentType, + "item_id" -> item.fonds.filter(_.trim.nonEmpty), + "nest" -> item.nest, + "sync" -> item.sync, + "status" -> item.status, + "comments" -> item.notes ) } val q = """INSERT INTO import_dataset (repo_id, id, name, type, content_type, item_id, sync, status, comments) diff --git a/modules/admin/app/services/harvesting/WSOaiPmhClient.scala b/modules/admin/app/services/harvesting/WSOaiPmhClient.scala index f29e46761c..07d187c7af 100644 --- a/modules/admin/app/services/harvesting/WSOaiPmhClient.scala +++ b/modules/admin/app/services/harvesting/WSOaiPmhClient.scala @@ -178,7 +178,7 @@ case class WSOaiPmhClient @Inject()(ws: WSClient, cache: AsyncCacheApi)(implicit .map { r => checkError(r) val xml = r.xml - val idents = (xml \ verb \ "header").seq.map { node => + val idents = (xml \ verb \ "header").map { node => val del = (node \@ "status") == "deleted" val name = (node \ "identifier").text name -> del diff --git a/modules/admin/app/services/ingest/WSIngestService.scala b/modules/admin/app/services/ingest/WSIngestService.scala index ce742fa3d4..83030472e9 100644 --- a/modules/admin/app/services/ingest/WSIngestService.scala +++ b/modules/admin/app/services/ingest/WSIngestService.scala @@ -137,7 +137,7 @@ case class WSIngestService @Inject()( // host and we really shouldn't do this! val propFile: Option[Path] = data.params.properties match { case FileProperties(f) => f.map { propTmp => - import scala.collection.JavaConverters._ + import scala.jdk.CollectionConverters._ val readTmp = Files.createTempFile(s"ingest", ".properties") propTmp.moveTo(readTmp, replace = true) val perms = Set( diff --git a/modules/admin/app/views/admin/authoritativeSet/create.scala.html b/modules/admin/app/views/admin/authoritativeSet/create.scala.html index 99d689cc1f..6fca02b256 100644 --- a/modules/admin/app/views/admin/authoritativeSet/create.scala.html +++ b/modules/admin/app/views/admin/authoritativeSet/create.scala.html @@ -1,12 +1,11 @@ @(f: Form[AuthoritativeSetF], vf: Form[Seq[String]], fieldHints: forms.FormFieldHints, usersAndGroups: UsersAndGroups, action: Call)(implicit userOpt: Option[UserProfile], req: RequestHeader, conf: AppConfig, messages: Messages, md: MarkdownRenderer, prefs: SessionPrefs, flash: Flash) -@** @implicitField = @{ views.html.helper.FieldConstructor(formHelpers.fieldTemplate.f) }*@ @implicitField = @{views.admin.Helpers.fieldConstructorWithHints(Some(fieldHints))} @views.html.admin.layout.rightSidebarWithType(Messages("authoritativeSet.create"), EntityType.AuthoritativeSet, scripts = formHelpers.formJs(f)) { @helper.form(action = action) { @formHelpers.csrfToken() - @formHelpers.lineInput(f(""), Entity.IDENTIFIER, 'autocomplete -> "off") + @formHelpers.lineInput(f(""), Entity.IDENTIFIER, attrs._autocomplete -> "off") @views.html.admin.authoritativeSet.form(None, f, fieldHints) @views.html.admin.permissions.visibilityForm(vf, usersAndGroups) diff --git a/modules/admin/app/views/admin/authoritativeSet/listItem.scala.html b/modules/admin/app/views/admin/authoritativeSet/listItem.scala.html index 9e87ee7c74..1d1baaca52 100644 --- a/modules/admin/app/views/admin/authoritativeSet/listItem.scala.html +++ b/modules/admin/app/views/admin/authoritativeSet/listItem.scala.html @@ -14,7 +14,7 @@ } @views.html.common.childCount(item) { count => - @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq('class -> "child-items-inline-load collapsed")) { + @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq(attrs._class -> "child-items-inline-load collapsed")) { @Messages("authoritativeSet.childCount", count) } diff --git a/modules/admin/app/views/admin/common/pathRemapForm.scala.html b/modules/admin/app/views/admin/common/pathRemapForm.scala.html index 49ea27eb4a..4ed9413638 100644 --- a/modules/admin/app/views/admin/common/pathRemapForm.scala.html +++ b/modules/admin/app/views/admin/common/pathRemapForm.scala.html @@ -3,7 +3,7 @@ @formHelpers.csrfToken() @views.html.formHelpers.globalErrors(form) -@helper.inputText(form("path-prefix"), 'class -> "form-control", '_label -> Messages("admin.utils.renameItems.pathPrefix")) +@helper.inputText(form("path-prefix"), attrs._class -> "form-control", attrs._label -> Messages("admin.utils.renameItems.pathPrefix")) @html diff --git a/modules/admin/app/views/admin/concept/broader.scala.html b/modules/admin/app/views/admin/concept/broader.scala.html index 3e36142f5c..0a20d5f1bf 100644 --- a/modules/admin/app/views/admin/concept/broader.scala.html +++ b/modules/admin/app/views/admin/concept/broader.scala.html @@ -41,7 +41,7 @@ @helper.form(action = action) { @formHelpers.csrfToken() @defining("cvocConcept") { implicit fieldPrefix => - @formHelpers.choiceInput(f(""), "broaderTerms", item.broaderTerms.map(t => t.id -> t.toStringLang).toList, 'multiple -> true, '_select2 -> false) + @formHelpers.choiceInput(f(""), "broaderTerms", item.broaderTerms.map(t => t.id -> t.toStringLang).toList, attrs._multiple -> true, attrs._select2 -> false) } @formHelpers.submitButtonWithLogMessageInput(Messages("cvocConcept.update.submit"), cancel = views.admin.Helpers.linkToOpt(item)) diff --git a/modules/admin/app/views/admin/concept/descriptionForm.scala.html b/modules/admin/app/views/admin/concept/descriptionForm.scala.html index 58c54955f0..60578f90be 100644 --- a/modules/admin/app/views/admin/concept/descriptionForm.scala.html +++ b/modules/admin/app/views/admin/concept/descriptionForm.scala.html @@ -10,8 +10,8 @@ @views.html.admin.common.descriptionForm(desc, cls = "concept-description-form inline-element") { ×
- @choiceInput(desc, LANG_CODE, views.Helpers.languagePairList, '_blank -> true) - @choiceInput(desc, IDENTIFIER, views.Helpers.scriptPairList, '_blank -> true) + @choiceInput(desc, LANG_CODE, views.Helpers.languagePairList, attrs._blank -> true) + @choiceInput(desc, IDENTIFIER, views.Helpers.scriptPairList, attrs._blank -> true) @formHelpers.lineInput(desc, PREFLABEL) @formHelpers.inlineNameSet(desc, ALTLABEL) @formHelpers.inlineNameSet(desc, HIDDENLABEL) diff --git a/modules/admin/app/views/admin/concept/form.scala.html b/modules/admin/app/views/admin/concept/form.scala.html index 4e9a73a383..e8229e091a 100644 --- a/modules/admin/app/views/admin/concept/form.scala.html +++ b/modules/admin/app/views/admin/concept/form.scala.html @@ -5,7 +5,7 @@ @implicitField = @{ views.html.helper.FieldConstructor(formHelpers.fieldTemplate.f) } -@lineInput(f(""), Entity.IDENTIFIER, 'autocomplete -> "off") +@lineInput(f(""), Entity.IDENTIFIER, attrs._autocomplete -> "off") @defining("cvocConcept") { implicit prefix => @defining(Some(fieldHints)) { implicit implicitFieldHints => diff --git a/modules/admin/app/views/admin/country/create.scala.html b/modules/admin/app/views/admin/country/create.scala.html index b2de01190b..0e9938907b 100644 --- a/modules/admin/app/views/admin/country/create.scala.html +++ b/modules/admin/app/views/admin/country/create.scala.html @@ -5,7 +5,7 @@ @views.html.admin.layout.rightSidebarWithType(Messages("country.create"), EntityType.Country, scripts = formHelpers.formJs(f)) { @helper.form(action = action) { @formHelpers.csrfToken() - @formHelpers.lineInput(f(""), Entity.IDENTIFIER, 'autocomplete -> "off") + @formHelpers.lineInput(f(""), Entity.IDENTIFIER, attrs._autocomplete -> "off") @views.html.admin.country.form(None, f, fieldHints) @views.html.admin.permissions.visibilityForm(vf, usersAndGroups) diff --git a/modules/admin/app/views/admin/country/list.scala.html b/modules/admin/app/views/admin/country/list.scala.html index a5bc3f95a9..4898435e8f 100644 --- a/modules/admin/app/views/admin/country/list.scala.html +++ b/modules/admin/app/views/admin/country/list.scala.html @@ -19,7 +19,7 @@
} { @views.html.admin.common.sidebarActions { user => @views.html.admin.common.sidebarAction(user.hasPermission(ContentTypes.Country, PermissionType.Create)) { - + @Messages("country.create") diff --git a/modules/admin/app/views/admin/country/search.scala.html b/modules/admin/app/views/admin/country/search.scala.html index 5e65e7cf02..5a021b6ab6 100644 --- a/modules/admin/app/views/admin/country/search.scala.html +++ b/modules/admin/app/views/admin/country/search.scala.html @@ -7,7 +7,7 @@ } @views.html.admin.common.sidebarActions { user => @views.html.admin.common.sidebarAction(user.hasPermission(ContentTypes.Country, PermissionType.Create)) { - @Messages("country.create") + @Messages("country.create") } } @common.search.facetList(result.facetClasses, action) diff --git a/modules/admin/app/views/admin/country/searchItem.scala.html b/modules/admin/app/views/admin/country/searchItem.scala.html index ed96d45c4e..a17d8f1615 100644 --- a/modules/admin/app/views/admin/country/searchItem.scala.html +++ b/modules/admin/app/views/admin/country/searchItem.scala.html @@ -9,7 +9,7 @@
} @views.html.common.childCount(item) { count => - @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq('class -> "child-items-inline-load collapsed")) { + @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq(attrs._class -> "child-items-inline-load collapsed")) { @Messages("country.childCount", count) } diff --git a/modules/admin/app/views/admin/deleteChildren.scala.html b/modules/admin/app/views/admin/deleteChildren.scala.html index 32525f94da..f2d4e57d82 100644 --- a/modules/admin/app/views/admin/deleteChildren.scala.html +++ b/modules/admin/app/views/admin/deleteChildren.scala.html @@ -24,7 +24,7 @@

@Messages("item.deleteChildren.confirmPhrase", Html(Messages("item.deleteChildren.confirm", children.total)))

- @formHelpers.lineInput(f(""), ANSWER, 'autocomplete -> "off") + @formHelpers.lineInput(f(""), ANSWER, attrs._autocomplete -> "off") @formHelpers.submitButtonWithLogMessageInput( diff --git a/modules/admin/app/views/admin/documentaryUnit/create.scala.html b/modules/admin/app/views/admin/documentaryUnit/create.scala.html index d49031c14a..7b7aa007ac 100644 --- a/modules/admin/app/views/admin/documentaryUnit/create.scala.html +++ b/modules/admin/app/views/admin/documentaryUnit/create.scala.html @@ -23,7 +23,7 @@ @helper.form(action = action) { @formHelpers.csrfToken() @defining(Some(fieldHints)) { implicit implicitFieldHints => - @formHelpers.lineInput(f(""), Entity.IDENTIFIER, 'autocomplete -> "off") + @formHelpers.lineInput(f(""), Entity.IDENTIFIER, attrs._autocomplete -> "off") } @views.html.admin.documentaryUnit.form(f, fieldHints) diff --git a/modules/admin/app/views/admin/documentaryUnit/descriptionForm.scala.html b/modules/admin/app/views/admin/documentaryUnit/descriptionForm.scala.html index 71d2511f1b..2ebfa6bf5b 100644 --- a/modules/admin/app/views/admin/documentaryUnit/descriptionForm.scala.html +++ b/modules/admin/app/views/admin/documentaryUnit/descriptionForm.scala.html @@ -9,9 +9,9 @@ @implicitField = @{ views.html.helper.FieldConstructor(formHelpers.fieldTemplate.f) } @views.html.admin.common.descriptionForm(desc) { - @choiceInput(desc, LANG_CODE, views.Helpers.languagePairList, '_blank -> true) + @choiceInput(desc, LANG_CODE, views.Helpers.languagePairList, attrs._blank -> true) @defining("description") { implicit fieldPrefix => - @lineInput(desc, IDENTIFIER, 'autocomplete -> "off") + @lineInput(desc, IDENTIFIER, attrs._autocomplete -> "off") } @descriptionFormSection(IDENTITY_AREA) { @@ -24,7 +24,7 @@ @inlineDateSet(desc, DATES) @hiddenInputSet(desc(UNIT_DATES)) - @enumChoiceInput(desc, LEVEL_OF_DESCRIPTION, LevelOfDescription, '_blank -> true) + @enumChoiceInput(desc, LEVEL_OF_DESCRIPTION, LevelOfDescription, attrs._blank -> true) @hiddenInputSet(desc(PHYSICAL_LOCATION)) @textInput(desc, EXTENT_MEDIUM) } @@ -51,8 +51,8 @@ @defining(desc(CONDITIONS_AREA)) { desc => @textInput(desc, ACCESS_COND) @textInput(desc, REPROD_COND) - @choiceInput(desc, LANG_MATERIALS, views.Helpers.languagePairList, 'multiple -> true, 'size -> 1) - @choiceInput(desc, SCRIPT_MATERIALS, views.Helpers.scriptPairList, 'multiple -> true, 'size -> 1) + @choiceInput(desc, LANG_MATERIALS, views.Helpers.languagePairList, attrs._multiple -> true, attrs._size -> 1) + @choiceInput(desc, SCRIPT_MATERIALS, views.Helpers.scriptPairList, attrs._multiple -> true, attrs._size -> 1) @textInput(desc, PHYSICAL_CHARS) @inlineTextSet(desc, FINDING_AIDS, rows = 4) } diff --git a/modules/admin/app/views/admin/documentaryUnit/form.scala.html b/modules/admin/app/views/admin/documentaryUnit/form.scala.html index be5a27094d..3339051fbf 100644 --- a/modules/admin/app/views/admin/documentaryUnit/form.scala.html +++ b/modules/admin/app/views/admin/documentaryUnit/form.scala.html @@ -16,13 +16,13 @@ @formHelpers.descriptionFormSection(ADMINISTRATION_AREA) { @defining(PUB_STATUS) { implicit fieldPrefix => - @formHelpers.enumChoiceInput(f(""), PUB_STATUS, PublicationStatus, '_blank -> true) + @formHelpers.enumChoiceInput(f(""), PUB_STATUS, PublicationStatus, attrs._blank -> true) } @defining(COPYRIGHT) { implicit fieldPrefix => - @formHelpers.enumChoiceInput(f(""), COPYRIGHT, CopyrightStatus, '_blank -> true) + @formHelpers.enumChoiceInput(f(""), COPYRIGHT, CopyrightStatus, attrs._blank -> true) } @defining(SCOPE) { implicit fieldPrefix => - @formHelpers.enumChoiceInput(f(""), SCOPE, Scope, '_blank -> true) + @formHelpers.enumChoiceInput(f(""), SCOPE, Scope, attrs._blank -> true) } } } diff --git a/modules/admin/app/views/admin/documentaryUnit/inlineListItem.scala.html b/modules/admin/app/views/admin/documentaryUnit/inlineListItem.scala.html index c03f8dc989..fdfb58bba6 100644 --- a/modules/admin/app/views/admin/documentaryUnit/inlineListItem.scala.html +++ b/modules/admin/app/views/admin/documentaryUnit/inlineListItem.scala.html @@ -7,7 +7,7 @@
@views.html.admin.helpers.linkTo(item)
} @views.html.common.childCount(item) { count => - @views.html.helpers.link(controllers.units.routes.DocumentaryUnits.get(item.id), 'class -> "child-items-inline-load collapsed") { + @views.html.helpers.link(controllers.units.routes.DocumentaryUnits.get(item.id), attrs._class -> "child-items-inline-load collapsed") { @Messages("documentaryUnit.childCount", count) } diff --git a/modules/admin/app/views/admin/documentaryUnit/rename.scala.html b/modules/admin/app/views/admin/documentaryUnit/rename.scala.html index 1c15944197..882b49dc85 100644 --- a/modules/admin/app/views/admin/documentaryUnit/rename.scala.html +++ b/modules/admin/app/views/admin/documentaryUnit/rename.scala.html @@ -29,7 +29,7 @@ } @formHelpers.csrfToken() - @formHelpers.lineInput(f(""), Entity.IDENTIFIER, '_label -> Messages("item.rename.identifier"), 'autofocus -> "autofocus") + @formHelpers.lineInput(f(""), Entity.IDENTIFIER, attrs._label -> Messages("item.rename.identifier"), attrs._autofocus -> "autofocus") @formHelpers.submitButtonWithLogMessageInput(Messages("item.rename.submit"), cancel = views.admin.Helpers.linkToOpt(item)) } diff --git a/modules/admin/app/views/admin/documentaryUnit/searchItemBody.scala.html b/modules/admin/app/views/admin/documentaryUnit/searchItemBody.scala.html index 72a309e2c3..9783936f04 100644 --- a/modules/admin/app/views/admin/documentaryUnit/searchItemBody.scala.html +++ b/modules/admin/app/views/admin/documentaryUnit/searchItemBody.scala.html @@ -37,7 +37,7 @@ } @views.html.common.childCount(item) { count => - @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq('class -> "child-items-inline-load collapsed")) { + @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq(attrs._class -> "child-items-inline-load collapsed")) { @Messages("documentaryUnit.childCount", count) } diff --git a/modules/admin/app/views/admin/group/form.scala.html b/modules/admin/app/views/admin/group/form.scala.html index 6e98b36dba..311085c833 100644 --- a/modules/admin/app/views/admin/group/form.scala.html +++ b/modules/admin/app/views/admin/group/form.scala.html @@ -3,7 +3,7 @@ @implicitField = @{ views.html.helper.FieldConstructor(formHelpers.fieldTemplate.f) } @defining("group") { implicit prefix => - @formHelpers.lineInput(f(""), Entity.IDENTIFIER, 'autocomplete -> "off") + @formHelpers.lineInput(f(""), Entity.IDENTIFIER, attrs._autocomplete -> "off") @formHelpers.lineInput(f(""), GroupF.NAME) @formHelpers.textInput(f(""), GroupF.DESCRIPTION) } diff --git a/modules/admin/app/views/admin/group/search.scala.html b/modules/admin/app/views/admin/group/search.scala.html index db47114ce0..baa719e163 100644 --- a/modules/admin/app/views/admin/group/search.scala.html +++ b/modules/admin/app/views/admin/group/search.scala.html @@ -7,7 +7,7 @@ } @views.html.admin.common.sidebarActions { user => @views.html.admin.common.sidebarAction(user.hasPermission(ContentTypes.Group, PermissionType.Create)) { - + @Messages("group.create") diff --git a/modules/admin/app/views/admin/group/show.scala.html b/modules/admin/app/views/admin/group/show.scala.html index 92e8468747..1feefd83d2 100644 --- a/modules/admin/app/views/admin/group/show.scala.html +++ b/modules/admin/app/views/admin/group/show.scala.html @@ -74,7 +74,7 @@

@views.html.admin.common.sidebarActions { user => @views.html.admin.common.sidebarAction(user.hasPermission(ContentTypes.Group, PermissionType.Create)) { - @Messages("group.create") + @Messages("group.create") } @views.html.admin.common.sidebarAction(user.hasPermission(ContentTypes.Group, PermissionType.Update)) { @Messages("group.edit") diff --git a/modules/admin/app/views/admin/helpers/linkToWithFragment.scala.html b/modules/admin/app/views/admin/helpers/linkToWithFragment.scala.html index 5e5141d3c2..60f60ff83a 100644 --- a/modules/admin/app/views/admin/helpers/linkToWithFragment.scala.html +++ b/modules/admin/app/views/admin/helpers/linkToWithFragment.scala.html @@ -1,5 +1,5 @@ @(item: Model, fragment: String, htmlContent: Html = Html(""), textContent: Option[String] = None, attributes: Seq[(Symbol,String)] = Seq.empty)(implicit req: RequestHeader, messages: Messages) - + @{if(htmlContent.body.trim.isEmpty) textContent.getOrElse(item.toStringLang) else htmlContent} diff --git a/modules/admin/app/views/admin/historicalAgent/descriptionForm.scala.html b/modules/admin/app/views/admin/historicalAgent/descriptionForm.scala.html index 7af203678f..ac96f9a2b7 100644 --- a/modules/admin/app/views/admin/historicalAgent/descriptionForm.scala.html +++ b/modules/admin/app/views/admin/historicalAgent/descriptionForm.scala.html @@ -7,10 +7,10 @@ @implicitField = @{ views.html.helper.FieldConstructor(formHelpers.fieldTemplate.f) } @views.html.admin.common.descriptionForm(desc) { - @choiceInput(desc, LANG_CODE, views.Helpers.languagePairList, '_blank -> true) + @choiceInput(desc, LANG_CODE, views.Helpers.languagePairList, attrs._blank -> true) @descriptionFormSection(IDENTITY_AREA) { - @enumChoiceInput(desc, ENTITY_TYPE, HistoricalAgentType, '_blank -> true) + @enumChoiceInput(desc, ENTITY_TYPE, HistoricalAgentType, attrs._blank -> true) @lineInput(desc, AUTHORIZED_FORM_OF_NAME) @inlineNameSet(desc, PARALLEL_FORMS_OF_NAME) @inlineNameSet(desc, OTHER_FORMS_OF_NAME) diff --git a/modules/admin/app/views/admin/historicalAgent/form.scala.html b/modules/admin/app/views/admin/historicalAgent/form.scala.html index f47d388edb..99f3564d3a 100644 --- a/modules/admin/app/views/admin/historicalAgent/form.scala.html +++ b/modules/admin/app/views/admin/historicalAgent/form.scala.html @@ -7,7 +7,7 @@ @defining("historicalAgent") { implicit fieldPrefix => @defining(Some(fieldHints)) { implicit implicitFieldHints => - @lineInput(f(""), IDENTIFIER, 'autocomplete -> "off") + @lineInput(f(""), IDENTIFIER, attrs._autocomplete -> "off") @helper.repeat(f("descriptions"), min = math.max(f("descriptions").indexes.length, 1)) { desc => @descriptionForm(desc) diff --git a/modules/admin/app/views/admin/ingest/ingest.scala.html b/modules/admin/app/views/admin/ingest/ingest.scala.html index 2b8113befd..bc7796bb57 100644 --- a/modules/admin/app/views/admin/ingest/ingest.scala.html +++ b/modules/admin/app/views/admin/ingest/ingest.scala.html @@ -96,7 +96,7 @@ @common.itemDetails { @defining("ingest") { implicit prefix => - @helper.form(action = action, 'enctype -> "multipart/form-data", 'id -> "ingest-form") { + @helper.form(action = action, attrs._enctype -> "multipart/form-data", attrs._id -> "ingest-form") { @formHelpers.csrfToken() @formHelpers.hiddenInput(form(SCOPE_TYPE).copy(value = Some(scope.isA.toString))) @formHelpers.hiddenInput(form(SCOPE).copy(value = Some(scope.id))) @@ -114,7 +114,7 @@

@Messages("ingest.header", fonds.getOrElse(scope).toStringLang)

@formHelpers.checkbox(f, ALLOW_UPDATE) @formHelpers.checkbox(f, TOLERANT) @formHelpers.checkbox(f, USE_SOURCE_ID) - @formHelpers.choiceInput(f, LANG, views.Helpers.languagePairList, '_blank -> true) + @formHelpers.choiceInput(f, LANG, views.Helpers.languagePairList, attrs._blank -> true)
@@ -135,8 +135,8 @@

@Messages("ingest.header", fonds.getOrElse(scope).toStringLang)

}
- @formHelpers.textInput(f, LOG, 'required -> true) - @formHelpers.fileInput(f, DATA_FILE, 'required -> true) + @formHelpers.textInput(f, LOG, attrs._required -> true) + @formHelpers.fileInput(f, DATA_FILE, attrs._required -> true)
@formHelpers.checkbox(f, COMMIT) diff --git a/modules/admin/app/views/admin/link/linkForm.scala.html b/modules/admin/app/views/admin/link/linkForm.scala.html index 07d5ed1a73..e601a9f7d8 100644 --- a/modules/admin/app/views/admin/link/linkForm.scala.html +++ b/modules/admin/app/views/admin/link/linkForm.scala.html @@ -10,8 +10,8 @@ @defining("link") { implicit fieldPrefix => @defining(form("")) { desc => @formHelpers.textInput(desc, DESCRIPTION) - @formHelpers.enumChoiceInput(desc, LINK_TYPE, LinkType, '_blank -> true) - @formHelpers.enumChoiceInput(desc, LINK_FIELD, LinkField, '_blank -> true) + @formHelpers.enumChoiceInput(desc, LINK_TYPE, LinkType, attrs._blank -> true) + @formHelpers.enumChoiceInput(desc, LINK_FIELD, LinkField, attrs._blank -> true) @formHelpers.inlineDateSet(desc, DATES) } } diff --git a/modules/admin/app/views/admin/link/linkMulti.scala.html b/modules/admin/app/views/admin/link/linkMulti.scala.html index c2a2887212..6c9bd70e9f 100644 --- a/modules/admin/app/views/admin/link/linkMulti.scala.html +++ b/modules/admin/app/views/admin/link/linkMulti.scala.html @@ -10,9 +10,9 @@
@Messages("annotation.relatedItem") - @helper.inputText(annf("id"), '_label -> "item") + @helper.inputText(annf("id"), attrs._label -> "item") @defining(annf("data")) { formData => - @helper.inputText(formData(LinkF.DESCRIPTION), '_label -> Messages("link.description")) + @helper.inputText(formData(LinkF.DESCRIPTION), attrs._label -> Messages("link.description")) }
diff --git a/modules/admin/app/views/admin/permissions/revokePermission.scala.html b/modules/admin/app/views/admin/permissions/revokePermission.scala.html index 0b73f43a6d..94324b9af5 100644 --- a/modules/admin/app/views/admin/permissions/revokePermission.scala.html +++ b/modules/admin/app/views/admin/permissions/revokePermission.scala.html @@ -5,7 +5,7 @@ @permissionGrantItem(Some(item), perm) - @helper.form(action = helper.CSRF(action), 'class -> "form-actions") { + @helper.form(action = helper.CSRF(action), attrs._class -> "form-actions") { @formHelpers.submitButtonWithLogMessageInput(Messages("permissions.revoke.submit"), cancel = views.admin.Helpers.linkToOpt(item)) } } { diff --git a/modules/admin/app/views/admin/queryForm.scala.html b/modules/admin/app/views/admin/queryForm.scala.html index ef72758908..5514c45d73 100644 --- a/modules/admin/app/views/admin/queryForm.scala.html +++ b/modules/admin/app/views/admin/queryForm.scala.html @@ -41,7 +41,7 @@ } @views.html.admin.layout.noSidebar(name, scripts = extrascripts, styles = extrastyles) { - @helper.form(action = action, 'id -> "query-form") { + @helper.form(action = action, attrs._id -> "query-form") {
@formHelpers.submitButtonWithLogMessageInput(Messages("repository.update.submit"), diff --git a/modules/admin/app/views/admin/repository/form.scala.html b/modules/admin/app/views/admin/repository/form.scala.html index 0751c25db8..f12d99c598 100644 --- a/modules/admin/app/views/admin/repository/form.scala.html +++ b/modules/admin/app/views/admin/repository/form.scala.html @@ -15,12 +15,12 @@ @descriptionForm(desc) } @formHelpers.descriptionFormSection(ADMINISTRATION_AREA) { - @formHelpers.lineInput(f(""), URL_PATTERN, '_showConstraints -> false) - @formHelpers.lineInput(f(""), LOGO_URL, '_showConstraints -> false) + @formHelpers.lineInput(f(""), URL_PATTERN, attrs._showconstraints -> false) + @formHelpers.lineInput(f(""), LOGO_URL, attrs._showconstraints -> false) @defining(PUBLICATION_STATUS) { implicit fieldPrefix => @formHelpers.enumChoiceInput(f(""), PUBLICATION_STATUS, PublicationStatus) } - @formHelpers.choiceInput(f(""), PRIORITY, 1.to(5).map(i => (i.toString, i.toString)).toList ++ List(("-1", "Reject")), '_blank -> true) + @formHelpers.choiceInput(f(""), PRIORITY, 1.to(5).map(i => (i.toString, i.toString)).toList ++ List(("-1", "Reject")), attrs._blank -> true) } @formHelpers.hiddenInput(f(LONGITUDE)) @formHelpers.hiddenInput(f(LATITUDE)) diff --git a/modules/admin/app/views/admin/repository/harvest.scala.html b/modules/admin/app/views/admin/repository/harvest.scala.html index 5bccb7d289..8ecc6ba3f2 100644 --- a/modules/admin/app/views/admin/repository/harvest.scala.html +++ b/modules/admin/app/views/admin/repository/harvest.scala.html @@ -5,7 +5,7 @@ @import OaiPmhConfig._ @views.html.admin.layout.rightSidebar(Messages("oaipmh"), breadcrumbs = views.html.admin.common.breadcrumbs(List(item))) { - @helper.form(action = action, 'enctype -> "multipart/form-data") { + @helper.form(action = action, attrs._enctype -> "multipart/form-data") { @formHelpers.csrfToken() @formHelpers.globalErrors(f) diff --git a/modules/admin/app/views/admin/repository/inlineGeoname.scala.html b/modules/admin/app/views/admin/repository/inlineGeoname.scala.html index c9735f0f14..c24369bad0 100644 --- a/modules/admin/app/views/admin/repository/inlineGeoname.scala.html +++ b/modules/admin/app/views/admin/repository/inlineGeoname.scala.html @@ -6,10 +6,10 @@ @helper.inputText( field = field.copy(value = field.value.orElse(defaults.flatMap(_.getOptional[String](fieldName)))), args = views.Helpers.argsWithConfig(fieldName, views.Helpers.argsWithDefaults( - args.map { case (s, v) => if(s == 'class) s -> (v.toString + " form-control") else s -> v }, - 'title -> md.renderMarkdown(config.flatMap(_.description(fieldName)).getOrElse(Messages((if(prefix != "") prefix + "." else "") + fieldName + ".description"))), - '_label -> Messages(if(prefix.isEmpty) fieldName else "%s.%s".format(prefix, fieldName)), - 'class -> "form-control typeahead", + args.map { case (s, v) => if(s == attrs._class) s -> (v.toString + " form-control") else s -> v }, + attrs._title -> md.renderMarkdown(config.flatMap(_.description(fieldName)).getOrElse(Messages((if(prefix != "") prefix + "." else "") + fieldName + ".description"))), + attrs._label -> Messages(if(prefix.isEmpty) fieldName else "%s.%s".format(prefix, fieldName)), + attrs._class -> "form-control typeahead", Symbol("data-remote") -> geonameRemote )): _* ) diff --git a/modules/admin/app/views/admin/repository/inlineListItem.scala.html b/modules/admin/app/views/admin/repository/inlineListItem.scala.html index f30876fece..8165700741 100644 --- a/modules/admin/app/views/admin/repository/inlineListItem.scala.html +++ b/modules/admin/app/views/admin/repository/inlineListItem.scala.html @@ -8,7 +8,7 @@
@views.html.admin.helpers.linkTo(item)
} @views.html.common.childCount(item) { count => - @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq('class -> "child-items-inline-load collapsed")) { + @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq(attrs._class -> "child-items-inline-load collapsed")) { @Messages("repository.childCount", count) } diff --git a/modules/admin/app/views/admin/repository/listItem.scala.html b/modules/admin/app/views/admin/repository/listItem.scala.html index 89e7fcc251..b038a44f40 100644 --- a/modules/admin/app/views/admin/repository/listItem.scala.html +++ b/modules/admin/app/views/admin/repository/listItem.scala.html @@ -29,7 +29,7 @@ } @views.html.common.childCount(item) { count => - @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq('class -> "child-items-inline-load collapsed")) { + @views.html.admin.helpers.linkToWithBody(item, fragment = s"#${item.id}-child-item-search", attributes = Seq(attrs._class -> "child-items-inline-load collapsed")) { @Messages("repository.childCount", count) } diff --git a/modules/admin/app/views/admin/search/updateIndex.scala.html b/modules/admin/app/views/admin/search/updateIndex.scala.html index b076482bc7..356e016a92 100644 --- a/modules/admin/app/views/admin/search/updateIndex.scala.html +++ b/modules/admin/app/views/admin/search/updateIndex.scala.html @@ -22,9 +22,9 @@ @implicitField = @{ views.html.helper.FieldConstructor(formHelpers.fieldTemplate.f) } @views.html.admin.layout.rightSidebar(Messages("search.index.update"), scripts = extraScripts, breadcrumbs = breadcrumbs) { - @helper.form(action = action, 'id -> "update-form") { - @helper.checkbox(form(CLEAR_ALL), '_label -> Messages("search.index.clear.all")) - @helper.checkbox(form(CLEAR_TYPES), '_label -> Messages("search.index.clear.types")) + @helper.form(action = action, attrs._id -> "update-form") { + @helper.checkbox(form(CLEAR_ALL), attrs._label -> Messages("search.index.clear.all")) + @helper.checkbox(form(CLEAR_TYPES), attrs._label -> Messages("search.index.clear.types"))
diff --git a/modules/admin/app/views/admin/search/updateItemIndex.scala.html b/modules/admin/app/views/admin/search/updateItemIndex.scala.html index 6bdf6d0a5a..9487780c3c 100644 --- a/modules/admin/app/views/admin/search/updateItemIndex.scala.html +++ b/modules/admin/app/views/admin/search/updateItemIndex.scala.html @@ -21,7 +21,7 @@ @implicitField = @{ views.html.helper.FieldConstructor(formHelpers.fieldTemplate.f) } @views.html.admin.layout.rightSidebar(Messages("search.index.update.for", item.toStringLang), scripts=extraScript, breadcrumbs = breadcrumbs) { - @helper.form(action = action, 'id -> "update-form") { + @helper.form(action = action, attrs._id -> "update-form") { @formHelpers.csrfToken()
diff --git a/modules/admin/app/views/admin/systemEvent/eventFilter.scala.html b/modules/admin/app/views/admin/systemEvent/eventFilter.scala.html index 3363bf5edb..c8bc907f90 100644 --- a/modules/admin/app/views/admin/systemEvent/eventFilter.scala.html +++ b/modules/admin/app/views/admin/systemEvent/eventFilter.scala.html @@ -6,7 +6,7 @@
@Messages("systemEvent.filter") - @helper.form(action = action, 'class -> "", 'role -> "form") { + @helper.form(action = action, attrs._class -> "", attrs._role -> "form") { @defining("systemEvent") { implicit fieldPrefix => @@ -14,15 +14,15 @@ filterForm(""), EVENT_TYPE, EventType, - '_autosubmit -> true, - 'multiple -> true + attrs._autosubmit -> true, + attrs._multiple -> true ) @formHelpers.choiceInput( filterForm(""), USERS, users.toList, - '_autosubmit -> true, - 'multiple -> true + attrs._autosubmit -> true, + attrs._multiple -> true ) } } diff --git a/modules/admin/app/views/admin/tools/batchDelete.scala.html b/modules/admin/app/views/admin/tools/batchDelete.scala.html index d32931a2e5..cc20078fb2 100644 --- a/modules/admin/app/views/admin/tools/batchDelete.scala.html +++ b/modules/admin/app/views/admin/tools/batchDelete.scala.html @@ -9,7 +9,7 @@

@Messages("admin.utils.batchDelete.warning")

- @helper.form(action = action, 'id -> "batch-delete-form") { + @helper.form(action = action, attrs._id -> "batch-delete-form") { @formHelpers.csrfToken() @views.html.formHelpers.globalErrors(f) @defining("admin.utils.batchDelete") { implicit fieldPrefix => diff --git a/modules/admin/app/views/admin/tools/findReplace.scala.html b/modules/admin/app/views/admin/tools/findReplace.scala.html index d86e801339..d094c9314f 100644 --- a/modules/admin/app/views/admin/tools/findReplace.scala.html +++ b/modules/admin/app/views/admin/tools/findReplace.scala.html @@ -16,8 +16,8 @@ @formHelpers.csrfToken() @defining("") { implicit fieldPrefix => - @formHelpers.enumChoiceInput(f(""), PARENT_TYPE, ContentTypes, '_blank -> true) - @formHelpers.enumChoiceInput(f(""), SUB_TYPE, EntityType, '_blank -> true) + @formHelpers.enumChoiceInput(f(""), PARENT_TYPE, ContentTypes, attrs._blank -> true) + @formHelpers.enumChoiceInput(f(""), SUB_TYPE, EntityType, attrs._blank -> true) } @formHelpers.lineInput(f(""), PROPERTY) @formHelpers.textInput(f(""), FIND) diff --git a/modules/admin/app/views/admin/tools/movedItemsForm.scala.html b/modules/admin/app/views/admin/tools/movedItemsForm.scala.html index 8b33fe9689..ac83d454a8 100644 --- a/modules/admin/app/views/admin/tools/movedItemsForm.scala.html +++ b/modules/admin/app/views/admin/tools/movedItemsForm.scala.html @@ -4,7 +4,7 @@ @views.html.admin.layout.rightSidebar(Messages("admin.utils.movedItems")) {

@Messages("admin.utils.movedItems.description")

- @helper.form(action = action, 'enctype -> "multipart/form-data") { + @helper.form(action = action, attrs._enctype -> "multipart/form-data") { @views.html.admin.common.pathRemapForm(Messages("admin.utils.movedItems.submit"), form) {