MOBILE-3833 timeline: Import styles from myoverview

main
Pau Ferrer Ocaña 2022-04-06 10:58:36 +02:00
parent 6bf1bb7cb4
commit 9de662f896
6 changed files with 98 additions and 49 deletions

View File

@ -53,7 +53,7 @@
</ion-row> </ion-row>
</ion-col> </ion-col>
<ion-col class="addon-block-timeline-activity-action ion-no-padding" *ngIf="event.action?.actionable"> <ion-col class="addon-block-timeline-activity-action ion-no-padding" *ngIf="event.action?.actionable">
<ion-button fill="outline" (click)="action($event, event.action.url)" [title]="event.action.name"> <ion-button fill="outline" (click)="action($event, event.action.url)" [title]="event.action.name" class="chip">
{{event.action.name}} {{event.action.name}}
<ion-badge slot="end" class="ion-margin-start" *ngIf="event.action.showitemcount"> <ion-badge slot="end" class="ion-margin-start" *ngIf="event.action.showitemcount">
{{event.action.itemcount}} {{event.action.itemcount}}

View File

@ -4,13 +4,21 @@
</ion-label> </ion-label>
</ion-item-divider> </ion-item-divider>
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<ion-row class="ion-no-padding ion-justify-content-between ion-align-items-center"> <ion-row class="ion-hide-md-up addon-block-timeline-filter" *ngIf="searchEnabled">
<ion-col size="auto" class="ion-no-padding"> <ion-col>
<core-combobox [selection]="filter" (onChange)="switchFilter($event)" icon="fas-filter"> <!-- Filter courses. -->
<core-search-box (onSubmit)="searchTextChanged($event)" (onClear)="searchTextChanged()"
[placeholder]="'addon.block_timeline.searchevents' | translate" autocorrect="off" spellcheck="false" lengthCheck="2"
searchArea="AddonBlockTimeline"></core-search-box>
</ion-col>
</ion-row>
<ion-row class="ion-justify-content-between ion-align-items-center addon-block-timeline-filter">
<ion-col size="auto">
<core-combobox [selection]="filter" (onChange)="switchFilter($event)">
<ion-select-option class="ion-text-wrap" value="all"> <ion-select-option class="ion-text-wrap" value="all">
{{ 'core.all' | translate }} {{ 'core.all' | translate }}
</ion-select-option> </ion-select-option>
<ion-select-option class="ion-text-wrap" value="overdue"> <ion-select-option class="ion-text-wrap core-select-option-border-bottom" value="overdue">
{{ 'addon.block_timeline.overdue' | translate }} {{ 'addon.block_timeline.overdue' | translate }}
</ion-select-option> </ion-select-option>
<ion-select-option class="ion-text-wrap core-select-option-title" disabled value="disabled"> <ion-select-option class="ion-text-wrap core-select-option-title" disabled value="disabled">
@ -30,13 +38,13 @@
</ion-select-option> </ion-select-option>
</core-combobox> </core-combobox>
</ion-col> </ion-col>
<ion-col class="ion-no-padding ion-hide-md-down" *ngIf="searchEnabled"> <ion-col class="ion-hide-md-down" *ngIf="searchEnabled">
<!-- Filter courses. --> <!-- Filter courses. -->
<core-search-box (onSubmit)="searchTextChanged($event)" (onClear)="searchTextChanged()" <core-search-box (onSubmit)="searchTextChanged($event)" (onClear)="searchTextChanged()"
[placeholder]="'addon.block_timeline.searchevents' | translate" autocorrect="off" spellcheck="false" lengthCheck="2" [placeholder]="'addon.block_timeline.searchevents' | translate" autocorrect="off" spellcheck="false" lengthCheck="2"
searchArea="AddonBlockTimeline"></core-search-box> searchArea="AddonBlockTimeline"></core-search-box>
</ion-col> </ion-col>
<ion-col size="auto" class="ion-no-padding"> <ion-col size="auto">
<core-combobox [label]="'core.sortby' | translate" [selection]="sort" (onChange)="switchSort($event)" <core-combobox [label]="'core.sortby' | translate" [selection]="sort" (onChange)="switchSort($event)"
icon="fas-sort-amount-down-alt"> icon="fas-sort-amount-down-alt">
<ion-select-option class="ion-text-wrap" value="sortbydates"> <ion-select-option class="ion-text-wrap" value="sortbydates">
@ -48,14 +56,7 @@
</core-combobox> </core-combobox>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row class="ion-no-padding ion-hide-md-up" *ngIf="searchEnabled">
<ion-col class="ion-no-padding">
<!-- Filter courses. -->
<core-search-box (onSubmit)="searchTextChanged($event)" (onClear)="searchTextChanged()"
[placeholder]="'addon.block_timeline.searchevents' | translate" autocorrect="off" spellcheck="false" lengthCheck="2"
searchArea="AddonBlockTimeline"></core-search-box>
</ion-col>
</ion-row>
<core-loading [hideUntil]="timeline.loaded" [hidden]="sort != 'sortbydates'"> <core-loading [hideUntil]="timeline.loaded" [hidden]="sort != 'sortbydates'">
<addon-block-timeline-events [events]="timeline.events" [canLoadMore]="timeline.canLoadMore" (loadMore)="loadMore()" <addon-block-timeline-events [events]="timeline.events" [canLoadMore]="timeline.canLoadMore" (loadMore)="loadMore()"

