Skip to content

Commit

Permalink
Some change to search result display; display 'Beta' for science theme
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanlin2018 committed Sep 4, 2024
1 parent 270bd68 commit aaed795
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion angular/src/app/landing/landingbody.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a name="identity" #identity></a>
<!-- <div style="margin-left: -10px;"> -->
<div>
<pdr-resource-id [record]="md" [inBrowser]="inBrowser" [theme]="theme">
<pdr-resource-id [record]="md" [inBrowser]="inBrowser" [theme]="theme" [collection]="collection">
</pdr-resource-id>

<!-- description: abstract, keywords, research areas, etc. -->
Expand Down
3 changes: 1 addition & 2 deletions angular/src/app/landing/resultitem/resultitem.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

.item-title {
display: table; /* table display*/
border-spacing:15px;
border-spacing:10px;
width: 100%;
background-color: #12659c;
color: #fff !important;
border-radius: 10px 10px 0 0;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="result-contsiner">
<div class="item-title" [style.background-color]="colorScheme.default">
<!-- Title button -->
<a class="btn-parent title-btn" style="color: white;" href="{{PDRAPIURL}}{{resultItem.ediid}}" target="_blank" rel="noopener">
<a class="btn-parent title-btn" style="color: white;width: fit-content;" href="{{PDRAPIURL}}{{resultItem.ediid}}" target="_blank" rel="noopener">
<i class="pi pi-arrow-up-right btn-icon"></i>
<span style="display: table-cell;">
{{resultItem.title.trim()}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class SearchresultComponent implements OnInit {
if(this.mouseDragging) {
let diff = this.mouse.x - this.prevMouseX;
this.filterWidth = this.prevFilterWidth + diff;
this.filterWidth = this.filterWidth < 40? 49 : this.filterWidth > 500? 500 : this.filterWidth;
this.filterWidth = this.filterWidth < 40? 39 : this.filterWidth > 500? 500 : this.filterWidth;
this.filterWidthStr = this.filterWidth + 'px';
}

Expand Down
13 changes: 8 additions & 5 deletions angular/src/app/landing/sections/resourceidentity.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
padding-right: 1em;
}

.version {
background-color:var(--science-theme-background-default);
.beta-label {
margin-left: 0.5em;
color: white;
font-size: 12px;
vertical-align: top;
margin-top: .2em;
position:relative;
top: 0px;
left: 0px;
font-weight: bold;
font-size: small;
border-radius: 5px;
padding: 2px 6px 2px 2px;
}

#ispartof {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div style="width:100%">
<span class="recordType">
<b>{{recordType}}</b>
<span *ngIf="theme == scienceTheme" class="badge version"> Beta</span>
<span *ngIf="isScienceTheme" class="w3-badge beta-label" [style.background-color]="colorScheme.default"> Beta</span>
</span>
<br>
<app-title [record]="record" [inBrowser]="inBrowser"></app-title>
Expand Down
15 changes: 12 additions & 3 deletions angular/src/app/landing/sections/resourceidentity.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { VersionComponent } from '../version/version.component';
import { GoogleAnalyticsService } from '../../shared/ga-service/google-analytics.service';
import { EditStatusService } from '../../landing/editcontrol/editstatus.service';
import { LandingConstants } from '../../landing/constants';
import { Themes, ThemesPrefs } from '../../shared/globals/globals';
import { ColorScheme, Themes, ThemesPrefs } from '../../shared/globals/globals';
import { CollectionService } from '../../shared/collection-service/collection.service';

/**
* a component that lays out the "identity" section of a landing page
Expand All @@ -29,29 +30,37 @@ export class ResourceIdentityComponent implements OnChanges {
isPartOf: string[] = null;
scienceTheme = Themes.SCIENCE_THEME;
defaultTheme = Themes.DEFAULT_THEME;

colorScheme: ColorScheme;

// passed in by the parent component:
@Input() record: NerdmRes = null;
@Input() inBrowser: boolean = false;
@Input() theme: string;
@Input() collection: string;

/**
* create an instance of the Identity section
*/
constructor(private cfg: AppConfig,
public editstatsvc: EditStatusService,
private gaService: GoogleAnalyticsService)
private gaService: GoogleAnalyticsService,
public collectionService: CollectionService)
{ }

ngOnInit(): void {
this.EDIT_MODES = LandingConstants.editModes;
this.colorScheme = this.collectionService.getColorScheme(this.collection);

// Watch current edit mode set by edit controls
this.editstatsvc.watchEditMode((editMode) => {
this.editMode = editMode;
});
}

get isScienceTheme() {
return this.theme == this.scienceTheme;
}

/**
* Decide if currently in view only mode
*/
Expand Down

0 comments on commit aaed795

Please sign in to comment.