diff --git a/angular.json b/angular.json index 2dcb2c58d8c..f7711638b07 100644 --- a/angular.json +++ b/angular.json @@ -49,6 +49,11 @@ "inject": false, "bundleName": "base-theme" }, + { + "input": "src/themes/dspace/styles/theme.scss", + "inject": false, + "bundleName": "dspace-theme" + }, { "input": "src/themes/custom/styles/theme.scss", "inject": false, @@ -60,9 +65,9 @@ "bundleName": "fda-theme" }, { - "input": "src/themes/dspace/styles/theme.scss", + "input": "src/themes/calabash/styles/theme.scss", "inject": false, - "bundleName": "dspace-theme" + "bundleName": "calabash-theme" } ], "scripts": [], diff --git a/config/config.dev.yml b/config/config.dev.yml index 8a65158f15b..0272227083c 100644 --- a/config/config.dev.yml +++ b/config/config.dev.yml @@ -330,7 +330,7 @@ browseBy: # The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) defaultLowerLimit: 1900 # If true, thumbnail images for items will be added to BOTH search and browse result lists. - showThumbnails: true + showThumbnails: false # The number of entries in a paginated browse results list. # Rounded to the nearest size in the list of selectable sizes on the # settings menu. @@ -439,6 +439,10 @@ themes: extends: fda handle: 2451/34841 + - name: calabash + extends: fda + handle: 2451/62242 + - name: fda headTags: - tagName: link diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index a359073e608..dd5f0db6db6 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -2733,6 +2733,8 @@ "item.listelement.badge": "Item", + "item.page.collectionslabel": "Appears in collection", + "item.page.description": "Description", "item.page.journal-issn": "Journal ISSN", @@ -6901,4 +6903,30 @@ "dynamic-form-array.sortable-list.label": "Sortable list", "metadata-export-search.submit.error.limit-exceeded": "Only the first {{limit}} items will be exported", + + "item.page.contributor.*": "Authors", + + "item.page.contributor.author": "Authors", + + "item.page.contributor.translator": "Translator", + + "item.page.doi": "DOI", + + "item.page.title": "Title", + + "item.page.rights": "Rights", + + "item.page.issue": "Issue", + + "item.page.journal": "Journal Title", + + "item.page.volume": "Volume", + + "item.page.issn": "ISSN", + + "item.page.date.issued": "Issue Date", + + "item.page.relation.ispartofseries": "Series/Report no.", + + "item.page.copyright": "Items in FDA are protected by copyright, with all rights reserved, unless otherwise indicated.", } diff --git a/src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.html b/src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.html new file mode 100644 index 00000000000..2359e3324be --- /dev/null +++ b/src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.html @@ -0,0 +1,155 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.scss b/src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss similarity index 100% rename from src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.scss rename to src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss diff --git a/src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts new file mode 100644 index 00000000000..78fc3c2f783 --- /dev/null +++ b/src/themes/calabash/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -0,0 +1,70 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { Context } from '../../../../../../../app/core/shared/context.model'; +import { Item } from '../../../../../../../app/core/shared/item.model'; +import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; +import { CollectionsComponent } from '../../../../../../../app/item-page/field-components/collections/collections.component'; +import { ThemedMediaViewerComponent } from '../../../../../../../app/item-page/media-viewer/themed-media-viewer.component'; +import { MiradorViewerComponent } from '../../../../../../../app/item-page/mirador-viewer/mirador-viewer.component'; +import { ThemedFileSectionComponent } from '../../../../../../../app/item-page/simple/field-components/file-section/themed-file-section.component'; +import { ItemPageAbstractFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageCcLicenseFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component'; +import { ItemPageDateFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/date/item-page-date-field.component'; +import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { ItemPageUriFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; +import { UntypedItemComponent as BaseComponent } from '../../../../../../../app/item-page/simple/item-types/untyped-item/untyped-item.component'; +import { ThemedMetadataRepresentationListComponent } from '../../../../../../../app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; +import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; + +/** + * Component that represents an untyped Item page + */ +@listableObjectComponent(Item, ViewMode.StandalonePage, Context.Any,'calabash') +@Component({ + selector: 'ds-untyped-item', + // styleUrls: ['./untyped-item.component.scss'], + styleUrls: [ + './untyped-item.component.scss', + ], + // templateUrl: './untyped-item.component.html', + templateUrl: + './untyped-item.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + ThemedResultsBackButtonComponent, + MiradorViewerComponent, + ThemedItemPageTitleFieldComponent, + DsoEditMenuComponent, + MetadataFieldWrapperComponent, + ThemedThumbnailComponent, + ThemedMediaViewerComponent, + ThemedFileSectionComponent, + ItemPageDateFieldComponent, + ThemedMetadataRepresentationListComponent, + GenericItemPageFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageUriFieldComponent, + CollectionsComponent, + RouterLink, + AsyncPipe, + TranslateModule, + ItemPageCcLicenseFieldComponent, + ], +}) +export class UntypedItemComponent extends BaseComponent {} diff --git a/src/themes/calabash/assets/i18n/en.json5 b/src/themes/calabash/assets/i18n/en.json5 new file mode 100644 index 00000000000..2ed4bf41a84 --- /dev/null +++ b/src/themes/calabash/assets/i18n/en.json5 @@ -0,0 +1,13 @@ +{ + "item.page.contributor.*": "Authors", + "item.page.contributor.author": "Authors", + "item.page.contributor.translator": "Translator", + "item.page.doi": "DOI", + "item.page.subject": "Subject Keywords", + "item.page.title": "Title", + "item.page.rights": "Rights", + "item.page.issue": "Issue", + "item.page.journal": "Journal Title", + "item.page.volume": "Volume", + "item.page.issn": "ISSN", +} diff --git a/src/themes/calabash/eager-theme.module.ts b/src/themes/calabash/eager-theme.module.ts new file mode 100644 index 00000000000..5f3dc6088d6 --- /dev/null +++ b/src/themes/calabash/eager-theme.module.ts @@ -0,0 +1,38 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; + +import { UntypedItemComponent } from './app/item-page/simple/item-types/untyped-item/untyped-item.component'; + + +/** + * Add components that use a custom decorator to ENTRY_COMPONENTS as well as DECLARATIONS. + * This will ensure that decorator gets picked up when the app loads + */ +const ENTRY_COMPONENTS = [ + UntypedItemComponent, +]; + +const DECLARATIONS = [ + ...ENTRY_COMPONENTS, +]; + +@NgModule({ + imports: [ + CommonModule, + ...DECLARATIONS, + ], + providers: [ + ...ENTRY_COMPONENTS.map((component) => ({ provide: component })), + ], +}) +/** + * This module is included in the main bundle that gets downloaded at first page load. So it should + * contain only the themed components that have to be available immediately for the first page load, + * and the minimal set of imports required to make them work. Anything you can cut from it will make + * the initial page load faster, but may cause the page to flicker as components that were already + * rendered server side need to be lazy-loaded again client side + * + * Themed EntryComponents should also be added here + */ +export class EagerThemeModule { +} diff --git a/src/themes/calabash/styles/_global-styles.scss b/src/themes/calabash/styles/_global-styles.scss new file mode 100644 index 00000000000..c07db76527e --- /dev/null +++ b/src/themes/calabash/styles/_global-styles.scss @@ -0,0 +1,69 @@ +// Add any global css for the FDA theme here + +// imports the base global style +@import '../../../styles/_global-styles.scss'; + +.facet-filter, +.setting-option, +.advanced-search { + background-color: var(--bs-light); + border-radius: var(--bs-border-radius); + + &.p-3 { + // Needs !important because the original bootstrap class uses it + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; + } + + .badge-secondary { + background-color: var(--bs-primary); + } + + h4, + .h4 { + font-size: 1.1rem + } +} + +#desktop-navbar.navbar-expand { + justify-content: space-around !important; +} + +h1 { + margin-top: 1rem; + margin-bottom: 1.5rem; +} + +.comcol-browse-label { + display: none; +} + +.community-page, +.collection-page { + .border-bottom { + border-bottom: none !important; + } + + .content-with-optional-title h2 { + font-size: 1.25rem; + } +} + +.comcol-page-browse-section h3 { + margin-top: 3rem; +} + +.fda-syllabus-header { + display: none; +} + +li:first-of-type .fda-syllabus-header { + display: flex; + padding-bottom: 1.5rem; + text-transform: uppercase; + font-size: .9rem; + font-weight: bold; +} +.pagination { + margin-top:2rem; +} diff --git a/src/themes/calabash/styles/_theme_css_variable_overrides.scss b/src/themes/calabash/styles/_theme_css_variable_overrides.scss new file mode 100644 index 00000000000..db9797a586a --- /dev/null +++ b/src/themes/calabash/styles/_theme_css_variable_overrides.scss @@ -0,0 +1,38 @@ +// Override or add CSS variables for your theme here + +:root { + + @include media-breakpoint-up(md) { + --ds-header-logo-height: 40px; + --ds-header-height: 80px; + } + @include media-breakpoint-down(sm) { + --ds-header-logo-height: 50px; + --ds-header-height: 90px; + } + + --ds-banner-text-background: #{$nyu-deep-violet}; + --ds-banner-background-gradient-width: 300px; + + --ds-header-navbar-border-bottom-height: 5px; + + --ds-header-bg: #{$nyu-violet}; + + --ds-navbar-link-color: #{$white}; + --ds-navbar-link-color-hover: #{$white}; + --ds-header-icon-color: #{$white}; + --ds-header-icon-color-hover: #{$white}; + /* set the next two properties as `--ds-header-navbar-border-bottom-*` + in order to keep the bottom border of the header when navbar is expanded */ + + --ds-expandable-navbar-border-top-color: #{$white}; + --ds-expandable-navbar-border-top-height: 0; + --ds-expandable-navbar-padding-top: 0; + + --ds-item-page-img-field-default-inline-height: 24px; + --ds-item-page-img-field-ror-inline-height: var(--ds-item-page-img-field-default-inline-height); + + --ds-footer-bg: #{$nyu-violet}; + +} + diff --git a/src/themes/calabash/styles/_theme_sass_variable_overrides.scss b/src/themes/calabash/styles/_theme_sass_variable_overrides.scss new file mode 100644 index 00000000000..dbbab76d3ab --- /dev/null +++ b/src/themes/calabash/styles/_theme_sass_variable_overrides.scss @@ -0,0 +1,92 @@ +// DSpace works with CSS variables for its own components, and has a mapping of all bootstrap Sass +// variables to CSS equivalents (see src/styles/_bootstrap_variables_mapping.scss). However Bootstrap +// still uses Sass variables internally. So if you want to override Bootstrap (or other sass +// variables) you can do so here. Their CSS counterparts will include the changes you make here. + +// When this file is going to be compiled, internal Bootstrap variables won't have been declared yet, +// therefore if you want to use any Bootstrap variable you also need to declare it here. + +// All SASS variables from the base theme are also included here. Do not use the '!default' flag +// here if you want to override them. + + +/*** FONT FAMILIES ***/ + +@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;1,200;1,300;1,400;1,600;1,700;1,800&display=swap'); + +$font-family-sans-serif: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + +$h1-font-size: 1.8rem; +/*** SEMANTIC COLOR SCHEME ***/ + +// Gray scale (uncomment the variables that you want to override or that you need to use in this file) +//$white: #fff; +//$gray-100: #f8f9fa; +//$gray-200: #e9ecef; +//$gray-300: #dee2e6; +//$gray-400: #ced4da; +//$gray-500: #adb5bd; +//$gray-600: #6c757d; +//$gray-700: #495057; +//$gray-800: #343a40; +//$gray-900: #212529; +//$black: #000; + +// Other colors (uncomment the variables that you want to override or that you need to use in this file) +//$blue: #007bff !default; +//$indigo: #6610f2 !default; +//$purple: #6f42c1 !default; +//$pink: #e83e8c !default; +//$red: #dc3545 !default; +//$orange: #fd7e14 !default; +//$yellow: #ffc107 !default; +//$green: #28a745 !default; +//$teal: #20c997 !default; +//$cyan: #17a2b8 !default; + +// Define or override other colors here +// ... + +// Override semantic colors here +$primary: #43515f; // Gray +$secondary: #495057; // As Bootstrap $gray-700 +$success: #92c642; // Lime +$info: #1e6f90; // Light blue +$warning: #ec9433; // Orange +$danger: #cf4444; // Red +$light: #f8f9fa; // As Bootstrap $gray-100 +$dark: #43515f; // Gray + +// Add new semantic colors here (you don't need to add existing semantic colors) +$theme-colors: ( + // ... +); + +$nyu-violet: #57068c; +$nyu-deep-violet: #330662; +/*** OTHER BOOTSTRAP VARIABLES ***/ + +// The yiq lightness value that determines when the lightness of color changes from "dark" to "light". Acceptable values are between 0 and 255. +$yiq-contrasted-threshold: 170; + +$body-color: #343a40; // As Bootstrap $gray-800 + +$link-color: $nyu-violet; // NYU Violet +$link-decoration: none; +$link-hover-color: darken($link-color, 15%); +$link-hover-decoration: underline; + +$table-accent-bg: #f8f9fa; // As Bootstrap $gray-100 +$table-hover-bg: #ced4da; // As Bootstrap $gray-400 + +$navbar-dark-color: #fff; + + + +/*** CUSTOM DSPACE VARIABLES ***/ +$ds-home-news-link-color: $nyu-violet; +$ds-header-navbar-border-bottom-color: $nyu-violet; +$ds-navbar-dropdown-bg: $nyu-violet; +$ds-navbar-dropdown-bg: $nyu-violet; +$ds-breadcrumb-link-color: #154E66 !default; +$ds-breadcrumb-link-active-color: #040D11 !default; diff --git a/src/themes/calabash/styles/theme.scss b/src/themes/calabash/styles/theme.scss new file mode 100644 index 00000000000..05c96f33728 --- /dev/null +++ b/src/themes/calabash/styles/theme.scss @@ -0,0 +1,12 @@ +// This file combines the other scss files in to one. You usually shouldn't edit this file directly + +@import './_theme_sass_variable_overrides.scss'; +@import '../../../styles/_variables.scss'; +@import '../../../styles/_mixins.scss'; +@import '../../../styles/helpers/font_awesome_imports.scss'; +@import '../../../styles/_vendor.scss'; +@import '../../../styles/_custom_variables.scss'; +@import './_theme_css_variable_overrides.scss'; +@import '../../../styles/bootstrap_variables_mapping.scss'; +@import '../../../styles/_truncatable-part.component.scss'; +@import './_global-styles.scss'; diff --git a/src/themes/eager-themes.module.ts b/src/themes/eager-themes.module.ts index 5422a2507c6..9123bb67046 100644 --- a/src/themes/eager-themes.module.ts +++ b/src/themes/eager-themes.module.ts @@ -1,10 +1,11 @@ import { NgModule } from '@angular/core'; -import { EagerThemeModule as DSpaceEagerThemeModule } from './dspace/eager-theme.module'; +import { EagerThemeModule as CalabashEagerThemeModule } from './calabash/eager-theme.module'; // import { EagerThemeModule as CustomEagerThemeModule } from './custom/eager-theme.module'; import { EagerThemeModule as FDAEagerThemeModule } from './fda/eager-theme.module'; import { EagerThemeModule as GallatinSyllabiEagerThemeModule } from './gallatin-syllabi/eager-theme.module'; + /** * This module bundles the eager theme modules for all available themes. * Eager modules contain components that are present on every page (to speed up initial loading) @@ -14,8 +15,8 @@ import { EagerThemeModule as GallatinSyllabiEagerThemeModule } from './gallatin- */ @NgModule({ imports: [ - DSpaceEagerThemeModule, FDAEagerThemeModule, + CalabashEagerThemeModule, GallatinSyllabiEagerThemeModule ], }) export class EagerThemesModule { } diff --git a/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.html b/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.html new file mode 100644 index 00000000000..668dc29466b --- /dev/null +++ b/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.html @@ -0,0 +1,250 @@ + + +
+ + + +
+
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{'item.page.title' | translate}}:  +