View File

@ -0,0 +1,38 @@
:host {
ion-row.addon-block-timeline-filter {
margin: 8px;
padding: 0;
ion-col {
padding: 0;
margin-right: 2px;
margin-left: 2px;
}
ion-button,
core-combobox ::ng-deep ion-button {
--border-width: 0;
--a11y-min-target-size: 40px;
margin: 0;
.select-icon {
display: none;
}
ion-icon {
font-size: 20px;
}
}
core-combobox ::ng-deep ion-select {
margin: 0;
--a11y-min-target-size: 40px;
}
core-search-box {
padding: 0;
margin: 0;
--height: 40px;
}
}
}

View File

@ -31,6 +31,7 @@ import { CoreNavigator } from '@services/navigator';
@Component({ @Component({
selector: 'addon-block-timeline', selector: 'addon-block-timeline',
templateUrl: 'addon-block-timeline.html', templateUrl: 'addon-block-timeline.html',
styleUrls: ['timeline.scss'],
}) })
export class AddonBlockTimelineComponent extends CoreBlockBaseComponent implements OnInit { export class AddonBlockTimelineComponent extends CoreBlockBaseComponent implements OnInit {

View File

@ -1,6 +1,5 @@
<ion-card> <form (ngSubmit)="submitForm($event)" role="search" #searchForm>
<form (ngSubmit)="submitForm($event)" role="search" #searchForm> <ion-item class="search-box">
<ion-item>
<ion-label class="sr-only">{{ placeholder }}</ion-label> <ion-label class="sr-only">{{ placeholder }}</ion-label>
<ion-input type="search" name="search" [(ngModel)]="searchText" [placeholder]="placeholder" [autocorrect]="autocorrect" <ion-input type="search" name="search" [(ngModel)]="searchText" [placeholder]="placeholder" [autocorrect]="autocorrect"
[spellcheck]="spellcheck" [core-auto-focus]="autoFocus" [disabled]="disabled" role="searchbox" (ionFocus)="focus($event)"> [spellcheck]="spellcheck" [core-auto-focus]="autoFocus" [disabled]="disabled" role="searchbox" (ionFocus)="focus($event)">
@ -15,12 +14,11 @@
</ion-button> </ion-button>
</ion-item> </ion-item>
<ion-list class="core-search-history" [hidden]="!historyShown"> <ion-list class="core-search-history" [hidden]="!historyShown">
<ion-item button class="ion-text-wrap" *ngFor="let item of history" (click)="historyClicked($event, item.searchedtext)" <ion-item button class="ion-text-wrap" *ngFor="let item of history" (click)="historyClicked($event, item.searchedtext)" tabindex="0"
tabindex="0" detail="true"> detail="true">
<ion-icon name="fas-history" slot="start" aria-hidden="true"> <ion-icon name="fas-history" slot="start" aria-hidden="true">
</ion-icon> </ion-icon>
<ion-label>{{item.searchedtext}}</ion-label> <ion-label>{{item.searchedtext}}</ion-label>
</ion-item> </ion-item>
</ion-list> </ion-list>
</form> </form>
</ion-card>

View File

@ -1,29 +1,40 @@
:host { :host {
min-height: var(--a11y-min-target-size); --height: var(--a11y-min-target-size);
--search-height: calc(var(--height) - 2px);
min-height: var(--height);
display: block; display: block;
position: relative; position: relative;
margin: 8px; margin: 8px;
ion-card { form {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
z-index: 4; z-index: 4;
margin: 0; margin: 0;
--border-color: var(--core-search-box-border-color); border: 1px solid var(--core-search-box-border-color);
--border-radius: var(--core-search-box-border-radius); border-radius: var(--core-search-box-border-radius);
--background: var(--core-search-box-background); background: var(--core-search-box-background);
--color: var(--core-search-box-border-color); color: var(--core-search-box-border-color);
.search-box {
--min-height: var(--search-height);
border-radius: var(--core-search-box-border-radius);
} }
ion-button.button { ion-button.button {
margin: 0; margin: 0;
--a11y-min-target-size: var(--search-height);
} }
}
.core-search-history { .core-search-history {
max-height: calc(-120px + 80vh); max-height: calc(-120px + 80vh);
overflow-y: auto; overflow-y: auto;
background: var(--core-search-box-background); background: var(--core-search-box-background);
border-radius: 0 0 var(--core-search-box-border-radius) var(--core-search-box-border-radius);
--ion-item-background: var(--core-search-box-background); --ion-item-background: var(--core-search-box-background);
.item:hover { .item:hover {