From 0717d44f69d2fd2363a1aa408ce28e13dc96e400 Mon Sep 17 00:00:00 2001 From: Rob Kooper Date: Fri, 1 Oct 2021 18:21:41 -0500 Subject: [PATCH 1/3] make space layout more like datasets/files --- app/views/spaces/follow.scala.html | 4 +- app/views/spaces/otherActions.scala.html | 75 ++++++---- app/views/spaces/space.scala.html | 173 ++++++++++++----------- app/views/spaces/statistics.scala.html | 58 ++++---- 4 files changed, 174 insertions(+), 136 deletions(-) diff --git a/app/views/spaces/follow.scala.html b/app/views/spaces/follow.scala.html index 7cd673dd3..7464fc35a 100644 --- a/app/views/spaces/follow.scala.html +++ b/app/views/spaces/follow.scala.html @@ -2,11 +2,11 @@ @if(user.isDefined) { @if(user.isEmpty || !space.followers.contains(user.get.id)) { - } else { - } diff --git a/app/views/spaces/otherActions.scala.html b/app/views/spaces/otherActions.scala.html index 3a79be035..b9cd6c3ce 100644 --- a/app/views/spaces/otherActions.scala.html +++ b/app/views/spaces/otherActions.scala.html @@ -1,38 +1,61 @@ @(space: ProjectSpace)(implicit user: Option[models.User]) @import api.Permission @import play.api.i18n.Messages -
-
+
+ Edit @Messages("space.title") - -
  • + +
  • +
    + Manage Metadata Terms & Definitions - -
  • + +
  • +
    + Extractors - - } else { -
  • + +
  • + } else { +
    + Manage Users - -
  • + +
  • +
    + Edit @Messages("space.title") - -
  • + +
  • +
    + Manage Metadata Terms & Definitions - -
  • + +
  • +
    + Extractors - - } - @if(play.api.Play.current.plugin[services.StagingAreaPlugin].isDefined && Permission.checkPermission(Permission.EditStagingArea, ResourceRef(ResourceRef.space, space.id))) { -
  • Staging Area
  • - } -
  • @spaces.follow(space)
  • - + +
    + } + @if(play.api.Play.current.plugin[services.StagingAreaPlugin].isDefined && Permission.checkPermission(Permission.EditStagingArea, ResourceRef(ResourceRef.space, space.id))) { +
    + + Staging Area + +
    + } +
    + @spaces.follow(space) +
    diff --git a/app/views/spaces/space.scala.html b/app/views/spaces/space.scala.html index f4501391a..28ca667b2 100644 --- a/app/views/spaces/space.scala.html +++ b/app/views/spaces/space.scala.html @@ -19,111 +19,122 @@ } -
    - -
    -

    @space.name

    - -

    @Html(space.description.replace("\n","
    "))

    - @if(user.isDefined) { -
    - @if(Permission.checkPermission(Permission.DeleteSpace, ResourceRef(ResourceRef.space, space.id))){ - - } - @if(Permission.checkPermission(Permission.CreateDataset, ResourceRef(ResourceRef.space, space.id))) { - - @Messages("create.title", Messages("dataset.title")) - } - @if(Permission.checkPermission(Permission.CreateCollection, ResourceRef(ResourceRef.space, space.id))) { - - @Messages("create.title", Messages("collections.title")) - } - - @if(Permission.checkPermission(Permission.ViewSpace, ResourceRef(ResourceRef.space, space.id)) || user.get.identityId.userId.equals(space.creator)){ - - Search - - } - @if(play.Play.application().configuration().getBoolean("enablePublic") && (Permission.checkPermission(Permission.EditSpace, ResourceRef(ResourceRef.space, space.id)) || Permission.checkPermission(Permission.DeleteSpace, ResourceRef(ResourceRef.space, space.id)))){ -
    - } - } -
    -
    + + @* left column, space details, datasets, collections *@
    - -
    - @if(user.isDefined){ -
    - @spaces.datasetsBySpace(datasets, space, None, userSelections) - @spaces.collectionsBySpace(collections, space, None) -
    - -
    -

    The @Messages("space.title") team has made the following @Messages("datasets.title").toLowerCase and @Messages("collections.title").toLowerCase publicly available.

    - @spaces.datasetsBySpace(publicDatasets, space, Some(true), userSelections) - - @if(space.isPublic) { - @spaces.collectionsBySpace(collections, space, Some(true)) - } else { -

    @Messages("collections.title")

    -

    There are no public collections associated with this @Messages("space.title").

    + @if(Permission.checkPermission(Permission.CreateCollection, ResourceRef(ResourceRef.space, space.id))) { + + @Messages("create.title", Messages("collections.title")) + } + + @if(Permission.checkPermission(Permission.ViewSpace, ResourceRef(ResourceRef.space, space.id)) || user.get.identityId.userId.equals(space.creator)){ + + Search + + } + @if(play.Play.application().configuration().getBoolean("enablePublic") && (Permission.checkPermission(Permission.EditSpace, ResourceRef(ResourceRef.space, space.id)) || Permission.checkPermission(Permission.DeleteSpace, ResourceRef(ResourceRef.space, space.id)))){ +
    }
    - } else { -
    -

    The @Messages("space.title") team has made the following @Messages("datasets.title").toLowerCase and @Messages("collections.title").toLowerCase publicly available. - You must be a logged-in member of the @Messages("space.title") to access all the @Messages("datasets.title").toLowerCase and @Messages("collections.title").toLowerCase. -

    - @spaces.datasetsBySpace(publicDatasets, space, Some(true), userSelections) - @if(space.isPublic) { - @spaces.collectionsBySpace(collections, space, Some(true)) + } +
    + +
    + +
    + @if(user.isDefined){ +
    + @spaces.datasetsBySpace(datasets, space, None, userSelections) + @spaces.collectionsBySpace(collections, space, None) +
    + +
    +

    The @Messages("space.title") team has made the following @Messages("datasets.title").toLowerCase and @Messages("collections.title").toLowerCase publicly available.

    + @spaces.datasetsBySpace(publicDatasets, space, Some(true), userSelections) + + @if(space.isPublic) { + @spaces.collectionsBySpace(collections, space, Some(true)) + } else { +

    @Messages("collections.title")

    +

    There are no public collections associated with this @Messages("space.title").

    + } +
    + } else { +
    +

    The @Messages("space.title") team has made the following @Messages("datasets.title").toLowerCase and @Messages("collections.title").toLowerCase publicly available. + You must be a logged-in member of the @Messages("space.title") to access all the @Messages("datasets.title").toLowerCase and @Messages("collections.title").toLowerCase. +

    + @spaces.datasetsBySpace(publicDatasets, space, Some(true), userSelections) + @if(space.isPublic) { + @spaces.collectionsBySpace(collections, space, Some(true)) + } else { +

    @Messages("collections.title")

    +

    There are no public collections associated with this @Messages("space.title").

    + } +
    + } +
    +

    The following @Messages("datasets.title").toLowerCase have been published through this @Messages("space.title") and any affiliated @Messages("space.title")s.

    + @curations.publishedGrid(publishedData, servicesUrl, None)
    - } -
    -

    The following @Messages("datasets.title").toLowerCase have been published through this @Messages("space.title") and any affiliated @Messages("space.title")s.

    - @curations.publishedGrid(publishedData, servicesUrl, None)
    + + @* right column, space statistics, actions *@
    @if(user.isDefined) { - @spaces.statistics(space, spaceBytes,"row ds-section-sm space-col-right", None, spaceFiles ) + @spaces.statistics(space, spaceBytes, None, spaceFiles ) @spaces.otherActions(space) } else { - @spaces.statistics(space, spaceBytes, "row ds-section-sm space-col-right",None, spaceFiles) + @spaces.statistics(space, spaceBytes, None, spaceFiles) } - @spaces.externalLinks(space.homePage, space, "row ds-section-sm break-word space-col-right") + @spaces.externalLinks(space.homePage, space, "row ds-section-sm") @if(play.Play.application().configuration().getBoolean("enablePublic")) { - @spaces.access(space, userRoleMap, "row ds-section-sm break-word space-col-right") + @spaces.access(space, userRoleMap, "row ds-section-sm") } @if(play.api.Play.configuration.getBoolean("enable_expiration").getOrElse(false)) { @spaces.spaceConfiguration(space) }
    + +