MOBILE-2327 courses: Condesate the course progress styles

main
Pau Ferrer Ocaña 2018-02-28 17:02:39 +01:00
parent 86edc5f2b0
commit 2911cbb1aa
13 changed files with 46 additions and 46 deletions

View File

@ -22,7 +22,7 @@ import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../../../core/main
@Injectable() @Injectable()
export class AddonCalendarMainMenuHandler implements CoreMainMenuHandler { export class AddonCalendarMainMenuHandler implements CoreMainMenuHandler {
name = 'AddonCalendar'; name = 'AddonCalendar';
priority = 400; priority = 900;
constructor(private calendarProvider: AddonCalendarProvider) { } constructor(private calendarProvider: AddonCalendarProvider) { }

View File

@ -22,7 +22,7 @@ import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../../../core/main
@Injectable() @Injectable()
export class AddonFilesMainMenuHandler implements CoreMainMenuHandler { export class AddonFilesMainMenuHandler implements CoreMainMenuHandler {
name = 'AddonFiles'; name = 'AddonFiles';
priority = 200; priority = 400;
constructor(private filesProvider: AddonFilesProvider) { } constructor(private filesProvider: AddonFilesProvider) { }

View File

@ -29,7 +29,7 @@ import { AddonPushNotificationsProvider } from '@addon/pushnotifications/provide
@Injectable() @Injectable()
export class AddonMessagesMainMenuHandler implements CoreMainMenuHandler, CoreCronHandler { export class AddonMessagesMainMenuHandler implements CoreMainMenuHandler, CoreCronHandler {
name = 'AddonMessages'; name = 'AddonMessages';
priority = 600; priority = 800;
protected badge = ''; protected badge = '';
protected loading = true; protected loading = true;

View File

@ -237,7 +237,14 @@ core-format-text[ng-reflect-max-height], *[core-format-text][ng-reflect-max-heig
core-format-text[singleLine="true"], *[core-format-text][singleLine="true"], core-format-text[singleLine="true"], *[core-format-text][singleLine="true"],
core-format-text[ng-reflect-single-line="true"], *[core-format-text][ng-reflect-single-line="true"] { core-format-text[ng-reflect-single-line="true"], *[core-format-text][ng-reflect-single-line="true"] {
cursor: pointer;
pointer-events: auto;
white-space: nowrap; white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
position: relative;
width: 100%;
} }
.core-media-adapt-width { .core-media-adapt-width {

View File

@ -1,22 +1,20 @@
<ion-card> <ion-card>
<ion-item tappable text-wrap detail-none (click)="openCourse(course)" [title]="course.fullname"> <ion-item tappable text-wrap detail-none (click)="openCourse(course)" [title]="course.fullname" class="core-course-link">
<div class="core-course-link"> <h2><core-format-text [text]="course.fullname"></core-format-text></h2>
<h2><core-format-text [text]="course.fullname"></core-format-text></h2>
<div class="core-button-spinner"> <div class="core-button-spinner">
<!-- Download course. --> <!-- Download course. -->
<button *ngIf="prefetchCourseData.prefetchCourseIcon != 'spinner'" ion-button icon-only clear color="dark" (click)="prefetchCourse($event)"> <button *ngIf="prefetchCourseData.prefetchCourseIcon != 'spinner'" ion-button icon-only clear color="dark" (click)="prefetchCourse($event)">
<ion-icon [name]="prefetchCourseData.prefetchCourseIcon"></ion-icon> <ion-icon [name]="prefetchCourseData.prefetchCourseIcon"></ion-icon>
</button> </button>
<!-- Download course spinner. --> <!-- Download course spinner. -->
<ion-spinner *ngIf="prefetchCourseData.prefetchCourseIcon == 'spinner'"></ion-spinner> <ion-spinner *ngIf="prefetchCourseData.prefetchCourseIcon == 'spinner'"></ion-spinner>
</div>
</div> </div>
</ion-item> </ion-item>
<ion-item text-wrap *ngIf="course.summary && course.summary.length"> <ion-item text-wrap *ngIf="course.summary && course.summary.length">
<p> <p>
<summary> <summary>
<core-format-text [text]="course.summary" maxHeight="20"></core-format-text> <core-format-text [text]="course.summary" singleLine="true" clean="true"></core-format-text>
</summary> </summary>
</p> </p>
</ion-item> </ion-item>

View File

@ -1,34 +1,31 @@
core-courses-course-progress { core-courses-course-progress {
&.core-courseoverview { ion-card.card {
@include media-breakpoint-down(sm) { display: flex;
ion-card.card { flex-direction: column;
margin: 0; justify-content: space-between;
border-radius: 0;
box-shadow: none; .core-course-link {
border-bottom: 1px solid $list-border-color; .item-inner {
width: 100%; padding-right: 0;
height: 100% !important; }
.label {
display: flex;
align-items: center;
justify-content: space-between;
}
h2 {
margins: 6px 0;
flex-grow: 1;
} }
} }
.label {
ion-card.card { margin-top: 0;
display: flex; margin-right: 0;
flex-direction: column; margin-bottom: 0;
justify-content: space-between;
} }
} }
button { button {
z-index: 1; z-index: 1;
} }
.core-course-link {
display: flex;
align-items: center;
justify-content: space-between;
h2 {
flex-grow: 1;
}
}
} }

View File

@ -54,7 +54,7 @@ export class CoreCoursesMainMenuHandler implements CoreMainMenuHandler {
getDisplayData(): CoreMainMenuHandlerData { getDisplayData(): CoreMainMenuHandlerData {
if (this.isOverviewEnabled) { if (this.isOverviewEnabled) {
return { return {
icon: 'ionic', icon: 'home',
title: 'core.courses.courseoverview', title: 'core.courses.courseoverview',
page: 'CoreCoursesMyOverviewPage', page: 'CoreCoursesMyOverviewPage',
class: 'core-courseoverview-handler' class: 'core-courseoverview-handler'

View File

@ -80,7 +80,7 @@ export class CoreGradesCourseOptionHandler implements CoreCourseOptionsHandler {
/** /**
* Returns the data needed to render the handler. * Returns the data needed to render the handler.
* *
* @return {CoreMainMenuHandlerData} Data needed to render the handler. * @return {CoreCourseOptionsHandlerData} Data needed to render the handler.
*/ */
getDisplayData(): CoreCourseOptionsHandlerData { getDisplayData(): CoreCourseOptionsHandlerData {
return { return {

View File

@ -22,7 +22,7 @@ import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '../../mainmenu/pro
@Injectable() @Injectable()
export class CoreGradesMainMenuHandler implements CoreMainMenuHandler { export class CoreGradesMainMenuHandler implements CoreMainMenuHandler {
name = 'CoreGrades'; name = 'CoreGrades';
priority = 950; priority = 600;
constructor(private gradesProvider: CoreGradesProvider) { } constructor(private gradesProvider: CoreGradesProvider) { }

View File

@ -79,7 +79,7 @@ export class CoreUserParticipantsCourseOptionHandler implements CoreCourseOption
/** /**
* Returns the data needed to render the handler. * Returns the data needed to render the handler.
* *
* @return {CoreMainMenuHandlerData} Data needed to render the handler. * @return {CoreCourseOptionsHandlerData} Data needed to render the handler.
*/ */
getDisplayData(): CoreCourseOptionsHandlerData { getDisplayData(): CoreCourseOptionsHandlerData {
return { return {

View File

@ -415,7 +415,7 @@ export class CoreUserProvider {
* @param {string} [siteId] Site ID. If not defined, current site. * @param {string} [siteId] Site ID. If not defined, current site.
* @return {Promise<any>} Promise resolved if success. * @return {Promise<any>} Promise resolved if success.
*/ */
updateUserPreference(name:string, value: any, userId?: number, siteId?: string): Promise<any> { updateUserPreference(name: string, value: any, userId?: number, siteId?: string): Promise<any> {
const preferences = [ const preferences = [
{ {
type: name, type: name,

View File

@ -18,7 +18,6 @@
"@classes/*": ["classes/*"], "@classes/*": ["classes/*"],
"@core/*": ["core/*"], "@core/*": ["core/*"],
"@providers/*": ["providers/*"], "@providers/*": ["providers/*"],
"@utils": ["providers/utils/*"],
"@components": ["components/*"], "@components": ["components/*"],
"@directives": ["directives/directives.module"], "@directives": ["directives/directives.module"],
"@pipes": ["pipes/pipes.module"] "@pipes": ["pipes/pipes.module"]

View File

@ -9,7 +9,6 @@ const customConfig = {
'@classes': resolve('./src/classes'), '@classes': resolve('./src/classes'),
'@core': resolve('./src/core'), '@core': resolve('./src/core'),
'@providers': resolve('./src/providers'), '@providers': resolve('./src/providers'),
'@utils': resolve('./src/providers/utils'),
'@components': resolve('./src/components'), '@components': resolve('./src/components'),
'@directives': resolve('./src/directives/directives.module'), '@directives': resolve('./src/directives/directives.module'),
'@pipes': resolve('./src/pipes/pipes.module') '@pipes': resolve('./src/pipes/pipes.module')