+ +

+
{{'item.page.title.alternative' | translate}}:  + + +
{{'item.page.contributor.*' | translate}}:  + + +
{{'item.page.subject' | translate}}:  + {{object.allMetadataValues('dc.subject').join('; ')}} +
{{'item.page.date.issued' | translate}}:  + {{object.allMetadataValues('dc.date.issued')}} +
{{'item.page.publisher' | translate}}:  + + +
{{'item.page.citation' | translate}}:  + + +
{{'item.page.relation.ispartofseries' | translate}}:  + + +
{{'item.page.abstract' | translate}}:  + + +
{{'item.page.description' | translate}}:  + + +
{{'item.page.identifier.govdoc' | translate}}:  + + +
{{'item.page.uri' | translate}}:  + + +
{{'item.page.isbn' | translate}}:  + + +
{{'item.page.issn' | translate}}:  + + +
{{'item.page.doi' | translate}}:  + + +
{{'item.page.ismn' | translate}}:  + + +
{{'item.page.identifier' | translate}}:  + + +
{{'item.page.rights' | translate}}:  + + +
+ {{'item.page.collectionslabel' | translate}}: + + +
+ +
+ + +
+
+ +
+
+ + + + +
+ +
+ +

{{'item.page.copyright' | translate}}

+ +
diff --git a/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss b/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss new file mode 100644 index 00000000000..8a74e9074ee --- /dev/null +++ b/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.scss @@ -0,0 +1,5 @@ +ds-item-page-collections { + .simple-view-element-header { + display: none !important; + } +} diff --git a/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts new file mode 100644 index 00000000000..03aa587c9e8 --- /dev/null +++ b/src/themes/fda/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -0,0 +1,70 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { Context } from '../../../../../../../app/core/shared/context.model'; +import { Item } from '../../../../../../../app/core/shared/item.model'; +import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; +import { CollectionsComponent } from '../../../../../../../app/item-page/field-components/collections/collections.component'; +import { ThemedMediaViewerComponent } from '../../../../../../../app/item-page/media-viewer/themed-media-viewer.component'; +import { MiradorViewerComponent } from '../../../../../../../app/item-page/mirador-viewer/mirador-viewer.component'; +import { ThemedFileSectionComponent } from '../../../../../../../app/item-page/simple/field-components/file-section/themed-file-section.component'; +import { ItemPageAbstractFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageCcLicenseFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component'; +import { ItemPageDateFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/date/item-page-date-field.component'; +import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { ItemPageUriFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; +import { UntypedItemComponent as BaseComponent } from '../../../../../../../app/item-page/simple/item-types/untyped-item/untyped-item.component'; +import { ThemedMetadataRepresentationListComponent } from '../../../../../../../app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; +import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; + +/** +* Component that represents an untyped Item page +*/ +@listableObjectComponent(Item, ViewMode.StandalonePage, Context.Any,'fda') +@Component({ + selector: 'ds-untyped-item', + // styleUrls: ['./untyped-item.component.scss'], + styleUrls: [ + './untyped-item.component.scss', + ], + // templateUrl: './untyped-item.component.html', + templateUrl: +'./untyped-item.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + ThemedResultsBackButtonComponent, + MiradorViewerComponent, + ThemedItemPageTitleFieldComponent, + DsoEditMenuComponent, + MetadataFieldWrapperComponent, + ThemedThumbnailComponent, + ThemedMediaViewerComponent, + ThemedFileSectionComponent, + ItemPageDateFieldComponent, + ThemedMetadataRepresentationListComponent, + GenericItemPageFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageUriFieldComponent, + CollectionsComponent, + RouterLink, + AsyncPipe, + TranslateModule, + ItemPageCcLicenseFieldComponent, + ], +}) +export class UntypedItemComponent extends BaseComponent {} diff --git a/src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html b/src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html deleted file mode 100644 index 1784cb669dd..00000000000 --- a/src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html +++ /dev/null @@ -1,30 +0,0 @@ -

