From 403fe375e7ae49bd74b46294e154fa507d3409bd Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 9 Jul 2024 17:11:55 +0300 Subject: [PATCH] [develop | DONE | ADDED]: Added compact view functionality on search pages. 1. newSearchPage.component.html: Increase left margin of download button | Added button for compact view | In added parameter "compactView". 2. newSearchPage.component.html: Added class fields "@Input() hasCompactView: boolean = false;", to show compact button or not and "public compactView: boolean = false;" to show compact or expanded view of each result. 3. searchDownload.component.ts: Changed download + + ` diff --git a/searchPages/searchUtils/searchResult.component.html b/searchPages/searchUtils/searchResult.component.html index e06fb724..ff198c7c 100644 --- a/searchPages/searchUtils/searchResult.component.html +++ b/searchPages/searchUtils/searchResult.component.html @@ -3,7 +3,7 @@
  • + [isCard]="true" [isMobile]="isMobile" [prevPath]="prevPath" [compactView]="compactView">
  • diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index 881578d8..cd2467d5 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -24,6 +24,8 @@ export class SearchResultComponent implements OnInit, OnChanges { @Input() custom_class: string = ""; @Input() properties: EnvProperties; @Input() showEnermaps: boolean; + @Input() compactView: boolean = false; // if true, show less info (e.g. hide description) on each result + public isMobile: boolean = false; private subscriptions: any[] = []; diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts index bf2c628a..b4d218e0 100644 --- a/utils/entity-actions/entity-actions.component.ts +++ b/utils/entity-actions/entity-actions.component.ts @@ -10,14 +10,14 @@ import {EnvProperties} from "../properties/env-properties"; @Component({ selector: 'entity-actions', template: ` -
    +
    - Link to + Link to
    @@ -25,14 +25,14 @@ import {EnvProperties} from "../properties/env-properties"; [attr.uk-tooltip]="showTooltip ? 'title: Share this '+getTypeName()+' in your social networks; pos: bottom; cls: uk-active uk-text-small uk-padding-small' : 'cls: uk-invisible'" class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> - Share + Share
    - Cite + Cite
    @@ -40,7 +40,7 @@ import {EnvProperties} from "../properties/env-properties"; [attr.uk-tooltip]="showTooltip ? 'title: Find a repository to deposit or publish your research in Open Access; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'" class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> - Deposit + Deposit
    @@ -48,7 +48,7 @@ import {EnvProperties} from "../properties/env-properties"; [attr.uk-tooltip]="showTooltip ? 'title: Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'" class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> - Embed + Embed
    @@ -96,6 +96,7 @@ export class EntityActionsComponent implements OnInit { @Input() url: string; @Input() isMobile: boolean = false; @Input() showTooltip: boolean = true; + @Input() compactView: boolean = false; // if true, do not show label for actions public citeThisClicked: boolean; public routerHelper: RouterHelper = new RouterHelper(); @ViewChild('citeModal') citeModal; @@ -103,8 +104,8 @@ export class EntityActionsComponent implements OnInit { @ViewChild('addThisModal') addThisModal; properties: EnvProperties = properties; openaireEntities = OpenaireEntities; - - + + /* Embed */ public embed_research_results_type: string = "result"; public clipboard; diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 57caefb0..01ebc125 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -32,7 +32,7 @@
    -
    +
    @@ -48,7 +48,7 @@
    - -
    +
    -
    +
    @@ -114,17 +114,17 @@
    -
    - - Overall Budget: - {{result.budget | number}} - {{result.currency}} - - - Funder Contribution: - {{result.contribution | number}} - {{result.currency}} - +
    + + Overall Budget: + {{result.budget | number}} + {{result.currency}} + + + Funder Contribution: + {{result.contribution | number}} + {{result.currency}} +
    @@ -132,11 +132,11 @@ [showAll]=true [showInline]="showInline">
    -
    +
    -
    Website URL: @@ -146,7 +146,7 @@
    -
    -
    +

    @@ -177,7 +177,7 @@
    + class="uk-text-small" [class.uk-margin-top]="!compactView" [class.uk-border-bottom]="!isMobile">
    + [showTooltip]="false" [compactView]="compactView"> + [putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers" + [compactView]="compactView"> @@ -226,7 +227,7 @@ - Access Routes + Access Routes
    diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index 539eccb9..6ab8d500 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -43,6 +43,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { @Input() showInline: boolean = false; // do not open modal for "view more" when this is true @Input() isDeletedByInferenceModal: boolean = false; // do not show action bar in results when in "Other versions" modal section @Input() showEntityActions: boolean = true; // we can use this instead of the above as it is more generic + @Input() compactView: boolean = false; // if true, show less info (e.g. hide description) on each result /* Metadata */ public type: string;