mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 17:12:43 +00:00
feat: use school-neutral news image fallback via css
This commit is contained in:
@@ -1,11 +1,17 @@
|
|||||||
<ion-card>
|
<ion-card>
|
||||||
<span *ngIf="item.url; else imageNoUrl">
|
<span *ngIf="item.url; else imageNoUrl">
|
||||||
<a href="{{item.url}}">
|
<a href="{{item.url}}">
|
||||||
<img src="{{item.image}}" onError="this.src='../../assets/imgs/modules/news/placeholder.jpg';" />
|
<ion-thumbnail>
|
||||||
|
<img src="{{item.image}}" onerror="this.style.display = 'none'" />
|
||||||
|
<ion-icon name="newspaper-outline"></ion-icon>
|
||||||
|
</ion-thumbnail>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<ng-template #imageNoUrl>
|
<ng-template #imageNoUrl>
|
||||||
<img src="{{item.image}}" onError="this.src='../../assets/imgs/modules/news/placeholder.jpg';" />
|
<ion-thumbnail>
|
||||||
|
<img src="{{item.image}}" onerror="this.style.display = 'none'" />
|
||||||
|
<ion-icon name="newspaper-outline"></ion-icon>
|
||||||
|
</ion-thumbnail>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ion-card-header>
|
<ion-card-header>
|
||||||
<ion-card-subtitle *ngIf="item.datePublished">{{item.datePublished | amLocale: language | amDateFormat:'Do MMMM YYYY, HH:mm'}}
|
<ion-card-subtitle *ngIf="item.datePublished">{{item.datePublished | amLocale: language | amDateFormat:'Do MMMM YYYY, HH:mm'}}
|
||||||
|
|||||||
@@ -7,6 +7,24 @@ ion-card-header a {
|
|||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ion-card img {
|
ion-card ion-thumbnail img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-card ion-thumbnail {
|
||||||
|
position: relative;
|
||||||
|
background: var(--placeholder-gray);
|
||||||
|
width: 100%;
|
||||||
|
min-height: 400px;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0;
|
||||||
|
ion-icon {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
color: white;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
@@ -74,4 +74,7 @@
|
|||||||
--ion-color-dark-contrast-rgb: 255,255,255;
|
--ion-color-dark-contrast-rgb: 255,255,255;
|
||||||
--ion-color-dark-shade: #1e1e1e;
|
--ion-color-dark-shade: #1e1e1e;
|
||||||
--ion-color-dark-tint: #383838;
|
--ion-color-dark-tint: #383838;
|
||||||
|
|
||||||
|
/** StApps **/
|
||||||
|
--placeholder-gray: #F1F0ED;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user