{{'browse.comcol.head' | translate}}

- diff --git a/src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts deleted file mode 100644 index 91a573be39d..00000000000 --- a/src/themes/fda/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ /dev/null @@ -1,220 +0,0 @@ -import { - AsyncPipe, - NgForOf, - NgIf, -} from '@angular/common'; -import { - Component, - Inject, - Input, - OnDestroy, - OnInit, -} from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { - EventType, - NavigationEnd, - Router, - RouterLink, - RouterLinkActive, - Scroll, -} from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { - BehaviorSubject, - combineLatest, - Observable, - Subscription, -} from 'rxjs'; -import { - distinctUntilChanged, - filter, - map, - startWith, - take, -} from 'rxjs/operators'; - -import { getCollectionPageRoute } from '../../../../../../app/collection-page/collection-page-routing-paths'; -import { getCommunityPageRoute } from '../../../../../../app/community-page/community-page-routing-paths'; -import { BrowseService } from '../../../../../../app/core/browse/browse.service'; -import { PaginatedList } from '../../../../../../app/core/data/paginated-list.model'; -import { RemoteData } from '../../../../../../app/core/data/remote-data'; -import { BrowseDefinition } from '../../../../../../app/core/shared/browse-definition.model'; -import { getFirstCompletedRemoteData } from '../../../../../../app/core/shared/operators'; -import { isNotEmpty } from '../../../../../../app/shared/empty.util'; -import { - APP_CONFIG, - AppConfig, -} from '../../../../../../config/app-config.interface'; -/* import { Collection } from '../../../../../../app/core/shared/collection.model'; */ - -export interface ComColPageNavOption { - id: string; - label: string; - routerLink: string; - params?: any; -} - -/** - * A component to display the "Browse By" section of a Community or Collection page - * It expects the ID of the Community or Collection as input to be passed on as a scope - */ -@Component({ - selector: 'ds-themed-base-comcol-page-browse-by', - styleUrls: ['../../../../../../app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.scss'], - templateUrl: '../../../../../../app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.html', - imports: [ - FormsModule, - NgForOf, - RouterLink, - RouterLinkActive, - TranslateModule, - AsyncPipe, - NgIf, - ], - standalone: true, -}) -export class ComcolPageBrowseByComponent implements OnDestroy, OnInit { - /** - * The ID of the Community or Collection - */ - @Input() id: string; - @Input() contentType: string; - /* @Input() dso: Collection;*/ - - allOptions$: Observable; - - currentOption$: BehaviorSubject = new BehaviorSubject(undefined); - - subs: Subscription[] = []; - - constructor( - @Inject(APP_CONFIG) public appConfig: AppConfig, - public router: Router, - private browseService: BrowseService, - ) { - } - - ngOnInit(): void { - this.allOptions$ = this.browseService.getBrowseDefinitions().pipe( - getFirstCompletedRemoteData(), - map((browseDefListRD: RemoteData>) => { - const allOptions: ComColPageNavOption[] = []; - if (browseDefListRD.hasSucceeded) { - let comColRoute: string; - if (this.contentType === 'collection') { - comColRoute = getCollectionPageRoute(this.id); - allOptions.push({ - id: 'search', - label: 'collection.page.browse.search.head', - routerLink: `${comColRoute}/search`, - }); - } else if (this.contentType === 'community') { - comColRoute = getCommunityPageRoute(this.id); - allOptions.push({ - id: 'search', - label: 'collection.page.browse.search.head', - routerLink: `${comColRoute}/search`, - }); - allOptions.push({ - id: 'comcols', - label: 'community.all-lists.head', - routerLink: `${comColRoute}/subcoms-cols`, - }); - - } - - // FDA: Here we define the browse options available for Communities and Collections - // And their order - allOptions.push({ - id: 'browse_dateissued', - label: 'browse.comcol.by.dateissued', - routerLink: `${comColRoute}/browse/dateissued`, - }); - allOptions.push({ - id: 'browse_author', - label: 'browse.comcol.by.author', - routerLink: `${comColRoute}/browse/author`, - }); - allOptions.push({ - id: 'browse_title', - label: 'browse.comcol.by.title', - routerLink: `${comColRoute}/browse/title`, - }); - allOptions.push({ - id: 'browse_subject', - label: 'browse.comcol.by.subject', - routerLink: `${comColRoute}/browse/subject`, - }); - - - // When the default tab is not the "search" tab, the "search" tab is moved - // at the end of the tabs ribbon for aesthetics purposes. - if (this.appConfig[this.contentType].defaultBrowseTab !== 'search') { - allOptions.push(allOptions.shift()); - } - } - return allOptions; - }), - ); - - let comColRoute: string; - if (this.contentType === 'collection') { - comColRoute = getCollectionPageRoute(this.id); - } else if (this.contentType === 'community') { - comColRoute = getCommunityPageRoute(this.id); - } - - this.subs.push(combineLatest([ - this.allOptions$, - this.router.events.pipe( - startWith(this.router), - filter((next: Router|Scroll) => (isNotEmpty((next as Router)?.url) || (next as Scroll)?.type === EventType.Scroll)), - map((next: Router|Scroll) => (next as Router)?.url || ((next as Scroll).routerEvent as NavigationEnd).urlAfterRedirects), - distinctUntilChanged(), - ), - ]).subscribe(([navOptions, url]: [ComColPageNavOption[], string]) => { - for (const option of navOptions) { - if (url?.split('?')[0] === comColRoute && option.id === this.appConfig[this.contentType].defaultBrowseTab) { - void this.router.navigate([option.routerLink], { queryParams: option.params }); - break; - } else if (option.routerLink === url?.split('?')[0]) { - this.currentOption$.next(option); - break; - } - } - })); - - if (this.router.url?.split('?')[0] === comColRoute) { - this.allOptions$.pipe( - take(1), - ).subscribe((allOptions: ComColPageNavOption[]) => { - for (const option of allOptions) { - if (option.id === this.appConfig[this.contentType].defaultBrowseTab) { - this.currentOption$.next(option[0]); - void this.router.navigate([option.routerLink], { queryParams: option.params }); - break; - } - } - }); - } - } - - ngOnDestroy(): void { - this.subs.forEach((sub: Subscription) => sub.unsubscribe()); - } - - onSelectChange(event: any): void { - this.allOptions$.pipe( - take(1), - ).subscribe((allOptions: ComColPageNavOption[]) => { - for (const option of allOptions) { - if (option.id === event.target.value) { - this.currentOption$.next(option[0]); - void this.router.navigate([option.routerLink], { queryParams: option.params }); - break; - } - } - }); - } -} diff --git a/src/themes/fda/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts b/src/themes/fda/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts deleted file mode 100644 index bb815bd5dcd..00000000000 --- a/src/themes/fda/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { - Component, - Input, -} from '@angular/core'; - -import { ThemedComponent } from '../../../../../../app/shared/theme-support/themed.component'; -import { ComcolPageBrowseByComponent } from './comcol-page-browse-by.component'; - -/** - * Themed wrapper for ComcolPageBrowseByComponent - */ -@Component({ - selector: 'ds-comcol-page-browse-by', - styleUrls: [], - templateUrl: '../../../../../../app/shared/theme-support/themed.component.html', - standalone: true, - imports: [ComcolPageBrowseByComponent], -}) -export class ThemedComcolPageBrowseByComponent extends ThemedComponent { - /** - * The ID of the Community or Collection - */ - @Input() id: string; - @Input() contentType: string; - - inAndOutputNames: (keyof ComcolPageBrowseByComponent & keyof this)[] = ['id', 'contentType']; - - protected getComponentName(): string { - return 'ComcolPageBrowseByComponent'; - } - - protected importThemedComponent(themeName: string): Promise { - return import(`./comcol-page-browse-by.component`); - } - - protected importUnthemedComponent(): Promise { - return import('./comcol-page-browse-by.component'); - } -} diff --git a/src/themes/fda/app/shared/object-collection/shared/badges/badges.component.html b/src/themes/fda/app/shared/object-collection/shared/badges/badges.component.html new file mode 100644 index 00000000000..47f89bf303e --- /dev/null +++ b/src/themes/fda/app/shared/object-collection/shared/badges/badges.component.html @@ -0,0 +1 @@ + diff --git a/src/themes/fda/app/shared/object-collection/shared/badges/badges.component.ts b/src/themes/fda/app/shared/object-collection/shared/badges/badges.component.ts new file mode 100644 index 00000000000..ebb0da43a27 --- /dev/null +++ b/src/themes/fda/app/shared/object-collection/shared/badges/badges.component.ts @@ -0,0 +1,20 @@ +import { NgIf } from '@angular/common'; +import { Component } from '@angular/core'; +import { BadgesComponent as BaseComponent } from 'src/app/shared/object-collection/shared/badges/badges.component'; + +import { ThemedAccessStatusBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component'; +import { ThemedMyDSpaceStatusBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component'; +import { ThemedStatusBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component'; +import { ThemedTypeBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; + +@Component({ + selector: 'ds-themed-badges', + // styleUrls: ['./badges.component.scss'], + styleUrls: ['../../../../../../../app/shared/object-collection/shared/badges/badges.component.scss'], + templateUrl: './badges.component.html', + //templateUrl: '../../../../../../../app/shared/object-collection/shared/badges/badges.component.html', + standalone: true, + imports: [ThemedStatusBadgeComponent, NgIf, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent], +}) +export class BadgesComponent extends BaseComponent { +} diff --git a/src/themes/fda/eager-theme.module.ts b/src/themes/fda/eager-theme.module.ts index 8300b49df9a..3c50f96a70d 100644 --- a/src/themes/fda/eager-theme.module.ts +++ b/src/themes/fda/eager-theme.module.ts @@ -8,13 +8,17 @@ import { HeaderComponent } from './app/header/header.component'; import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component'; import { HomeNewsComponent } from './app/home-page/home-news/home-news.component'; import { TopLevelCommunityListComponent } from './app/home-page/top-level-community-list/top-level-community-list.component'; +import { UntypedItemComponent } from './app/item-page/simple/item-types/untyped-item/untyped-item.component'; import { NavbarComponent } from './app/navbar/navbar.component'; -import { ComcolPageBrowseByComponent } from './app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component'; +import { BadgesComponent } from './app/shared/object-collection/shared/badges/badges.component'; /** * Add components that use a custom decorator to ENTRY_COMPONENTS as well as DECLARATIONS. * This will ensure that decorator gets picked up when the app loads */ -const ENTRY_COMPONENTS = []; +const ENTRY_COMPONENTS = [ + UntypedItemComponent, +]; + const DECLARATIONS = [ ...ENTRY_COMPONENTS, @@ -24,8 +28,9 @@ const DECLARATIONS = [ NavbarComponent, TopLevelCommunityListComponent, CommunityPageSubCollectionListComponent, - ComcolPageBrowseByComponent, + UntypedItemComponent, FooterComponent, + BadgesComponent, ]; @NgModule({ diff --git a/src/themes/fda/styles/_global-styles.scss b/src/themes/fda/styles/_global-styles.scss index c07db76527e..92a57e35c43 100644 --- a/src/themes/fda/styles/_global-styles.scss +++ b/src/themes/fda/styles/_global-styles.scss @@ -64,6 +64,35 @@ li:first-of-type .fda-syllabus-header { font-size: .9rem; font-weight: bold; } + .pagination { - margin-top:2rem; + margin-top: 2rem; +} + +.itemDisplayTable { + margin-top: 1.5rem; + + th, + td { + vertical-align: text-top !important; + border-bottom: 1px solid #dee2e6; + border-top: none; + } + + h2.simple-view-element-header { + display: none !important; + } + + h1 { + margin-bottom: .5rem; + } +} + +#expandable-navbar-section-browse_global { + + a[href*="topic"], + a[href*="semester"], + a[href*="subject"] { + display: none !important; + } }