From aa57a51c2e16165c58acffa38487c951b89b0c88 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 30 Apr 2019 10:59:32 +0200 Subject: [PATCH 1/4] MOBILE-2914 icon: Slash parameter --- src/assets/fonts/slash-icon.woff | Bin 0 -> 1144 bytes src/components/icon/icon.scss | 41 ++++++++++++++++++++++++++++++- src/components/icon/icon.ts | 5 ++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/assets/fonts/slash-icon.woff diff --git a/src/assets/fonts/slash-icon.woff b/src/assets/fonts/slash-icon.woff new file mode 100644 index 0000000000000000000000000000000000000000..5e02178e49592d116b528e2e58d8b017adf71b4b GIT binary patch literal 1144 zcmXT-cXRU(3GruOV5wl>W&i@V3I;|HjR~CH+!PoXm~DVE{}>n;c~?x(Q+9I;@dfG) z0gB0haA(N#AMP%$Za^`RItj42D1(T9u)YycPYRF^lw(K;JCMYmoSRs{z`*nd$TtVd zIWh1tUCl^M1gc@=0Ez+CGnk3|*uF9YCP&>Sq9{<=|lW z-;kSF0pv5r0QqcS%oMzTconFCl@4Hy}kvRMNd7=VZgqAoEpVa|aArw$x2nf#K6nc3OC zC9URc!kH7CBB=?ilL8K$XkcNw6ca2VCGkb_%go;Y(#A&&q>bk|1}0!`j;Hn3i z(>r0WACsd<>-i7qJe?aCZIIGdY&`p>jg3qAh{MuWl`DD%db4vR=EQPIRoAk3$scI{ z%xSZ^r?ZuH_spI5|IV&XV~Bac&2;>|)c1L;vnoEv9F*jnw|d9H?a!rVDSe7LzO>@o zorFJgr!FeRBK|IUtA)h~+w-eVQstf_WPEy}HNlJie@=DisgUVpzM>UY^jKVIeeZOh(C#&@PH z*y1Pu?AEiDH$9dfa?n)uxBAB3VjSxZj<1A-w1xypHa9kb4UC^84%UdVu_~NpYEjtt z@Be>+Pyba{c(J*eu}Msha9H%|AU{LqbGAodeQ6BM|9g3kIdn~ADb!ztg<=tyCUMr z4hf6XhraCI{g6lQ+x>gOd)O^i6GfB1lc!r={30d0-WZ4*N~8YNTa2{r3A zw-(nqrUs@}xpg+VZCchev2o$jzNTcqpsc{ors|}^!Ys~7#uH*$SeSTxdV0JT-u+$2 z@+SGt_V>>_YtQ^XQup%jjc@+_x%cO%U6g0E_y5D0@Z9^itg6;wqtDZoUZ2U_`&l}z zXvv%8+!>MgqHiBi{A~SqzEXCsbNbIMQGLD>*IdqeUVdiIv4h{UyF9jMnDdJ>{B{X< zho=7q201oCHZg^>EJu0-co>*YGiU+x6u1PrUR}Hi$Y!|lW+#XO(z{(*fHVs*uL1yl CwzmTS literal 0 HcmV?d00001 diff --git a/src/components/icon/icon.scss b/src/components/icon/icon.scss index bacc56f37..f909e876e 100644 --- a/src/components/icon/icon.scss +++ b/src/components/icon/icon.scss @@ -13,4 +13,43 @@ -webkit-transform: scale(-1, 1); transform: scale(-1, 1); } -} \ No newline at end of file +} + +// Center font awesome icons + +.icon.fa::before { + width: 1em; + text-align: center; +} + +// Slash + +@font-face { + font-family: "Moodle Slash Icon"; + font-style: normal; + font-weight: 400; + src: url("#{$font-path}/slash-icon.woff") format("woff"); +} + +.icon-slash { + position: relative; +} + +.icon-slash::after { + content: "/"; + font-family: "Moodle Slash Icon"; + font-size: 0.75em; + margin-top: 0.125em; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + text-align: center; + color: color($colors, danger); +} + +.icon-slash.fa::after { + font-size: 1em; + margin-top: 0; +} diff --git a/src/components/icon/icon.ts b/src/components/icon/icon.ts index 4bf697b05..bfedf4001 100644 --- a/src/components/icon/icon.ts +++ b/src/components/icon/icon.ts @@ -29,6 +29,7 @@ export class CoreIconComponent implements OnInit, OnDestroy { // Common params. @Input() name: string; @Input('color') color?: string; + @Input('slash') slash?: boolean; // Display a red slash over the icon. // Ionicons params. @Input('isActive') isActive?: boolean; @@ -94,6 +95,10 @@ export class CoreIconComponent implements OnInit, OnDestroy { } } + if (this.slash) { + this.newElement.classList.add('icon-slash'); + } + this.element.parentElement.replaceChild(this.newElement, this.element); } From dd1076f994dd6e54a428141d670581436838b280 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 30 Apr 2019 11:05:06 +0200 Subject: [PATCH 2/4] MOBILE-2914 context-menu: Icon slash parameter --- src/components/context-menu/context-menu-item.ts | 1 + src/components/context-menu/core-context-menu-popover.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/context-menu/context-menu-item.ts b/src/components/context-menu/context-menu-item.ts index e748dee34..0870cbcd3 100644 --- a/src/components/context-menu/context-menu-item.ts +++ b/src/components/context-menu/context-menu-item.ts @@ -39,6 +39,7 @@ export class CoreContextMenuItemComponent implements OnInit, OnDestroy, OnChange // If is "spinner" an spinner will be shown. // If no icon or spinner is selected, no action or link will work. // If href but no iconAction is provided arrow-right will be used. + @Input() iconSlash?: boolean; // Display a red slash over the icon. @Input() ariaDescription?: string; // Aria label to add to iconDescription. @Input() ariaAction?: string; // Aria label to add to iconAction. If not set, it will be equal to content. @Input() href?: string; // Link to go if no action provided. diff --git a/src/components/context-menu/core-context-menu-popover.html b/src/components/context-menu/core-context-menu-popover.html index d785687be..69ffdadf7 100644 --- a/src/components/context-menu/core-context-menu-popover.html +++ b/src/components/context-menu/core-context-menu-popover.html @@ -3,7 +3,7 @@ - + {{item.badge}} From ec5ec8036f7715d8bafb3b8bf5b3fb8cfd65b7eb Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 30 Apr 2019 11:39:55 +0200 Subject: [PATCH 3/4] MOBILE-2914 messages: New unstar and add/remove contact icons --- .../messages/pages/discussion/discussion.html | 4 ++-- src/addon/messages/pages/discussion/discussion.ts | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/addon/messages/pages/discussion/discussion.html b/src/addon/messages/pages/discussion/discussion.html index 74dba5553..98289dd93 100644 --- a/src/addon/messages/pages/discussion/discussion.html +++ b/src/addon/messages/pages/discussion/discussion.html @@ -13,14 +13,14 @@ - + - + diff --git a/src/addon/messages/pages/discussion/discussion.ts b/src/addon/messages/pages/discussion/discussion.ts index 3fecd7867..c7794abbc 100644 --- a/src/addon/messages/pages/discussion/discussion.ts +++ b/src/addon/messages/pages/discussion/discussion.ts @@ -80,9 +80,10 @@ export class AddonMessagesDiscussionPage implements OnDestroy { isGroup = false; members: any = {}; // Members that wrote a message, indexed by ID. favouriteIcon = 'fa-star'; + favouriteIconSlash = false; deleteIcon = 'trash'; blockIcon = 'close-circle'; - addRemoveIcon = 'add'; + addRemoveIcon = 'person'; otherMember: any; // Other member information (individual conversations only). footerType: 'message' | 'blocked' | 'requiresContact' | 'requestSent' | 'requestReceived' | 'unable'; requestContactSent = false; @@ -244,7 +245,6 @@ export class AddonMessagesDiscussionPage implements OnDestroy { this.title = member.fullname; } this.blockIcon = this.otherMember && this.otherMember.isblocked ? 'checkmark-circle' : 'close-circle'; - this.addRemoveIcon = this.otherMember && this.otherMember.iscontact ? 'remove' : 'add'; })); } else { this.otherMember = null; @@ -446,7 +446,8 @@ export class AddonMessagesDiscussionPage implements OnDestroy { this.title = conversation.name; this.conversationImage = conversation.imageurl; this.isGroup = conversation.type == AddonMessagesProvider.MESSAGE_CONVERSATION_TYPE_GROUP; - this.favouriteIcon = conversation.isfavourite ? 'fa-star-o' : 'fa-star'; + this.favouriteIcon = 'fa-star'; + this.favouriteIconSlash = conversation.isfavourite; this.muteIcon = conversation.ismuted ? 'volume-up' : 'volume-off'; if (!this.isGroup) { this.userId = conversation.userid; @@ -1118,7 +1119,8 @@ export class AddonMessagesDiscussionPage implements OnDestroy { }).catch((error) => { this.domUtils.showErrorModalDefault(error, 'Error changing favourite state.'); }).finally(() => { - this.favouriteIcon = this.conversation.isfavourite ? 'fa-star-o' : 'fa-star'; + this.favouriteIcon = 'fa-star'; + this.favouriteIconSlash = this.conversation.isfavourite; done && done(); }); } @@ -1306,7 +1308,7 @@ export class AddonMessagesDiscussionPage implements OnDestroy { }).catch((error) => { this.domUtils.showErrorModalDefault(error, 'core.error', true); }).finally(() => { - this.addRemoveIcon = this.otherMember.iscontact ? 'remove' : 'add'; + this.addRemoveIcon = 'person'; }); } @@ -1381,7 +1383,7 @@ export class AddonMessagesDiscussionPage implements OnDestroy { }).catch((error) => { this.domUtils.showErrorModalDefault(error, 'core.error', true); }).finally(() => { - this.addRemoveIcon = this.otherMember.iscontact ? 'remove' : 'add'; + this.addRemoveIcon = 'person'; }); } From 5b74fd104f4bdadd1d197ae4429c475e45639703 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Tue, 30 Apr 2019 11:40:42 +0200 Subject: [PATCH 4/4] MOBILE-2914 courses: New unstar icon --- .../course-options-menu/core-courses-course-options-menu.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/courses/components/course-options-menu/core-courses-course-options-menu.html b/src/core/courses/components/course-options-menu/core-courses-course-options-menu.html index 7be6638ba..9e17624b8 100644 --- a/src/core/courses/components/course-options-menu/core-courses-course-options-menu.html +++ b/src/core/courses/components/course-options-menu/core-courses-course-options-menu.html @@ -16,7 +16,7 @@

{{ 'core.courses.addtofavourites' | translate }}

- +

{{ 'core.courses.removefromfavourites' | translate }}