Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

News to Public Authority Portal #677

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion projects/laji/src/app/+home/home-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { GraphQLService } from '../graph-ql/service/graph-ql.service';
import { HistoryService } from '../shared/service/history.service';
import { Image } from '../shared/gallery/image-gallery/image.interface';
import { News } from '../shared/model/News';
import { environment } from '../../environments/environment';
import { Global } from '../../environments/global';

export interface IHomeData {
observations: {
Expand Down Expand Up @@ -48,6 +50,11 @@ export interface IHomeData {
};
}

const NEWS_TAGS = ['release', 'taxonomy', 'technical', 'luke.fi', 'luomus.fi', 'syke.fi', 'vieraslajit.fi'];
if (environment.type === Global.type.vir) {
NEWS_TAGS.push('viranomaiset');
}

/* eslint-disable max-len */
const HOME_QUERY = gql`
query($pageSize: Int = 5, $after: String = "", $week: String = "") {
Expand Down Expand Up @@ -84,7 +91,7 @@ const HOME_QUERY = gql`
}
}
},
news(pageSize: $pageSize) {
news(pageSize: $pageSize, tag: "${NEWS_TAGS.join(',')}") {
prevPage,
nextPage,
results {
Expand Down
2 changes: 1 addition & 1 deletion projects/laji/src/app/+home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>{{ 'home.main-page.title' | translate }}</h1>
<p>{{ 'home.main-page.text' | translate }}</p>
<ng-container *ngTemplateOutlet="navigationThumbnails"></ng-container>
</div>
<laji-news-list class="d-block mb-3"></laji-news-list>
<laji-news-list class="d-block mb-3 home-news-list"></laji-news-list>
</div>
</div>
<div class="d-flex flex-col items-center home-content-container section-2">
Expand Down
18 changes: 0 additions & 18 deletions projects/laji/src/app/+home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,6 @@
flex-wrap: wrap;
}

.home-main {
padding-right: $sp-6;
@include media-query-phone {
padding-right: 10px;
padding-left: 10px;
}
}

laji-news-list {
max-width: 400px;
padding-left: $sp-6;
border-left: 1px solid $neutral-4;
@media only screen and (max-width: map-get($map: $breakpoints, $key: "xs")) {
border-left: none;
padding-left: unset;
}
}

.content-max-width {
width: 100%;
max-width: 1200px;
Expand Down
18 changes: 18 additions & 0 deletions projects/laji/src/styles/laji.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1358,3 +1358,21 @@ span.simple-option {
.ljb-picker-highlighter {
z-index: 1070 !important;
}

.home-main {
padding-right: $sp-6;
@include media-query-phone {
padding-right: 10px;
padding-left: 10px;
}
}

.home-news-list {
max-width: 400px;
padding-left: $sp-6;
border-left: 1px solid $neutral-4;
@media only screen and (max-width: map-get($map: $breakpoints, $key: "xs")) {
border-left: none;
padding-left: unset;
}
}
119 changes: 62 additions & 57 deletions projects/vir/src/app/+home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,63 +1,68 @@
<div class="container laji-page mt-6">
<h1>{{ 'home.authority.title' | translate }}</h1>
<laji-technical-news></laji-technical-news>
<div class="species-banner">
<div class="img-1"></div>
<div class="img-2"></div>
<div class="img-3"></div>
<div class="img-4"></div>
</div>
<div class="numbers d-flex my-4">
<div class="total mr-5">
<laji-observation-count [lightLoader]="true" [query]="{cache: true}"
></laji-observation-count>&nbsp;{{ 'home.carousel.observations' | translate }}
</div>
<div class="species">
<laji-observation-count [lightLoader]="true" [field]="'unit.linkings.taxon.id'"
[query]="{taxonRankId: 'MX.species', cache: true}">
</laji-observation-count>&nbsp;{{ 'observation.results.species' | translate }}
</div>
</div>
<div class="laji-page d-flex justify-center justify-between mt-6">
<div class="d-flex xs:flex-wrap">
<div class="flex-grow home-main mb-3">
<h1>{{ 'home.authority.title' | translate }}</h1>
<laji-technical-news></laji-technical-news>
<div class="species-banner">
<div class="img-1"></div>
<div class="img-2"></div>
<div class="img-3"></div>
<div class="img-4"></div>
</div>
<div class="numbers d-flex my-4">
<div class="total mr-5">
<laji-observation-count [lightLoader]="true" [query]="{cache: true}"
></laji-observation-count>&nbsp;{{ 'home.carousel.observations' | translate }}
</div>
<div class="species">
<laji-observation-count [lightLoader]="true" [field]="'unit.linkings.taxon.id'"
[query]="{taxonRankId: 'MX.species', cache: true}">
</laji-observation-count>&nbsp;{{ 'observation.results.species' | translate }}
</div>
</div>

<div class="intro my-6">
<div [innerHtml]="'home.authority.text' | translate" lajiRouteTransformer></div>
<!-- <div class="row">
<laji-navigation-thumbnail name="navigation.taxonomy" icon="species" path="taxon" [intro]="'home.taxon-sub-intro' | translate" [info]="'home.taxon-intro' | translate"></laji-navigation-thumbnail>
<laji-navigation-thumbnail name="home.observation" icon="observations" path="observation" [intro]="'home.observation-sub-intro' | translate" [info]="'home.observation-intro' | translate"></laji-navigation-thumbnail>
</div> -->
</div>
<div class="intro my-6">
<div [innerHtml]="'home.authority.text' | translate" lajiRouteTransformer></div>
<!-- <div class="row">
<laji-navigation-thumbnail name="navigation.taxonomy" icon="species" path="taxon" [intro]="'home.taxon-sub-intro' | translate" [info]="'home.taxon-intro' | translate"></laji-navigation-thumbnail>
<laji-navigation-thumbnail name="home.observation" icon="observations" path="observation" [intro]="'home.observation-sub-intro' | translate" [info]="'home.observation-intro' | translate"></laji-navigation-thumbnail>
</div> -->
</div>

<div class="instructions d-flex flex-wrap my-9">
<div class="flex-grow instructions-content">
<p translate>vir.home.virInstructions</p>
<lu-button role="primary" anchor="https://cdn.laji.fi/files/vir/vir_kayttoehdot.pdf" target="_blank"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.virInstructions.btn" | translate }}</lu-button>
<p class="mt-5" translate>vir.home.loginInstructions</p>
<lu-button anchor="https://cdn.laji.fi/files/vir/vir_kirjautumisohje.pdf" target="_blank"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.loginInstructions.btn" | translate }}</lu-button>
<p class="mt-5" translate>vir.home.agreement</p>
<lu-button anchor="https://cdn.laji.fi/files/vir/vir_mallisopimus.pdf" target="_blank"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.agreement.btn" | translate }}</lu-button>
<p class="mt-5" translate>vir.home.changelog</p>
<lu-button [anchor]="['/about/6669'] | localize" target="_self"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.changelog.btn" | translate }}</lu-button>
</div>
<div class="flex-grow-2 d-flex flex-col justify-center items-center instructions-info">
<i class="glyphicon glyphicon-info-sign"></i>
</div>
</div>
<div class="instructions d-flex flex-wrap my-9">
<div class="flex-grow instructions-content">
<p translate>vir.home.virInstructions</p>
<lu-button role="primary" anchor="https://cdn.laji.fi/files/vir/vir_kayttoehdot.pdf" target="_blank"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.virInstructions.btn" | translate }}</lu-button>
<p class="mt-5" translate>vir.home.loginInstructions</p>
<lu-button anchor="https://cdn.laji.fi/files/vir/vir_kirjautumisohje.pdf" target="_blank"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.loginInstructions.btn" | translate }}</lu-button>
<p class="mt-5" translate>vir.home.agreement</p>
<lu-button anchor="https://cdn.laji.fi/files/vir/vir_mallisopimus.pdf" target="_blank"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.agreement.btn" | translate }}</lu-button>
<p class="mt-5" translate>vir.home.changelog</p>
<lu-button [anchor]="['/about/6669'] | localize" target="_self"><i class="glyphicon glyphicon-file"></i> {{ "vir.home.changelog.btn" | translate }}</lu-button>
</div>
<div class="flex-grow-2 d-flex flex-col justify-center items-center instructions-info">
<i class="glyphicon glyphicon-info-sign"></i>
</div>
</div>

<div class="mb-6">
<h3 translate>vir.home.links</h3>
<div class="d-flex flex-wrap ext-links">
<a class="quality mb-4 mr-6" [routerLink]="['/about/772']">
<h1 translate>vir.home.quality</h1>
<p translate>vir.home.quality.desc</p>
</a>
<a class="redbook mb-4 mr-6" href="https://punainenkirja.laji.fi/" target="_blank">
<h1 translate>vir.home.redbook<span class="glyphicon glyphicon-new-window"></span></h1>
<p translate>vir.home.redbook.desc</p>
</a>
<a class="lajifi" href="https://laji.fi/about/709" target="_blank">
<h1 translate>vir.home.sensitive<span class="glyphicon glyphicon-new-window"></span></h1>
<p translate>vir.home.sensitive.desc</p>
</a>
<div class="mb-6">
<h3 translate>vir.home.links</h3>
<div class="d-flex flex-wrap ext-links">
<a class="quality mb-4 mr-6" [routerLink]="['/about/772']">
<h1 translate>vir.home.quality</h1>
<p translate>vir.home.quality.desc</p>
</a>
<a class="redbook mb-4 mr-6" href="https://punainenkirja.laji.fi/" target="_blank">
<h1 translate>vir.home.redbook<span class="glyphicon glyphicon-new-window"></span></h1>
<p translate>vir.home.redbook.desc</p>
</a>
<a class="lajifi" href="https://laji.fi/about/709" target="_blank">
<h1 translate>vir.home.sensitive<span class="glyphicon glyphicon-new-window"></span></h1>
<p translate>vir.home.sensitive.desc</p>
</a>
</div>
</div>
</div>
<laji-news-list class="d-block mb-3 home-news-list"></laji-news-list>
</div>
</div>
8 changes: 8 additions & 0 deletions projects/vir/src/app/+home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,11 @@
font-size: $fs-2;
font-weight: 400;
}

@media (max-width: 767px) {
.home-news-list {
margin-top: $sp-5;
padding-right: 10px;
padding-left: 10px;
}
}