From d5a44eee9a1eb092be9182dc0796df1dbfb77b27 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 18 Feb 2020 08:47:41 +0100 Subject: [PATCH] UI improvements Signed-off-by: Thomas Citharel --- CHANGELOG.md | 1 + js/src/components/Account/ParticipantCard.vue | 2 +- js/src/components/Event/DateCalendarIcon.vue | 2 +- js/src/components/Event/EventCard.vue | 102 +++++++++--------- .../ParticipationWithAccount.vue | 5 +- .../Participation/UnloggedParticipation.vue | 5 +- js/src/components/Utils/Subtitle.vue | 32 ++++++ js/src/i18n/ar.json | 2 +- js/src/i18n/be.json | 2 +- js/src/i18n/ca.json | 2 +- js/src/i18n/de.json | 2 +- js/src/i18n/en_US.json | 2 +- js/src/i18n/fi.json | 2 +- js/src/i18n/fr_FR.json | 2 +- js/src/i18n/nl.json | 2 +- js/src/i18n/oc.json | 2 +- js/src/i18n/pl.json | 2 +- js/src/i18n/pt_BR.json | 2 +- js/src/i18n/sv.json | 2 +- js/src/variables.scss | 28 ++++- js/src/views/Admin/Dashboard.vue | 12 +-- js/src/views/Event/Edit.vue | 19 ++-- js/src/views/Event/Event.vue | 11 +- js/src/views/Event/MyEvents.vue | 27 ++--- js/src/views/Group/Group.vue | 10 +- js/src/views/Home.vue | 20 ++-- js/src/views/User/Register.vue | 34 +++--- 27 files changed, 199 insertions(+), 135 deletions(-) create mode 100644 js/src/components/Utils/Subtitle.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fbf76b58..7c2fb1bef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Also make sure to remove the `EnvironmentFile=` line from the systemd service an - Possibility to delete your account ### Changed +- Improved a bit color theme - Signature validation also now checks if `Date` header has acceptable values - Actor profiles are now stale after two days and have to be refetched - Actor keys are rotated some time after sending a `Delete` activity diff --git a/js/src/components/Account/ParticipantCard.vue b/js/src/components/Account/ParticipantCard.vue index cafac377b..fa8c83533 100644 --- a/js/src/components/Account/ParticipantCard.vue +++ b/js/src/components/Account/ParticipantCard.vue @@ -25,7 +25,7 @@
- {{ actorDisplayName }}
+ {{ actorDisplayName }}
@{{ participant.actor.preferredUsername }}@{{ participant.actor.domain }} @{{ participant.actor.preferredUsername }}
diff --git a/js/src/components/Event/DateCalendarIcon.vue b/js/src/components/Event/DateCalendarIcon.vue index ea2f3644f..dab903c04 100644 --- a/js/src/components/Event/DateCalendarIcon.vue +++ b/js/src/components/Event/DateCalendarIcon.vue @@ -56,6 +56,7 @@ export default class DateCalendarIcon extends Vue { span { display: block; + font-weight: 600; &.month { color: #fa3e3e; @@ -66,7 +67,6 @@ export default class DateCalendarIcon extends Vue { } &.day { - font-weight: 300; font-size: 20px; line-height: 20px; } diff --git a/js/src/components/Event/EventCard.vue b/js/src/components/Event/EventCard.vue index c17a2be64..8e0c75fe4 100644 --- a/js/src/components/Event/EventCard.vue +++ b/js/src/components/Event/EventCard.vue @@ -31,24 +31,41 @@ A simple card for an event
- {{ tag.title }} + {{ tag.title }}
-
-
-
+
+
+
-

{{ event.title }}

+
+

{{ event.title }}

+
+ + + {{ event.physicalAddress.description }}, {{ event.physicalAddress.locality }} + +
+
- - {{ $t('By {name}', { name: actorDisplayName }) }} - - {{ event.physicalAddress.locality || event.physicalAddress.description }} - -
+ + + + + + + + + + + + + + + @@ -76,7 +93,7 @@ A simple card for an event import { IEvent, IEventCardOptions, ParticipantRole } from '@/types/event.model'; import { Component, Prop, Vue } from 'vue-property-decorator'; import DateCalendarIcon from '@/components/Event/DateCalendarIcon.vue'; -import { Person } from '@/types/actor'; +import { Actor, Person } from '@/types/actor'; @Component({ components: { @@ -100,9 +117,8 @@ export default class EventCard extends Vue { return { ...this.defaultOptions, ...this.options }; } - get actorDisplayName(): string { - const actor = Object.assign(new Person(), this.event.organizerActor || this.mergedOptions.organizerActor); - return actor.displayName(); + get actor(): Actor { + return Object.assign(new Person(), this.event.organizerActor || this.mergedOptions.organizerActor); } } @@ -145,20 +161,16 @@ export default class EventCard extends Vue { position: absolute; top: 10px; right: 0; - margin-right: -5px; + margin-right: -3px; z-index: 10; max-width: 40%; span.tag { margin: 5px auto; - box-shadow: 0 0 5px 0 rgba(0, 0, 0, 1); - /*word-break: break-all;*/ text-overflow: ellipsis; overflow: hidden; display: block; - /*text-align: right;*/ font-size: 1em; - /*padding: 0 1px;*/ line-height: 1.75em; } } @@ -172,47 +184,33 @@ export default class EventCard extends Vue { } } - div.content { - padding: 5px; - background: $secondary; + .card-content { + padding: 0.5rem; - div.title-wrapper { - display: flex; - - div.date-component { - flex: 0; - margin-right: 16px; - } - - .title { + .event-title { + font-size: 1.25rem; + line-height: 1.25rem; display: -webkit-box; -webkit-line-clamp: 2; - -webkit-box-orient: vertical; + -webkit-box-orient: vertical; overflow: hidden; - font-weight: 400; - font-size: 1.4em; - margin-top: auto; - min-height: 3.4rem; - } + min-height: 2.4rem; } - span.organizer-place-wrapper { - display: flex; - padding: 0 0.5rem 0.3rem; + + .event-subtitle { + font-size: 0.85rem; + display: inline-flex; + flex-wrap: wrap; span { - padding-right: 0.25rem; - } + width: 15rem; + display: block; + overflow: hidden; - span:not(:last-child):after { - content: '-'; - padding-left: 0.25rem; - } + flex-grow: 1; - span:last-child { - flex: 1; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + text-overflow: ellipsis; + white-space: nowrap; } } } diff --git a/js/src/components/Participation/ParticipationWithAccount.vue b/js/src/components/Participation/ParticipationWithAccount.vue index e5536e7a7..de30cae1f 100644 --- a/js/src/components/Participation/ParticipationWithAccount.vue +++ b/js/src/components/Participation/ParticipationWithAccount.vue @@ -8,7 +8,7 @@
-

{{ $t('I have an account on another Mobilizon instance.')}}

+ {{ $t('I have an account on another Mobilizon instance.')}}

{{ $t('Other software may also support this.') }}

{{ $t('We will redirect you to your instance in order to interact with this event') }}

@@ -41,9 +41,10 @@ import { Component, Prop, Vue } from 'vue-property-decorator'; import { RouteName } from '@/router'; import VerticalDivider from '@/components/Utils/VerticalDivider.vue'; +import Subtitle from '@/components/Utils/Subtitle.vue'; @Component({ - components: { VerticalDivider }, + components: { Subtitle, VerticalDivider }, }) export default class ParticipationWithAccount extends Vue { @Prop({ type: String, required: true }) uuid!: string; diff --git a/js/src/components/Participation/UnloggedParticipation.vue b/js/src/components/Participation/UnloggedParticipation.vue index 93b3b321b..09e5dfa1b 100644 --- a/js/src/components/Participation/UnloggedParticipation.vue +++ b/js/src/components/Participation/UnloggedParticipation.vue @@ -2,7 +2,7 @@
-

{{ $t('You wish to participate to the following event')}}

+ {{ $t('You wish to participate to the following event')}}
@@ -58,9 +58,10 @@ import { EventModel, IEvent } from '@/types/event.model'; import VerticalDivider from '@/components/Utils/VerticalDivider.vue'; import { CONFIG } from '@/graphql/config'; import { IConfig } from '@/types/config.model'; +import Subtitle from '@/components/Utils/Subtitle.vue'; @Component({ - components: { VerticalDivider, EventListViewCard, EventListCard }, + components: { VerticalDivider, EventListViewCard, EventListCard, Subtitle }, apollo: { event: { query: FETCH_EVENT, diff --git a/js/src/components/Utils/Subtitle.vue b/js/src/components/Utils/Subtitle.vue new file mode 100644 index 000000000..0c89ed75e --- /dev/null +++ b/js/src/components/Utils/Subtitle.vue @@ -0,0 +1,32 @@ + + + \ No newline at end of file diff --git a/js/src/i18n/ar.json b/js/src/i18n/ar.json index 0d59e022c..6c8e70aee 100644 --- a/js/src/i18n/ar.json +++ b/js/src/i18n/ar.json @@ -17,7 +17,7 @@ "Approve": "قبول", "Are you sure you want to cancel your participation at event \"{title}\"?": "هل أنت متأكد مِن أنك تريد الغاء مشاركتك في فعالية \"{title}\"؟", "Avatar": "الصورة الرمزية", - "By {name}": "حسب {name}", + "By @{username}": "حسب @{username}", "Cancel": "الغاء", "Cancel creation": "إلغاء الإنشاء", "Cancel edition": "إلغاء التحرير", diff --git a/js/src/i18n/be.json b/js/src/i18n/be.json index 7459a9c9e..3bfb6f276 100644 --- a/js/src/i18n/be.json +++ b/js/src/i18n/be.json @@ -28,7 +28,7 @@ "Are you sure you want to delete this event? This action cannot be reverted.": "Вы сапраўды хочаце выдаліць гэту падзею? Гэта дзеянне нельга адмяніць.", "Avatar": "Аватар", "Before you can login, you need to click on the link inside it to validate your account": "Каб увайсці з уліковым запісам, патрэбна спачатку перайсці па спасылцы, якая прыйшла вам у лісце", - "By {name}": "Ад {name}", + "By @{username}": "Ад @{username}", "Cancel": "Адмяніць", "Cancel creation": "Адмяніць стварэнне", "Cancel edition": "Адмяніць рэдагаванне", diff --git a/js/src/i18n/ca.json b/js/src/i18n/ca.json index be49cad87..631e8ed15 100644 --- a/js/src/i18n/ca.json +++ b/js/src/i18n/ca.json @@ -28,7 +28,7 @@ "Are you sure you want to delete this event? This action cannot be reverted.": "Segur que vols esborrar aquesta activitat? Aquesta acció és irreversible.", "Avatar": "Avatar", "Before you can login, you need to click on the link inside it to validate your account": "Per a validar el compte i poder entrar, has de clicar l'enllaç que t'hem enviat en el mail", - "By {name}": "De {name}", + "By @{username}": "De @{username}", "Cancel": "Canceŀla", "Cancel creation": "Canceŀla la creació", "Cancel edition": "Canceŀla l'edició", diff --git a/js/src/i18n/de.json b/js/src/i18n/de.json index 31959e1a4..b2cfc7235 100644 --- a/js/src/i18n/de.json +++ b/js/src/i18n/de.json @@ -28,7 +28,7 @@ "Are you sure you want to delete this event? This action cannot be reverted.": "Bist Du dir sicher, dass Du diese Veranstaltung löschen möchtest? Dies kann nicht rückgängig gemacht werden.", "Avatar": "Profilbild", "Before you can login, you need to click on the link inside it to validate your account": "Bevor Du dich einloggen kannst, musst Du den Link anklicken, um deinen Account zu überprüfen.", - "By {name}": "Nach {name}", + "By @{username}": "Nach @{username}", "Cancel": "Abbrechen", "Cancel creation": "Erstellung abbrechen", "Cancel edition": "Bearbeiten abbrechen", diff --git a/js/src/i18n/en_US.json b/js/src/i18n/en_US.json index 555deb4b7..07ce2c0fe 100644 --- a/js/src/i18n/en_US.json +++ b/js/src/i18n/en_US.json @@ -37,7 +37,7 @@ "Avatar": "Avatar", "Back to previous page": "Back to previous page", "Before you can login, you need to click on the link inside it to validate your account": "Before you can login, you need to click on the link inside it to validate your account", - "By {name}": "By {name}", + "By @{username}": "By @{username}", "Cancel anonymous participation": "Cancel anonymous participation", "Cancel creation": "Cancel creation", "Cancel edition": "Cancel edition", diff --git a/js/src/i18n/fi.json b/js/src/i18n/fi.json index ef002891c..ab6ea63f5 100644 --- a/js/src/i18n/fi.json +++ b/js/src/i18n/fi.json @@ -35,7 +35,7 @@ "Avatar": "Avatar", "Back to previous page": "Palaa edelliselle sivulle", "Before you can login, you need to click on the link inside it to validate your account": "Sinun on ennen sisäänkirjautumista vahvistettava tilisi napsauttamalla siinä olevaa linkkiä", - "By {name}": "Tehnyt {name}", + "By @{username}": "Tehnyt @{username}", "Cancel": "Peruuta", "Cancel anonymous participation": "Peruuta anonyymi osallistuminen", "Cancel creation": "Peruuta luonti", diff --git a/js/src/i18n/fr_FR.json b/js/src/i18n/fr_FR.json index 847fac4a9..eb6987bfa 100644 --- a/js/src/i18n/fr_FR.json +++ b/js/src/i18n/fr_FR.json @@ -37,7 +37,7 @@ "Avatar": "Avatar", "Back to previous page": "Retour à la page précédente", "Before you can login, you need to click on the link inside it to validate your account": "Avant que vous puissiez vous enregistrer, vous devez cliquer sur le lien à l'intérieur pour valider votre compte", - "By {name}": "Par {name}", + "By @{username}": "Par @{username}", "Cancel": "Annuler", "Cancel anonymous participation": "Annuler ma participation anonyme", "Cancel creation": "Annuler la création", diff --git a/js/src/i18n/nl.json b/js/src/i18n/nl.json index bb6ffd24f..ad932ae49 100644 --- a/js/src/i18n/nl.json +++ b/js/src/i18n/nl.json @@ -22,7 +22,7 @@ "Are you sure you want to delete this event? This action cannot be reverted.": "Bent u zeker dat u dit evenement wil verwijderen? Dit kan niet ongedaan gemaakt worden.", "Avatar": "Profielfoto", "Before you can login, you need to click on the link inside it to validate your account": "Voordat u zich kan aanmelden, moet u op de link erin klikken om uw account te valideren", - "By {name}": "Door {name}", + "By @{username}": "Door @{username}", "Cancel": "Annuleren", "Cancel creation": "Aanmaken annuleren", "Cancel edition": "Bewerken annuleren", diff --git a/js/src/i18n/oc.json b/js/src/i18n/oc.json index 04578a543..3bb216854 100644 --- a/js/src/i18n/oc.json +++ b/js/src/i18n/oc.json @@ -38,7 +38,7 @@ "Avatar": "Avatar", "Back to previous page": "Tornar a pas pagina precedenta", "Before you can login, you need to click on the link inside it to validate your account": "Abans que poscatz vos marcar, devètz clicar lo ligam dedins per validar lo compte", - "By {name}": "Per {name}", + "By @{username}": "Per @{username}", "Cancel": "Anullar", "Cancel anonymous participation": "Anullar la participacion anonima", "Cancel creation": "Anullar la creacion", diff --git a/js/src/i18n/pl.json b/js/src/i18n/pl.json index 5b5cf9681..8271f31a3 100644 --- a/js/src/i18n/pl.json +++ b/js/src/i18n/pl.json @@ -20,7 +20,7 @@ "Are you sure you want to delete this event? This action cannot be reverted.": "Czy na pewno chcesz usunąć to wydarzenie? To działanie nie może zostać odwrócone.", "Avatar": "Awatar", "Before you can login, you need to click on the link inside it to validate your account": "Zanim się zalogujesz, musisz odwiedzić odnośnik znajdujący się w niej, aby potwierdzić swoje konto", - "By {name}": "Od {name}", + "By @{username}": "Od @{username}", "Cancel": "Anuluj", "Cancel creation": "Anuluj tworzenie", "Cancel edition": "Anuluj edycję", diff --git a/js/src/i18n/pt_BR.json b/js/src/i18n/pt_BR.json index e436b127a..de388042a 100644 --- a/js/src/i18n/pt_BR.json +++ b/js/src/i18n/pt_BR.json @@ -35,7 +35,7 @@ "Avatar": "Avatar", "Back to previous page": "Voltar à página anterior", "Before you can login, you need to click on the link inside it to validate your account": "Antes de você poder começar, você precisa clicar no link que está no interior para validar a sua conta", - "By {name}": "Por {name}", + "By @{username}": "Por @{username}", "Cancel": "Cancelar", "Cancel anonymous participation": "Cancelar participação anônima", "Cancel creation": "Cancelar a criação", diff --git a/js/src/i18n/sv.json b/js/src/i18n/sv.json index 33c30b11e..be35dcddb 100644 --- a/js/src/i18n/sv.json +++ b/js/src/i18n/sv.json @@ -26,7 +26,7 @@ "Are you sure you want to delete this event? This action cannot be reverted.": "Är du säker på att du vill radera det här evenemanget? Den här handlingen kan inte ångras.", "Avatar": "Avatar", "Before you can login, you need to click on the link inside it to validate your account": "Innan du loggar in måste du klicka på länken inuti det för att validera ditt konto", - "By {name}": "Av {name}", + "By @{username}": "Av @{username}", "Cancel": "Avbryt", "Cancel creation": "Avbryt skapandet", "Cancel edition": "Avbryt redigeringen", diff --git a/js/src/variables.scss b/js/src/variables.scss index 0a3d71bcb..1884011a5 100644 --- a/js/src/variables.scss +++ b/js/src/variables.scss @@ -2,10 +2,10 @@ $primary: #424056; $primary-invert: findColorInvert($primary); -$secondary: #FAB12D; +$secondary: #ffcc85; $secondary-invert: findColorInvert($secondary); -$success: #78cc8a; +$success: #0ECCAF; $success-invert: findColorInvert($success); $info: #36bcd4; $info-invert: findColorInvert($info); @@ -39,4 +39,28 @@ $hero-body-padding-medium: 6rem 1.5rem; main > .container { background: $white; +} + +$title-color: #3C376E; +$title-family: "Liberation Sans", "Helvetica Neue", Roboto, Helvetica, Arial, serif; +$title-weight: 700; +$title-size: 40px; +$title-sub-size: 45px; +$title-sup-size: 30px; + +$subtitle-color: #3A384C; +$subtitle-family: "Liberation Sans", "Helvetica Neue", Roboto, Helvetica, Arial, serif; +$subtitle-weight: 400; +$subtitle-size: 32px; +$subtitle-sub-size: 30px; +$subtitle-sup-size: 15px; +.title { + margin: 30px auto 45px; +} + +.subtitle { + background: $secondary; + display: inline; + padding: 3px 8px; + margin: 15px auto 30px; } \ No newline at end of file diff --git a/js/src/views/Admin/Dashboard.vue b/js/src/views/Admin/Dashboard.vue index 57c6228a7..4923a21e4 100644 --- a/js/src/views/Admin/Dashboard.vue +++ b/js/src/views/Admin/Dashboard.vue @@ -7,22 +7,22 @@

{{ dashboard.numberOfEvents }}

-

{{ $t('Published events')}}

+

{{ $t('Published events')}}

{{ dashboard.numberOfComments}}

-

{{ $t('Comments')}}

+

{{ $t('Comments')}}

{{ dashboard.numberOfUsers }}

-

{{ $t('Users')}}

+

{{ $t('Users')}}

{{ dashboard.numberOfReports }}

-

{{ $t('Opened reports')}}

+

{{ $t('Opened reports')}}

@@ -41,14 +41,14 @@
-

{{ $t('Instances') }}

+ {{ $t('Instances') }}
-

{{ $t('Settings') }}

+ {{ $t('Settings') }}
diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue index 458fc2f6a..bfe37dc8c 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -9,9 +9,9 @@ -

+ {{ $t('General information') }} -

+ @@ -50,9 +50,9 @@ --> -

+ {{ $t('Who can view this event and participate') }} -

+
-->
-

+ {{ $t('Public comment moderation') }} -

+
-

+ {{ $t('Status') }} -

+ - {{ $t('By {name}', {name: event.organizerActor.name ? event.organizerActor.name : event.organizerActor.preferredUsername}) }} + {{ $t('By @{username}', {username: event.organizerActor.preferredUsername}) }}
-

+ {{ $t('About this event') }} -

+

{{ $t("The event organizer didn't add any description.") }}

@@ -202,7 +202,7 @@
-

{{ $t('Comments') }}

+ {{ $t('Comments') }}
@@ -312,9 +312,11 @@ import { removeAnonymousParticipation, } from '@/services/AnonymousParticipationStorage'; import { IConfig } from '@/types/config.model'; +import Subtitle from '@/components/Utils/Subtitle.vue'; @Component({ components: { + Subtitle, ActorLink, EventFullDate, EventCard, @@ -848,6 +850,7 @@ export default class Event extends EventMixin { word-break: break-word; font-size: 1.7em; margin-bottom: 0; + margin-top: 0; } span small { diff --git a/js/src/views/Event/MyEvents.vue b/js/src/views/Event/MyEvents.vue index 9a09939bb..04578a9b4 100644 --- a/js/src/views/Event/MyEvents.vue +++ b/js/src/views/Event/MyEvents.vue @@ -5,9 +5,9 @@
-

+ {{ $t('Upcoming') }} -

+

{{ month[0] }}

@@ -27,9 +27,9 @@
-

+ {{ $t('Drafts') }} -

+
-

+ {{ $t('Past events') }} -

+

{{ month[0] }}

@@ -73,10 +73,12 @@ import { LOGGED_USER_PARTICIPATIONS, LOGGED_USER_DRAFTS } from '@/graphql/actor' import { EventModel, IEvent, IParticipant, Participant, ParticipantRole } from '@/types/event.model'; import EventListCard from '@/components/Event/EventListCard.vue'; import EventCard from '@/components/Event/EventCard.vue'; +import Subtitle from '@/components/Utils/Subtitle.vue'; @Component({ components: { + Subtitle, EventCard, EventListCard, }, @@ -221,19 +223,6 @@ export default class MyEvents extends Vue { } section { - & > h2 { - display: block; - color: $primary; - font-size: 2.5rem; - text-decoration: underline; - text-decoration-color: $secondary; - } - - h3 { - margin-top: 2rem; - font-weight: bold; - } - .upcoming-month { text-transform: capitalize; } diff --git a/js/src/views/Group/Group.vue b/js/src/views/Group/Group.vue index dc86ef296..289bcef46 100644 --- a/js/src/views/Group/Group.vue +++ b/js/src/views/Group/Group.vue @@ -24,9 +24,9 @@
-

+ {{ $t('Organized') }} -

+
-

+ {{ $t('Members') }} -

+

{{ $t('Gather ⋅ Organize ⋅ Mobilize') }}

-

{{ $t('Join {instance}, a Mobilizon instance', { instance: config.name }) }} +

{{ $t('Join {instance}, a Mobilizon instance', { instance: config.name }) }}

{{ config.description }}

@@ -107,8 +111,10 @@ import { Component, Prop, Vue } from 'vue-property-decorator'; import { RouteName } from '@/router'; import { IConfig } from '@/types/config.model'; import { CONFIG } from '@/graphql/config'; +import Subtitle from '@/components/Utils/Subtitle.vue'; @Component({ + components: { Subtitle }, metaInfo() { return { // if no subcomponents specify a metaInfo.title, this title will be used