From 40677e1793082c0535225198027af60921bee2ad Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Mon, 22 Jul 2019 10:48:50 +0200
Subject: [Glitch] Change unconfirmed user login behaviour
Port SCSS changes from 964ae8eee593687f922c873fa7b378bb6e3e39bb
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/styles/admin.scss | 58 ++++++++++++++----------
app/javascript/flavours/glitch/styles/forms.scss | 7 +++
2 files changed, 42 insertions(+), 23 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss
index 089ae68c0..f4b913680 100644
--- a/app/javascript/flavours/glitch/styles/admin.scss
+++ b/app/javascript/flavours/glitch/styles/admin.scss
@@ -204,29 +204,6 @@ $content-width: 840px;
border: 0;
}
}
-
- .muted-hint {
- color: $darker-text-color;
-
- a {
- color: $highlight-text-color;
- }
- }
-
- .positive-hint {
- color: $valid-value-color;
- font-weight: 500;
- }
-
- .negative-hint {
- color: $error-value-color;
- font-weight: 500;
- }
-
- .neutral-hint {
- color: $dark-text-color;
- font-weight: 500;
- }
}
@media screen and (max-width: $no-columns-breakpoint) {
@@ -249,6 +226,41 @@ $content-width: 840px;
}
}
+hr.spacer {
+ width: 100%;
+ border: 0;
+ margin: 20px 0;
+ height: 1px;
+}
+
+.muted-hint {
+ color: $darker-text-color;
+
+ a {
+ color: $highlight-text-color;
+ }
+}
+
+.positive-hint {
+ color: $valid-value-color;
+ font-weight: 500;
+}
+
+.negative-hint {
+ color: $error-value-color;
+ font-weight: 500;
+}
+
+.neutral-hint {
+ color: $dark-text-color;
+ font-weight: 500;
+}
+
+.warning-hint {
+ color: $gold-star;
+ font-weight: 500;
+}
+
.filters {
display: flex;
flex-wrap: wrap;
diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss
index dae29a003..14fb46c2c 100644
--- a/app/javascript/flavours/glitch/styles/forms.scss
+++ b/app/javascript/flavours/glitch/styles/forms.scss
@@ -300,6 +300,13 @@ code {
}
}
+ .input.static .label_input__wrapper {
+ font-size: 16px;
+ padding: 10px;
+ border: 1px solid $dark-text-color;
+ border-radius: 4px;
+ }
+
input[type=text],
input[type=number],
input[type=email],
--
cgit
From dd2a303a9b5404556873545bd20378549f50e386 Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Wed, 18 Sep 2019 16:37:27 +0200
Subject: [Glitch] Add password challenge to 2FA settings, e-mail notifications
Port SCSS changes from e1066cd4319a220d5be16e51ffaf5236a2f6e866 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/styles/admin.scss | 43 +++++++++++++-----------
app/javascript/flavours/glitch/styles/forms.scss | 4 +++
2 files changed, 27 insertions(+), 20 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss
index f4b913680..bdd6686f6 100644
--- a/app/javascript/flavours/glitch/styles/admin.scss
+++ b/app/javascript/flavours/glitch/styles/admin.scss
@@ -233,32 +233,35 @@ hr.spacer {
height: 1px;
}
-.muted-hint {
- color: $darker-text-color;
+body,
+.admin-wrapper .content {
+ .muted-hint {
+ color: $darker-text-color;
- a {
- color: $highlight-text-color;
+ a {
+ color: $highlight-text-color;
+ }
}
-}
-.positive-hint {
- color: $valid-value-color;
- font-weight: 500;
-}
+ .positive-hint {
+ color: $valid-value-color;
+ font-weight: 500;
+ }
-.negative-hint {
- color: $error-value-color;
- font-weight: 500;
-}
+ .negative-hint {
+ color: $error-value-color;
+ font-weight: 500;
+ }
-.neutral-hint {
- color: $dark-text-color;
- font-weight: 500;
-}
+ .neutral-hint {
+ color: $dark-text-color;
+ font-weight: 500;
+ }
-.warning-hint {
- color: $gold-star;
- font-weight: 500;
+ .warning-hint {
+ color: $gold-star;
+ font-weight: 500;
+ }
}
.filters {
diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss
index 14fb46c2c..c93464ced 100644
--- a/app/javascript/flavours/glitch/styles/forms.scss
+++ b/app/javascript/flavours/glitch/styles/forms.scss
@@ -245,6 +245,10 @@ code {
&-6 {
max-width: 50%;
}
+
+ .actions {
+ margin-top: 27px;
+ }
}
.fields-group:last-child,
--
cgit
From dbb8d9308bf7c78ac22c88365d3e2f7bd1789311 Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Thu, 19 Sep 2019 11:09:05 +0200
Subject: [Glitch] Add table of contents to about page
Port SCSS changes from d930eb88b671fa6e5573fe7342bcdda87501bdb7 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/styles/about.scss | 138 +++++++++------------
.../flavours/glitch/styles/containers.scss | 62 +++++++++
app/javascript/flavours/glitch/styles/widgets.scss | 83 +++++++++----
3 files changed, 183 insertions(+), 100 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/styles/about.scss b/app/javascript/flavours/glitch/styles/about.scss
index 0e910693d..994e80280 100644
--- a/app/javascript/flavours/glitch/styles/about.scss
+++ b/app/javascript/flavours/glitch/styles/about.scss
@@ -17,109 +17,102 @@ $small-breakpoint: 960px;
.rich-formatting {
font-family: $font-sans-serif, sans-serif;
- font-size: 16px;
+ font-size: 14px;
font-weight: 400;
- font-size: 16px;
- line-height: 30px;
+ line-height: 1.7;
+ word-wrap: break-word;
color: $darker-text-color;
- padding-right: 10px;
a {
color: $highlight-text-color;
text-decoration: underline;
+
+ &:hover,
+ &:focus,
+ &:active {
+ text-decoration: none;
+ }
}
p,
li {
- font-family: $font-sans-serif, sans-serif;
- font-size: 16px;
- font-weight: 400;
- font-size: 16px;
- line-height: 30px;
- margin-bottom: 12px;
color: $darker-text-color;
+ }
- a {
- color: $highlight-text-color;
- text-decoration: underline;
- }
+ p {
+ margin-top: 0;
+ margin-bottom: .85em;
&:last-child {
margin-bottom: 0;
}
}
- strong,
- em {
+ strong {
font-weight: 700;
- color: lighten($darker-text-color, 10%);
+ color: $secondary-text-color;
}
- h1 {
- font-family: $font-display, sans-serif;
- font-size: 26px;
- line-height: 30px;
- font-weight: 500;
- margin-bottom: 20px;
+ em {
+ font-style: italic;
color: $secondary-text-color;
+ }
- small {
- font-family: $font-sans-serif, sans-serif;
- display: block;
- font-size: 18px;
- font-weight: 400;
- color: lighten($darker-text-color, 10%);
- }
+ code {
+ font-size: 0.85em;
+ background: darken($ui-base-color, 8%);
+ border-radius: 4px;
+ padding: 0.2em 0.3em;
}
- h2 {
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6 {
font-family: $font-display, sans-serif;
- font-size: 22px;
- line-height: 26px;
+ margin-top: 1.275em;
+ margin-bottom: .85em;
font-weight: 500;
- margin-bottom: 20px;
color: $secondary-text-color;
}
+ h1 {
+ font-size: 2em;
+ }
+
+ h2 {
+ font-size: 1.75em;
+ }
+
h3 {
- font-family: $font-display, sans-serif;
- font-size: 18px;
- line-height: 24px;
- font-weight: 500;
- margin-bottom: 20px;
- color: $secondary-text-color;
+ font-size: 1.5em;
}
h4 {
- font-family: $font-display, sans-serif;
- font-size: 16px;
- line-height: 24px;
- font-weight: 500;
- margin-bottom: 20px;
- color: $secondary-text-color;
+ font-size: 1.25em;
}
- h5 {
- font-family: $font-display, sans-serif;
- font-size: 14px;
- line-height: 24px;
- font-weight: 500;
- margin-bottom: 20px;
- color: $secondary-text-color;
+ h5,
+ h6 {
+ font-size: 1em;
}
- h6 {
- font-family: $font-display, sans-serif;
- font-size: 12px;
- line-height: 24px;
- font-weight: 500;
- margin-bottom: 20px;
- color: $secondary-text-color;
+ ul {
+ list-style: disc;
+ }
+
+ ol {
+ list-style: decimal;
}
ul,
ol {
- margin-left: 20px;
+ margin: 0;
+ padding: 0;
+ padding-left: 2em;
+ margin-bottom: 0.85em;
&[type='a'] {
list-style-type: lower-alpha;
@@ -130,31 +123,22 @@ $small-breakpoint: 960px;
}
}
- ul {
- list-style: disc;
- }
-
- ol {
- list-style: decimal;
- }
-
- li > ol,
- li > ul {
- margin-top: 6px;
- }
-
hr {
width: 100%;
height: 0;
border: 0;
- border-bottom: 1px solid rgba($ui-base-lighter-color, .6);
- margin: 20px 0;
+ border-bottom: 1px solid lighten($ui-base-color, 4%);
+ margin: 1.7em 0;
&.spacer {
height: 1px;
border: 0;
}
}
+
+ & > :first-child {
+ margin-top: 0;
+ }
}
.information-board {
@@ -418,7 +402,7 @@ $small-breakpoint: 960px;
}
&__call-to-action {
- background: darken($ui-base-color, 4%);
+ background: $ui-base-color;
border-radius: 4px;
padding: 25px 40px;
overflow: hidden;
diff --git a/app/javascript/flavours/glitch/styles/containers.scss b/app/javascript/flavours/glitch/styles/containers.scss
index 17455ca58..b391c5c3b 100644
--- a/app/javascript/flavours/glitch/styles/containers.scss
+++ b/app/javascript/flavours/glitch/styles/containers.scss
@@ -143,6 +143,63 @@
grid-row: 3;
}
+ @media screen and (max-width: $no-gap-breakpoint) {
+ grid-gap: 0;
+ grid-template-columns: minmax(0, 100%);
+
+ .column-0 {
+ grid-column: 1;
+ }
+
+ .column-1 {
+ grid-column: 1;
+ grid-row: 3;
+ }
+
+ .column-2 {
+ grid-column: 1;
+ grid-row: 2;
+ }
+
+ .column-3 {
+ grid-column: 1;
+ grid-row: 4;
+ }
+ }
+}
+
+.grid-4 {
+ display: grid;
+ grid-gap: 10px;
+ grid-template-columns: 1fr 1fr 1fr 1fr;
+ grid-auto-columns: 25%;
+ grid-auto-rows: max-content;
+
+ .column-0 {
+ grid-column: 1 / 5;
+ grid-row: 1;
+ }
+
+ .column-1 {
+ grid-column: 1 / 4;
+ grid-row: 2;
+ }
+
+ .column-2 {
+ grid-column: 4;
+ grid-row: 2;
+ }
+
+ .column-3 {
+ grid-column: 2 / 5;
+ grid-row: 3;
+ }
+
+ .column-4 {
+ grid-column: 1;
+ grid-row: 3;
+ }
+
.landing-page__call-to-action {
min-height: 100%;
}
@@ -191,6 +248,11 @@
}
.column-3 {
+ grid-column: 1;
+ grid-row: 5;
+ }
+
+ .column-4 {
grid-column: 1;
grid-row: 4;
}
diff --git a/app/javascript/flavours/glitch/styles/widgets.scss b/app/javascript/flavours/glitch/styles/widgets.scss
index 9e9c6eb58..a6f7fc0be 100644
--- a/app/javascript/flavours/glitch/styles/widgets.scss
+++ b/app/javascript/flavours/glitch/styles/widgets.scss
@@ -128,41 +128,43 @@
margin-bottom: 10px;
}
-.contact-widget,
-.landing-page__information.contact-widget {
- box-sizing: border-box;
- padding: 20px;
- min-height: 100%;
- border-radius: 4px;
- background: $ui-base-color;
- box-shadow: 0 0 15px rgba($base-shadow-color, 0.2);
-}
-
.contact-widget {
+ min-height: 100%;
font-size: 15px;
color: $darker-text-color;
line-height: 20px;
word-wrap: break-word;
font-weight: 400;
+ padding: 0;
- strong {
- font-weight: 500;
+ h4 {
+ padding: 10px;
+ text-transform: uppercase;
+ font-weight: 700;
+ font-size: 13px;
+ color: $darker-text-color;
}
- p {
- margin-bottom: 10px;
-
- &:last-child {
- margin-bottom: 0;
- }
+ .account {
+ border-bottom: 0;
+ padding: 10px 0;
+ padding-top: 5px;
}
- &__mail {
- margin-top: 10px;
+ & > a {
+ display: inline-block;
+ padding: 10px;
+ padding-top: 0;
+ color: $darker-text-color;
+ text-decoration: none;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
- a {
- color: $primary-text-color;
- text-decoration: none;
+ &:hover,
+ &:focus,
+ &:active {
+ text-decoration: underline;
}
}
}
@@ -557,3 +559,38 @@ $fluid-breakpoint: $maximum-width + 20px;
}
}
}
+
+.table-of-contents {
+ background: darken($ui-base-color, 4%);
+ min-height: 100%;
+ font-size: 14px;
+ border-radius: 4px;
+
+ li a {
+ display: block;
+ font-weight: 500;
+ padding: 15px;
+ overflow: hidden;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ text-decoration: none;
+ color: $primary-text-color;
+ border-bottom: 1px solid lighten($ui-base-color, 4%);
+
+ &:hover,
+ &:focus,
+ &:active {
+ text-decoration: underline;
+ }
+ }
+
+ li:last-child a {
+ border-bottom: 0;
+ }
+
+ li ul {
+ padding-left: 20px;
+ border-bottom: 1px solid lighten($ui-base-color, 4%);
+ }
+}
--
cgit
From 6c8fefb0c9a0b968c7ab524b94a64056bf604823 Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Thu, 19 Sep 2019 19:58:40 +0200
Subject: [Glitch] Fix placeholder colors for inputs not being explicitly
defined
Port b6df9c10671cd7bf48de3dbd7a94a92fb0a148ec to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/styles/_mixins.scss | 18 ------------------
.../glitch/styles/components/accounts.scss | 22 ++++++++++++++++++++++
.../glitch/styles/components/composer.scss | 8 ++++++++
.../flavours/glitch/styles/components/search.scss | 22 ++++++++++++++++++++++
app/javascript/flavours/glitch/styles/forms.scss | 4 ++++
5 files changed, 56 insertions(+), 18 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/styles/_mixins.scss b/app/javascript/flavours/glitch/styles/_mixins.scss
index d542b1083..088b41e76 100644
--- a/app/javascript/flavours/glitch/styles/_mixins.scss
+++ b/app/javascript/flavours/glitch/styles/_mixins.scss
@@ -62,24 +62,6 @@
color: $darker-text-color;
font-size: 14px;
margin: 0;
-
- &::-moz-focus-inner {
- border: 0;
- }
-
- &::-moz-focus-inner,
- &:focus,
- &:active {
- outline: 0 !important;
- }
-
- &:focus {
- background: lighten($ui-base-color, 4%);
- }
-
- @media screen and (max-width: 600px) {
- font-size: 16px;
- }
}
@mixin search-popout() {
diff --git a/app/javascript/flavours/glitch/styles/components/accounts.scss b/app/javascript/flavours/glitch/styles/components/accounts.scss
index dc49e083c..b5a07239f 100644
--- a/app/javascript/flavours/glitch/styles/components/accounts.scss
+++ b/app/javascript/flavours/glitch/styles/components/accounts.scss
@@ -245,6 +245,28 @@
.column-select {
&__control {
@include search-input();
+
+ &::placeholder {
+ color: lighten($darker-text-color, 4%);
+ }
+
+ &::-moz-focus-inner {
+ border: 0;
+ }
+
+ &::-moz-focus-inner,
+ &:focus,
+ &:active {
+ outline: 0 !important;
+ }
+
+ &:focus {
+ background: lighten($ui-base-color, 4%);
+ }
+
+ @media screen and (max-width: 600px) {
+ font-size: 16px;
+ }
}
&__placeholder {
diff --git a/app/javascript/flavours/glitch/styles/components/composer.scss b/app/javascript/flavours/glitch/styles/components/composer.scss
index 656615f4f..436974919 100644
--- a/app/javascript/flavours/glitch/styles/components/composer.scss
+++ b/app/javascript/flavours/glitch/styles/components/composer.scss
@@ -44,6 +44,10 @@
font-family: inherit;
resize: vertical;
+ &::placeholder {
+ color: $dark-text-color;
+ }
+
&:focus { outline: 0 }
@include single-column('screen and (max-width: 630px)') { font-size: 16px }
}
@@ -263,6 +267,10 @@
resize: none;
scrollbar-color: initial;
+ &::placeholder {
+ color: $dark-text-color;
+ }
+
&::-webkit-scrollbar {
all: unset;
}
diff --git a/app/javascript/flavours/glitch/styles/components/search.scss b/app/javascript/flavours/glitch/styles/components/search.scss
index c3ea47eb0..30d69d05c 100644
--- a/app/javascript/flavours/glitch/styles/components/search.scss
+++ b/app/javascript/flavours/glitch/styles/components/search.scss
@@ -10,6 +10,28 @@
padding-right: 30px;
line-height: 18px;
font-size: 16px;
+
+ &::placeholder {
+ color: lighten($darker-text-color, 4%);
+ }
+
+ &::-moz-focus-inner {
+ border: 0;
+ }
+
+ &::-moz-focus-inner,
+ &:focus,
+ &:active {
+ outline: 0 !important;
+ }
+
+ &:focus {
+ background: lighten($ui-base-color, 4%);
+ }
+
+ @media screen and (max-width: 600px) {
+ font-size: 16px;
+ }
}
.search__icon {
diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss
index c93464ced..747c5309d 100644
--- a/app/javascript/flavours/glitch/styles/forms.scss
+++ b/app/javascript/flavours/glitch/styles/forms.scss
@@ -329,6 +329,10 @@ code {
border-radius: 4px;
padding: 10px;
+ &::placeholder {
+ color: lighten($darker-text-color, 4%);
+ }
+
&:invalid {
box-shadow: none;
}
--
cgit
From 27f922168ad828a990d2e73facc84935158df1a6 Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Fri, 20 Sep 2019 10:52:14 +0200
Subject: [Glitch] Fix page body not being scrollable in admin layout
Port SCSS changes from b9a8b38844278f26b9d1d1d53256e0781ba3575a to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/packs/public.js | 10 ++
app/javascript/flavours/glitch/styles/admin.scss | 138 ++++++++++++++++++----
app/javascript/flavours/glitch/styles/basics.scss | 3 -
3 files changed, 126 insertions(+), 25 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/packs/public.js b/app/javascript/flavours/glitch/packs/public.js
index 019de2167..5a15830df 100644
--- a/app/javascript/flavours/glitch/packs/public.js
+++ b/app/javascript/flavours/glitch/packs/public.js
@@ -114,6 +114,16 @@ function main() {
this.parentElement.parentElement.nextElementSibling.classList.toggle('hidden');
});
});
+
+ delegate(document, '.sidebar__toggle__icon', 'click', () => {
+ const target = document.querySelector('.sidebar ul');
+
+ if (target.style.display === 'block') {
+ target.style.display = 'none';
+ } else {
+ target.style.display = 'block';
+ }
+ });
}
loadPolyfills().then(main).catch(error => {
diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss
index bdd6686f6..1d25d0129 100644
--- a/app/javascript/flavours/glitch/styles/admin.scss
+++ b/app/javascript/flavours/glitch/styles/admin.scss
@@ -5,21 +5,66 @@ $content-width: 840px;
.admin-wrapper {
display: flex;
justify-content: center;
- height: 100%;
+ width: 100%;
+ min-height: 100vh;
.sidebar-wrapper {
- flex: 1 1 $sidebar-width;
- height: 100%;
- background: $ui-base-color;
- display: flex;
- justify-content: flex-end;
+ min-height: 100vh;
+ overflow: hidden;
+ pointer-events: none;
+ flex: 1 1 auto;
+
+ &__inner {
+ display: flex;
+ justify-content: flex-end;
+ background: $ui-base-color;
+ height: 100%;
+ }
}
.sidebar {
width: $sidebar-width;
- height: 100%;
padding: 0;
- overflow-y: auto;
+ pointer-events: auto;
+
+ &__toggle {
+ display: none;
+ background: lighten($ui-base-color, 8%);
+ height: 48px;
+
+ &__logo {
+ flex: 1 1 auto;
+
+ a {
+ display: inline-block;
+ padding: 15px;
+ }
+
+ svg {
+ fill: $primary-text-color;
+ height: 20px;
+ position: relative;
+ bottom: -2px;
+ }
+ }
+
+ &__icon {
+ display: block;
+ color: $darker-text-color;
+ text-decoration: none;
+ flex: 0 0 auto;
+ font-size: 20px;
+ padding: 15px;
+ }
+
+ a {
+ &:hover,
+ &:focus,
+ &:active {
+ background: lighten($ui-base-color, 12%);
+ }
+ }
+ }
.logo {
display: block;
@@ -52,6 +97,9 @@ $content-width: 840px;
transition: all 200ms linear;
transition-property: color, background-color;
border-radius: 4px 0 0 4px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
i.fa {
margin-right: 5px;
@@ -99,12 +147,30 @@ $content-width: 840px;
}
.content-wrapper {
- flex: 2 1 $content-width;
- overflow: auto;
+ box-sizing: border-box;
+ width: 100%;
+ max-width: $content-width;
+ flex: 1 1 auto;
+ }
+
+ @media screen and (max-width: $content-width + $sidebar-width) {
+ .sidebar-wrapper--empty {
+ display: none;
+ }
+
+ .sidebar-wrapper {
+ width: $sidebar-width;
+ flex: 0 0 auto;
+ }
+ }
+
+ @media screen and (max-width: $no-columns-breakpoint) {
+ .sidebar-wrapper {
+ width: 100%;
+ }
}
.content {
- max-width: $content-width;
padding: 20px 15px;
padding-top: 60px;
padding-left: 25px;
@@ -123,6 +189,12 @@ $content-width: 840px;
padding-bottom: 40px;
border-bottom: 1px solid lighten($ui-base-color, 8%);
margin-bottom: 40px;
+
+ @media screen and (max-width: $no-columns-breakpoint) {
+ border-bottom: 0;
+ padding-bottom: 0;
+ font-weight: 700;
+ }
}
h3 {
@@ -147,7 +219,7 @@ $content-width: 840px;
font-size: 16px;
color: $secondary-text-color;
line-height: 28px;
- font-weight: 400;
+ font-weight: 500;
}
.fields-group h6 {
@@ -176,7 +248,7 @@ $content-width: 840px;
& > p {
font-size: 14px;
- line-height: 18px;
+ line-height: 21px;
color: $secondary-text-color;
margin-bottom: 20px;
@@ -208,20 +280,42 @@ $content-width: 840px;
@media screen and (max-width: $no-columns-breakpoint) {
display: block;
- overflow-y: auto;
- -webkit-overflow-scrolling: touch;
- .sidebar-wrapper,
- .content-wrapper {
- flex: 0 0 auto;
- height: auto;
- overflow: initial;
+ .sidebar-wrapper {
+ min-height: 0;
}
.sidebar {
width: 100%;
padding: 0;
height: auto;
+
+ &__toggle {
+ display: flex;
+ }
+
+ & > ul {
+ display: none;
+ }
+
+ ul a,
+ ul ul a {
+ border-radius: 0;
+ border-bottom: 1px solid lighten($ui-base-color, 4%);
+ transition: none;
+
+ &:hover {
+ transition: none;
+ }
+ }
+
+ ul ul {
+ border-radius: 0;
+ }
+
+ ul .simple-navigation-active-leaf a {
+ border-bottom-color: $ui-highlight-color;
+ }
}
}
}
@@ -270,10 +364,10 @@ body,
.filter-subset {
flex: 0 0 auto;
- margin: 0 40px 10px 0;
+ margin: 0 40px 20px 0;
&:last-child {
- margin-bottom: 20px;
+ margin-bottom: 30px;
}
ul {
diff --git a/app/javascript/flavours/glitch/styles/basics.scss b/app/javascript/flavours/glitch/styles/basics.scss
index 4de3955a6..64e543b78 100644
--- a/app/javascript/flavours/glitch/styles/basics.scss
+++ b/app/javascript/flavours/glitch/styles/basics.scss
@@ -74,9 +74,6 @@ body {
&.admin {
background: darken($ui-base-color, 4%);
- position: fixed;
- width: 100%;
- height: 100%;
padding: 0;
}
--
cgit
From 2441d07cd5d62aeea7bfa76f5ea4294e863b4bf9 Mon Sep 17 00:00:00 2001
From: Jeong Arm
Date: Sun, 22 Sep 2019 19:58:29 +0900
Subject: [Glitch] Fix ugly TOC when title is too long
Port 26b810561a5b7cfd1766699358d998b5882a5876 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/styles/containers.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/styles/containers.scss b/app/javascript/flavours/glitch/styles/containers.scss
index b391c5c3b..6a48ff354 100644
--- a/app/javascript/flavours/glitch/styles/containers.scss
+++ b/app/javascript/flavours/glitch/styles/containers.scss
@@ -171,7 +171,7 @@
.grid-4 {
display: grid;
grid-gap: 10px;
- grid-template-columns: 1fr 1fr 1fr 1fr;
+ grid-template-columns: repeat(4, minmax(0, 1fr));
grid-auto-columns: 25%;
grid-auto-rows: max-content;
--
cgit
From e25b7feb72d0abc5e411fd32749c968041ade182 Mon Sep 17 00:00:00 2001
From: ThibG
Date: Sun, 22 Sep 2019 14:15:18 +0200
Subject: [Glitch] Show user what options they have voted
Port front-end changes from b359974d9b356bb723fe046466b178328cf9bbaf to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/actions/importer/normalizer.js | 3 ++-
app/javascript/flavours/glitch/components/poll.js | 7 ++++++-
app/javascript/flavours/glitch/styles/polls.scss | 10 ++++++++--
3 files changed, 16 insertions(+), 4 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/actions/importer/normalizer.js b/app/javascript/flavours/glitch/actions/importer/normalizer.js
index 52d85c059..b35c4d7bd 100644
--- a/app/javascript/flavours/glitch/actions/importer/normalizer.js
+++ b/app/javascript/flavours/glitch/actions/importer/normalizer.js
@@ -71,8 +71,9 @@ export function normalizePoll(poll) {
const emojiMap = makeEmojiMap(normalPoll);
- normalPoll.options = poll.options.map(option => ({
+ normalPoll.options = poll.options.map((option, index) => ({
...option,
+ voted: poll.own_votes && poll.own_votes.includes(index),
title_emojified: emojify(escapeTextContentForBrowser(option.title), emojiMap),
}));
diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js
index 905aa54c1..e6cc809e0 100644
--- a/app/javascript/flavours/glitch/components/poll.js
+++ b/app/javascript/flavours/glitch/components/poll.js
@@ -10,6 +10,7 @@ import spring from 'react-motion/lib/spring';
import escapeTextContentForBrowser from 'escape-html';
import emojify from 'flavours/glitch/util/emoji';
import RelativeTimestamp from './relative_timestamp';
+import Icon from 'flavours/glitch/components/icon';
const messages = defineMessages({
closed: { id: 'poll.closed', defaultMessage: 'Closed' },
@@ -103,6 +104,7 @@ class Poll extends ImmutablePureComponent {
const percent = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
const active = !!this.state.selected[`${optionIndex}`];
+ const voted = option.get('voted') || (poll.get('own_votes') && poll.get('own_votes').includes(optionIndex));
let titleEmojified = option.get('title_emojified');
if (!titleEmojified) {
@@ -131,7 +133,10 @@ class Poll extends ImmutablePureComponent {
/>
{!showResults && }
- {showResults && {Math.round(percent)}%}
+ {showResults &&
+ {!!voted && }
+ {Math.round(percent)}%
+ }
diff --git a/app/javascript/flavours/glitch/styles/polls.scss b/app/javascript/flavours/glitch/styles/polls.scss
index 06f60408d..d1f69cd69 100644
--- a/app/javascript/flavours/glitch/styles/polls.scss
+++ b/app/javascript/flavours/glitch/styles/polls.scss
@@ -102,13 +102,19 @@
&__number {
display: inline-block;
- width: 36px;
+ width: 48px;
font-weight: 700;
padding: 0 10px;
text-align: right;
margin-top: auto;
margin-bottom: auto;
- flex: 0 0 36px;
+ flex: 0 0 48px;
+ }
+
+ &__vote__mark {
+ float: left;
+ color: $valid-value-color;
+ line-height: 18px;
}
&__footer {
--
cgit
From 5c9ba9177a87d007135b63f79ded4329c49083e2 Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Mon, 23 Sep 2019 00:48:31 +0200
Subject: [Glitch] Revert "Change timelines to add new items to pending items
when scrolled down #11867"
Port 8c4b5f7cef60700af7ae64c7b524d899a1d033c5 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/reducers/notifications.js | 4 ++--
app/javascript/flavours/glitch/reducers/timelines.js | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js
index 8dc7a4aba..8d5c6785c 100644
--- a/app/javascript/flavours/glitch/reducers/notifications.js
+++ b/app/javascript/flavours/glitch/reducers/notifications.js
@@ -52,7 +52,7 @@ const notificationToMap = (state, notification) => ImmutableMap({
const normalizeNotification = (state, notification, usePendingItems) => {
const top = !shouldCountUnreadNotifications(state);
- if (usePendingItems || !top || !state.get('pendingItems').isEmpty()) {
+ if (usePendingItems || !state.get('pendingItems').isEmpty()) {
return state.update('pendingItems', list => list.unshift(notificationToMap(state, notification))).update('unread', unread => unread + 1);
}
@@ -82,7 +82,7 @@ const expandNormalizedNotifications = (state, notifications, next, isLoadingRece
return state.withMutations(mutable => {
if (!items.isEmpty()) {
- usePendingItems = isLoadingRecent && (usePendingItems || !mutable.get('top') || !mutable.get('pendingItems').isEmpty());
+ usePendingItems = isLoadingRecent && (usePendingItems || !mutable.get('pendingItems').isEmpty());
mutable.update(usePendingItems ? 'pendingItems' : 'items', list => {
const lastIndex = 1 + list.findLastIndex(
diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js
index e6bef18e9..df88a6c23 100644
--- a/app/javascript/flavours/glitch/reducers/timelines.js
+++ b/app/javascript/flavours/glitch/reducers/timelines.js
@@ -40,7 +40,8 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
if (timeline.endsWith(':pinned')) {
mMap.set('items', statuses.map(status => status.get('id')));
} else if (!statuses.isEmpty()) {
- usePendingItems = isLoadingRecent && (usePendingItems || !mMap.get('top') || !mMap.get('pendingItems').isEmpty());
+ usePendingItems = isLoadingRecent && (usePendingItems || !mMap.get('pendingItems').isEmpty());
+
mMap.update(usePendingItems ? 'pendingItems' : 'items', ImmutableList(), oldIds => {
const newIds = statuses.map(status => status.get('id'));
const lastIndex = oldIds.findLastIndex(id => id !== null && compareId(id, newIds.last()) >= 0) + 1;
@@ -62,7 +63,7 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
const updateTimeline = (state, timeline, status, usePendingItems) => {
const top = state.getIn([timeline, 'top']);
- if (usePendingItems || !top || !state.getIn([timeline, 'pendingItems']).isEmpty()) {
+ if (usePendingItems || !state.getIn([timeline, 'pendingItems']).isEmpty()) {
if (state.getIn([timeline, 'pendingItems'], ImmutableList()).includes(status.get('id')) || state.getIn([timeline, 'items'], ImmutableList()).includes(status.get('id'))) {
return state;
}
--
cgit
From 4b7c436ae9f2d8bcd274252a41c195f44da5ee26 Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Mon, 23 Sep 2019 00:48:43 +0200
Subject: [Glitch] Fix emoji search not showing custom emoji when none are
uncategorized
Port 0d2b60ab8b13a28e99a83e1104e7208de2025304 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/util/emoji/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/util/emoji/index.js b/app/javascript/flavours/glitch/util/emoji/index.js
index b2d13cc95..e1a244127 100644
--- a/app/javascript/flavours/glitch/util/emoji/index.js
+++ b/app/javascript/flavours/glitch/util/emoji/index.js
@@ -100,4 +100,4 @@ export const buildCustomEmojis = (customEmojis) => {
return emojis;
};
-export const categoriesFromEmojis = customEmojis => customEmojis.reduce((set, emoji) => set.add(emoji.get('category') ? `custom-${emoji.get('category')}` : 'custom'), new Set());
+export const categoriesFromEmojis = customEmojis => customEmojis.reduce((set, emoji) => set.add(emoji.get('category') ? `custom-${emoji.get('category')}` : 'custom'), new Set(['custom']));
--
cgit
From 74af56b9cd269ce431b9fbfa85901e5bfe773161 Mon Sep 17 00:00:00 2001
From: ThibG
Date: Fri, 27 Sep 2019 02:16:11 +0200
Subject: [Glitch] Use blob URL for Tesseract to avoid CORS issues
Port 7baedcb61e15200478f3ad6deb96d452cd63499a to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/actions/compose.js | 5 +++--
.../glitch/features/ui/components/focal_point_modal.js | 12 +++++++++++-
app/javascript/flavours/glitch/reducers/compose.js | 6 +++---
3 files changed, 17 insertions(+), 6 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js
index e1da03745..69cf65b5a 100644
--- a/app/javascript/flavours/glitch/actions/compose.js
+++ b/app/javascript/flavours/glitch/actions/compose.js
@@ -261,7 +261,7 @@ export function uploadCompose(files) {
progress[i] = loaded;
dispatch(uploadComposeProgress(progress.reduce((a, v) => a + v, 0), total));
},
- }).then(({ data }) => dispatch(uploadComposeSuccess(data)));
+ }).then(({ data }) => dispatch(uploadComposeSuccess(data, f)));
}).catch(error => dispatch(uploadComposeFail(error)));
};
};
@@ -316,10 +316,11 @@ export function uploadComposeProgress(loaded, total) {
};
};
-export function uploadComposeSuccess(media) {
+export function uploadComposeSuccess(media, file) {
return {
type: COMPOSE_UPLOAD_SUCCESS,
media: media,
+ file: file,
skipLoading: true,
};
};
diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js
index 8bded391a..d5c9e66ae 100644
--- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js
+++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js
@@ -173,7 +173,17 @@ class FocalPointModal extends ImmutablePureComponent {
langPath: `${assetHost}/ocr/lang-data`,
});
- worker.recognize(media.get('url'))
+ let media_url = media.get('file');
+
+ if (window.URL && URL.createObjectURL) {
+ try {
+ media_url = URL.createObjectURL(media.get('file'));
+ } catch (error) {
+ console.error(error);
+ }
+ }
+
+ worker.recognize(media_url)
.progress(({ progress }) => this.setState({ progress }))
.finally(() => worker.terminate())
.then(({ text }) => this.setState({ description: removeExtraLineBreaks(text), dirty: true, detecting: false }))
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js
index adad205c0..3699ec1ad 100644
--- a/app/javascript/flavours/glitch/reducers/compose.js
+++ b/app/javascript/flavours/glitch/reducers/compose.js
@@ -190,11 +190,11 @@ function continueThread (state, status) {
});
}
-function appendMedia(state, media) {
+function appendMedia(state, media, file) {
const prevSize = state.get('media_attachments').size;
return state.withMutations(map => {
- map.update('media_attachments', list => list.push(media));
+ map.update('media_attachments', list => list.push(media.set('file', file)));
map.set('is_uploading', false);
map.set('resetFileKey', Math.floor((Math.random() * 0x10000)));
map.set('idempotencyKey', uuid());
@@ -422,7 +422,7 @@ export default function compose(state = initialState, action) {
case COMPOSE_UPLOAD_REQUEST:
return state.set('is_uploading', true);
case COMPOSE_UPLOAD_SUCCESS:
- return appendMedia(state, fromJS(action.media));
+ return appendMedia(state, fromJS(action.media), action.file);
case COMPOSE_UPLOAD_FAIL:
return state.set('is_uploading', false);
case COMPOSE_UPLOAD_UNDO:
--
cgit
From 0349c4d1cfd26b5d4c70990c0a1b7ddb9d6b6d60 Mon Sep 17 00:00:00 2001
From: ThibG
Date: Fri, 27 Sep 2019 15:22:11 +0200
Subject: [Glitch] Avoid storing audio and video file data in memory
Port 860a77d45ee9d17117364868f0932b4fcbe07d3d to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/reducers/compose.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js
index 3699ec1ad..17ce5de3c 100644
--- a/app/javascript/flavours/glitch/reducers/compose.js
+++ b/app/javascript/flavours/glitch/reducers/compose.js
@@ -194,7 +194,10 @@ function appendMedia(state, media, file) {
const prevSize = state.get('media_attachments').size;
return state.withMutations(map => {
- map.update('media_attachments', list => list.push(media.set('file', file)));
+ if (media.get('type') === 'image') {
+ media = media.set('file', file);
+ }
+ map.update('media_attachments', list => list.push(media));
map.set('is_uploading', false);
map.set('resetFileKey', Math.floor((Math.random() * 0x10000)));
map.set('idempotencyKey', uuid());
--
cgit
From 8a63d659acea217abc3dbfc5b9b277ac77f648df Mon Sep 17 00:00:00 2001
From: ThibG
Date: Fri, 27 Sep 2019 21:13:51 +0200
Subject: [Glitch] Change silences to always require approval on follow
Port front-end changes from 18b451c0e6cf6a927a22084f94b423982de0ee8b to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/features/getting_started/index.js | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js
index 68b5209dc..a5095fbd9 100644
--- a/app/javascript/flavours/glitch/features/getting_started/index.js
+++ b/app/javascript/flavours/glitch/features/getting_started/index.js
@@ -104,16 +104,14 @@ const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2);
}
componentDidMount () {
- const { myAccount, fetchFollowRequests, multiColumn } = this.props;
+ const { fetchFollowRequests, multiColumn } = this.props;
if (!multiColumn && window.innerWidth >= NAVIGATION_PANEL_BREAKPOINT) {
this.context.router.history.replace('/timelines/home');
return;
}
- if (myAccount.get('locked')) {
- fetchFollowRequests();
- }
+ fetchFollowRequests();
}
render () {
@@ -148,7 +146,7 @@ const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2);
navItems.push();
}
- if (myAccount.get('locked')) {
+ if (myAccount.get('locked') || unreadFollowRequests > 0) {
navItems.push();
}
--
cgit
From 98cc81c0e28144eda90a2d18198e7708b5e3d4b7 Mon Sep 17 00:00:00 2001
From: ThibG
Date: Sat, 28 Sep 2019 19:41:36 +0200
Subject: [Glitch] Fix vote checkmark in poll results
Port b0cda7a504655f6ced33802af67cabb6f3e46e19 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/components/poll.js | 13 +++++++------
app/javascript/flavours/glitch/styles/polls.scss | 6 +++---
2 files changed, 10 insertions(+), 9 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js
index e6cc809e0..2128bff61 100644
--- a/app/javascript/flavours/glitch/components/poll.js
+++ b/app/javascript/flavours/glitch/components/poll.js
@@ -14,6 +14,7 @@ import Icon from 'flavours/glitch/components/icon';
const messages = defineMessages({
closed: { id: 'poll.closed', defaultMessage: 'Closed' },
+ voted: { id: 'poll.voted', defaultMessage: 'You voted for this answer', description: 'Tooltip of the "voted" checkmark in polls' },
});
const makeEmojiMap = record => record.get('emojis').reduce((obj, emoji) => {
@@ -100,11 +101,11 @@ class Poll extends ImmutablePureComponent {
};
renderOption (option, optionIndex, showResults) {
- const { poll, disabled } = this.props;
- const percent = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
- const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
- const active = !!this.state.selected[`${optionIndex}`];
- const voted = option.get('voted') || (poll.get('own_votes') && poll.get('own_votes').includes(optionIndex));
+ const { poll, disabled, intl } = this.props;
+ const percent = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
+ const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
+ const active = !!this.state.selected[`${optionIndex}`];
+ const voted = option.get('voted') || (poll.get('own_votes') && poll.get('own_votes').includes(optionIndex));
let titleEmojified = option.get('title_emojified');
if (!titleEmojified) {
@@ -134,7 +135,7 @@ class Poll extends ImmutablePureComponent {
{!showResults && }
{showResults &&
- {!!voted && }
+ {!!voted && }
{Math.round(percent)}%
}
diff --git a/app/javascript/flavours/glitch/styles/polls.scss b/app/javascript/flavours/glitch/styles/polls.scss
index d1f69cd69..95d8e510c 100644
--- a/app/javascript/flavours/glitch/styles/polls.scss
+++ b/app/javascript/flavours/glitch/styles/polls.scss
@@ -102,18 +102,18 @@
&__number {
display: inline-block;
- width: 48px;
+ width: 52px;
font-weight: 700;
padding: 0 10px;
+ padding-left: 8px;
text-align: right;
margin-top: auto;
margin-bottom: auto;
- flex: 0 0 48px;
+ flex: 0 0 52px;
}
&__vote__mark {
float: left;
- color: $valid-value-color;
line-height: 18px;
}
--
cgit
From 15973b77d6c7fc071e00c59713bff831ffb10bdb Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Sun, 29 Sep 2019 16:23:01 +0200
Subject: [Glitch] Fix public list of domain blocks being too verbose on about
page
Port SCSS from bd9685f7980838ecc675af20cf52ef1e686d98d6 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/styles/about.scss | 41 ++++++++++++++
app/javascript/flavours/glitch/styles/tables.scss | 67 -----------------------
2 files changed, 41 insertions(+), 67 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/styles/about.scss b/app/javascript/flavours/glitch/styles/about.scss
index 994e80280..7c129674d 100644
--- a/app/javascript/flavours/glitch/styles/about.scss
+++ b/app/javascript/flavours/glitch/styles/about.scss
@@ -136,6 +136,47 @@ $small-breakpoint: 960px;
}
}
+ table {
+ width: 100%;
+ border-collapse: collapse;
+ break-inside: auto;
+ margin-top: 24px;
+ margin-bottom: 32px;
+
+ thead tr,
+ tbody tr {
+ break-after: auto;
+ break-inside: avoid;
+ border-bottom: 1px solid lighten($ui-base-color, 4%);
+ font-size: 1em;
+ line-height: 1.625;
+ font-weight: 400;
+ text-align: left;
+ color: $darker-text-color;
+ }
+
+ thead tr {
+ border-bottom-width: 2px;
+ line-height: 1.5;
+ font-weight: 500;
+ color: $dark-text-color;
+ }
+
+ th,
+ td {
+ padding: 8px;
+ align-self: start;
+ align-items: start;
+
+ &.nowrap {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 25%;
+ }
+ }
+ }
+
& > :first-child {
margin-top: 0;
}
diff --git a/app/javascript/flavours/glitch/styles/tables.scss b/app/javascript/flavours/glitch/styles/tables.scss
index 669f72787..b84f6a708 100644
--- a/app/javascript/flavours/glitch/styles/tables.scss
+++ b/app/javascript/flavours/glitch/styles/tables.scss
@@ -288,70 +288,3 @@ a.table-action-link {
}
}
}
-
-.blocks-table {
- width: 100%;
- max-width: 100%;
- border-spacing: 0;
- border-collapse: collapse;
- table-layout: fixed;
- border: 1px solid darken($ui-base-color, 8%);
-
- thead {
- border: 1px solid darken($ui-base-color, 8%);
- background: darken($ui-base-color, 4%);
- font-weight: 500;
-
- th.severity-column {
- width: 120px;
- }
-
- th.button-column {
- width: 23px;
- }
- }
-
- tbody > tr {
- border: 1px solid darken($ui-base-color, 8%);
- border-bottom: 0;
- background: darken($ui-base-color, 4%);
-
- &:hover {
- background: darken($ui-base-color, 2%);
- }
-
- &.even {
- background: $ui-base-color;
-
- &:hover {
- background: lighten($ui-base-color, 2%);
- }
- }
-
- &.rationale {
- background: lighten($ui-base-color, 4%);
- border-top: 0;
-
- &:hover {
- background: lighten($ui-base-color, 6%);
- }
-
- &.hidden {
- display: none;
- }
- }
-
- td:first-child {
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
-
- th,
- td {
- padding: 8px;
- line-height: 18px;
- vertical-align: top;
- text-align: left;
- }
-}
--
cgit
From a2bf1f9f5698f5fb06267d9708e2d356a2a7786f Mon Sep 17 00:00:00 2001
From: Eugen Rochko
Date: Sun, 29 Sep 2019 16:27:00 +0200
Subject: [Glitch] Fix follower/following lists resetting on back-navigation in
web UI
Port 9683e1dcf8bbddb07b818960abf254248be3575c to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/features/favourites/index.js | 4 +++-
app/javascript/flavours/glitch/features/followers/index.js | 6 ++++--
app/javascript/flavours/glitch/features/following/index.js | 6 ++++--
app/javascript/flavours/glitch/features/reblogs/index.js | 4 +++-
4 files changed, 14 insertions(+), 6 deletions(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/features/favourites/index.js b/app/javascript/flavours/glitch/features/favourites/index.js
index 5c33c8677..7afadf12e 100644
--- a/app/javascript/flavours/glitch/features/favourites/index.js
+++ b/app/javascript/flavours/glitch/features/favourites/index.js
@@ -31,7 +31,9 @@ class Favourites extends ImmutablePureComponent {
};
componentWillMount () {
- this.props.dispatch(fetchFavourites(this.props.params.statusId));
+ if (!this.props.accountIds) {
+ this.props.dispatch(fetchFavourites(this.props.params.statusId));
+ }
}
componentWillReceiveProps (nextProps) {
diff --git a/app/javascript/flavours/glitch/features/followers/index.js b/app/javascript/flavours/glitch/features/followers/index.js
index b12efa774..2bd0e6e2f 100644
--- a/app/javascript/flavours/glitch/features/followers/index.js
+++ b/app/javascript/flavours/glitch/features/followers/index.js
@@ -36,8 +36,10 @@ class Followers extends ImmutablePureComponent {
};
componentWillMount () {
- this.props.dispatch(fetchAccount(this.props.params.accountId));
- this.props.dispatch(fetchFollowers(this.props.params.accountId));
+ if (!this.props.accountIds) {
+ this.props.dispatch(fetchAccount(this.props.params.accountId));
+ this.props.dispatch(fetchFollowers(this.props.params.accountId));
+ }
}
componentWillReceiveProps (nextProps) {
diff --git a/app/javascript/flavours/glitch/features/following/index.js b/app/javascript/flavours/glitch/features/following/index.js
index 9ea008e61..f03da0c94 100644
--- a/app/javascript/flavours/glitch/features/following/index.js
+++ b/app/javascript/flavours/glitch/features/following/index.js
@@ -36,8 +36,10 @@ class Following extends ImmutablePureComponent {
};
componentWillMount () {
- this.props.dispatch(fetchAccount(this.props.params.accountId));
- this.props.dispatch(fetchFollowing(this.props.params.accountId));
+ if (!this.props.accountIds) {
+ this.props.dispatch(fetchAccount(this.props.params.accountId));
+ this.props.dispatch(fetchFollowing(this.props.params.accountId));
+ }
}
componentWillReceiveProps (nextProps) {
diff --git a/app/javascript/flavours/glitch/features/reblogs/index.js b/app/javascript/flavours/glitch/features/reblogs/index.js
index 1fc26b0d7..a8e9db7f5 100644
--- a/app/javascript/flavours/glitch/features/reblogs/index.js
+++ b/app/javascript/flavours/glitch/features/reblogs/index.js
@@ -31,7 +31,9 @@ class Reblogs extends ImmutablePureComponent {
};
componentWillMount () {
- this.props.dispatch(fetchReblogs(this.props.params.statusId));
+ if (!this.props.accountIds) {
+ this.props.dispatch(fetchReblogs(this.props.params.statusId));
+ }
}
componentWillReceiveProps(nextProps) {
--
cgit
From ec244f6c883181275329bc8a5dda526cc9e90628 Mon Sep 17 00:00:00 2001
From: trwnh
Date: Sun, 29 Sep 2019 09:54:24 -0500
Subject: [Glitch] Fix muted text color not applying to all text
Port d51201a75ac47ac90615ee8987534c5772274779 to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/styles/components/status.scss | 1 +
1 file changed, 1 insertion(+)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss
index 24ab71969..ae89ac0a8 100644
--- a/app/javascript/flavours/glitch/styles/components/status.scss
+++ b/app/javascript/flavours/glitch/styles/components/status.scss
@@ -673,6 +673,7 @@ a.status__display-name,
}
.muted {
+ .status__content,
.status__content p,
.status__content a,
.status__content__text {
--
cgit
From 332be562eab78975fdbf1e928cddbe7528d93468 Mon Sep 17 00:00:00 2001
From: ThibG
Date: Sun, 29 Sep 2019 21:23:40 +0200
Subject: [Glitch] Change vote results to display ex-aequo leading options as
leading
Port 15b3eeb326d7e6a026235ece25c3be75250de92f to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/components/poll.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js
index 2128bff61..b431d2d8d 100644
--- a/app/javascript/flavours/glitch/components/poll.js
+++ b/app/javascript/flavours/glitch/components/poll.js
@@ -103,7 +103,7 @@ class Poll extends ImmutablePureComponent {
renderOption (option, optionIndex, showResults) {
const { poll, disabled, intl } = this.props;
const percent = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
- const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
+ const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') >= other.get('votes_count'));
const active = !!this.state.selected[`${optionIndex}`];
const voted = option.get('voted') || (poll.get('own_votes') && poll.get('own_votes').includes(optionIndex));
--
cgit
From 88481c965334e28615b353253380255973f4aaa5 Mon Sep 17 00:00:00 2001
From: ThibG
Date: Sun, 29 Sep 2019 21:46:05 +0200
Subject: [Glitch] Add explanation to mute dialog, refactor and clean up
mute/block UI
Port 9027bfff0c25a6da1bcef7ce880e5d8211062d1d to glitch-soc
Signed-off-by: Thibaut Girka
---
app/javascript/flavours/glitch/actions/blocks.js | 14 +++
.../flavours/glitch/containers/status_container.js | 16 +---
.../containers/header_container.js | 15 +--
.../status/containers/detailed_status_container.js | 18 +---
.../flavours/glitch/features/status/index.js | 20 +---
.../glitch/features/ui/components/block_modal.js | 103 +++++++++++++++++++++
.../glitch/features/ui/components/modal_root.js | 2 +
.../glitch/features/ui/components/mute_modal.js | 15 +--
app/javascript/flavours/glitch/reducers/blocks.js | 22 +++++
app/javascript/flavours/glitch/reducers/index.js | 2 +
app/javascript/flavours/glitch/reducers/mutes.js | 2 -
.../flavours/glitch/styles/components/modal.scss | 73 ++++++++++-----
.../glitch/styles/mastodon-light/diff.scss | 2 +
.../flavours/glitch/util/async-components.js | 4 +
14 files changed, 221 insertions(+), 87 deletions(-)
create mode 100644 app/javascript/flavours/glitch/features/ui/components/block_modal.js
create mode 100644 app/javascript/flavours/glitch/reducers/blocks.js
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/actions/blocks.js b/app/javascript/flavours/glitch/actions/blocks.js
index 498ce519f..adae9d83c 100644
--- a/app/javascript/flavours/glitch/actions/blocks.js
+++ b/app/javascript/flavours/glitch/actions/blocks.js
@@ -1,6 +1,7 @@
import api, { getLinks } from 'flavours/glitch/util/api';
import { fetchRelationships } from './accounts';
import { importFetchedAccounts } from './importer';
+import { openModal } from './modal';
export const BLOCKS_FETCH_REQUEST = 'BLOCKS_FETCH_REQUEST';
export const BLOCKS_FETCH_SUCCESS = 'BLOCKS_FETCH_SUCCESS';
@@ -10,6 +11,8 @@ export const BLOCKS_EXPAND_REQUEST = 'BLOCKS_EXPAND_REQUEST';
export const BLOCKS_EXPAND_SUCCESS = 'BLOCKS_EXPAND_SUCCESS';
export const BLOCKS_EXPAND_FAIL = 'BLOCKS_EXPAND_FAIL';
+export const BLOCKS_INIT_MODAL = 'BLOCKS_INIT_MODAL';
+
export function fetchBlocks() {
return (dispatch, getState) => {
dispatch(fetchBlocksRequest());
@@ -83,3 +86,14 @@ export function expandBlocksFail(error) {
error,
};
};
+
+export function initBlockModal(account) {
+ return dispatch => {
+ dispatch({
+ type: BLOCKS_INIT_MODAL,
+ account,
+ });
+
+ dispatch(openModal('BLOCK'));
+ };
+}
diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js
index 15eb4f85f..647ddf276 100644
--- a/app/javascript/flavours/glitch/containers/status_container.js
+++ b/app/javascript/flavours/glitch/containers/status_container.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import Status from 'flavours/glitch/components/status';
import { List as ImmutableList } from 'immutable';
@@ -18,9 +17,9 @@ import {
pin,
unpin,
} from 'flavours/glitch/actions/interactions';
-import { blockAccount } from 'flavours/glitch/actions/accounts';
import { muteStatus, unmuteStatus, deleteStatus } from 'flavours/glitch/actions/statuses';
import { initMuteModal } from 'flavours/glitch/actions/mutes';
+import { initBlockModal } from 'flavours/glitch/actions/blocks';
import { initReport } from 'flavours/glitch/actions/reports';
import { openModal } from 'flavours/glitch/actions/modal';
import { changeLocalSetting } from 'flavours/glitch/actions/local_settings';
@@ -37,10 +36,8 @@ const messages = defineMessages({
deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },
redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' },
redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it.' },
- blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
- blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },
unfilterConfirm: { id: 'confirmations.unfilter.confirm', defaultMessage: 'Show' },
author: { id: 'confirmations.unfilter.author', defaultMessage: 'Author' },
matchingFilters: { id: 'confirmations.unfilter.filters', defaultMessage: 'Matching {count, plural, one {filter} other {filters}}' },
@@ -186,16 +183,7 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
onBlock (status) {
const account = status.get('account');
- dispatch(openModal('CONFIRM', {
- message: @{account.get('acct')} }} />,
- confirm: intl.formatMessage(messages.blockConfirm),
- onConfirm: () => dispatch(blockAccount(account.get('id'))),
- secondary: intl.formatMessage(messages.blockAndReport),
- onSecondary: () => {
- dispatch(blockAccount(account.get('id')));
- dispatch(initReport(account, status));
- },
- }));
+ dispatch(initBlockModal(account));
},
onUnfilter (status, onConfirm) {
diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
index 787a36658..fff5e097f 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
+++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js
@@ -5,7 +5,6 @@ import Header from '../components/header';
import {
followAccount,
unfollowAccount,
- blockAccount,
unblockAccount,
unmuteAccount,
pinAccount,
@@ -16,6 +15,7 @@ import {
directCompose
} from 'flavours/glitch/actions/compose';
import { initMuteModal } from 'flavours/glitch/actions/mutes';
+import { initBlockModal } from 'flavours/glitch/actions/blocks';
import { initReport } from 'flavours/glitch/actions/reports';
import { openModal } from 'flavours/glitch/actions/modal';
import { blockDomain, unblockDomain } from 'flavours/glitch/actions/domain_blocks';
@@ -25,9 +25,7 @@ import { List as ImmutableList } from 'immutable';
const messages = defineMessages({
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
- blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
- blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },
});
const makeMapStateToProps = () => {
@@ -64,16 +62,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
if (account.getIn(['relationship', 'blocking'])) {
dispatch(unblockAccount(account.get('id')));
} else {
- dispatch(openModal('CONFIRM', {
- message: @{account.get('acct')} }} />,
- confirm: intl.formatMessage(messages.blockConfirm),
- onConfirm: () => dispatch(blockAccount(account.get('id'))),
- secondary: intl.formatMessage(messages.blockAndReport),
- onSecondary: () => {
- dispatch(blockAccount(account.get('id')));
- dispatch(initReport(account));
- },
- }));
+ dispatch(initBlockModal(account));
}
},
diff --git a/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js b/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js
index e6c390537..e71803328 100644
--- a/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js
+++ b/app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js
@@ -1,4 +1,3 @@
-import React from 'react';
import { connect } from 'react-redux';
import DetailedStatus from '../components/detailed_status';
import { makeGetStatus } from 'flavours/glitch/selectors';
@@ -15,7 +14,6 @@ import {
pin,
unpin,
} from 'flavours/glitch/actions/interactions';
-import { blockAccount } from 'flavours/glitch/actions/accounts';
import {
muteStatus,
unmuteStatus,
@@ -24,9 +22,10 @@ import {
revealStatus,
} from 'flavours/glitch/actions/statuses';
import { initMuteModal } from 'flavours/glitch/actions/mutes';
+import { initBlockModal } from 'flavours/glitch/actions/blocks';
import { initReport } from 'flavours/glitch/actions/reports';
import { openModal } from 'flavours/glitch/actions/modal';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { defineMessages, injectIntl } from 'react-intl';
import { boostModal, deleteModal } from 'flavours/glitch/util/initial_state';
import { showAlertForError } from 'flavours/glitch/actions/alerts';
@@ -35,10 +34,8 @@ const messages = defineMessages({
deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },
redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' },
redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.' },
- blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
- blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },
});
const makeMapStateToProps = () => {
@@ -139,16 +136,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
onBlock (status) {
const account = status.get('account');
- dispatch(openModal('CONFIRM', {
- message: @{account.get('acct')} }} />,
- confirm: intl.formatMessage(messages.blockConfirm),
- onConfirm: () => dispatch(blockAccount(account.get('id'))),
- secondary: intl.formatMessage(messages.blockAndReport),
- onSecondary: () => {
- dispatch(blockAccount(account.get('id')));
- dispatch(initReport(account, status));
- },
- }));
+ dispatch(initBlockModal(account));
},
onReport (status) {
diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js
index e91ab5f3a..dd17823ad 100644
--- a/app/javascript/flavours/glitch/features/status/index.js
+++ b/app/javascript/flavours/glitch/features/status/index.js
@@ -26,9 +26,9 @@ import {
directCompose,
} from 'flavours/glitch/actions/compose';
import { changeLocalSetting } from 'flavours/glitch/actions/local_settings';
-import { blockAccount } from 'flavours/glitch/actions/accounts';
import { muteStatus, unmuteStatus, deleteStatus } from 'flavours/glitch/actions/statuses';
import { initMuteModal } from 'flavours/glitch/actions/mutes';
+import { initBlockModal } from 'flavours/glitch/actions/blocks';
import { initReport } from 'flavours/glitch/actions/reports';
import { makeGetStatus } from 'flavours/glitch/selectors';
import { ScrollContainer } from 'react-router-scroll-4';
@@ -36,7 +36,7 @@ import ColumnBackButton from 'flavours/glitch/components/column_back_button';
import ColumnHeader from '../../components/column_header';
import StatusContainer from 'flavours/glitch/containers/status_container';
import { openModal } from 'flavours/glitch/actions/modal';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { HotKeys } from 'react-hotkeys';
import { boostModal, favouriteModal, deleteModal } from 'flavours/glitch/util/initial_state';
@@ -50,13 +50,11 @@ const messages = defineMessages({
deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },
redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' },
redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it.' },
- blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },
revealAll: { id: 'status.show_more_all', defaultMessage: 'Show more for all' },
hideAll: { id: 'status.show_less_all', defaultMessage: 'Show less for all' },
detailedStatus: { id: 'status.detailed_status', defaultMessage: 'Detailed conversation view' },
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
- blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },
tootHeading: { id: 'column.toot', defaultMessage: 'Toots and replies' },
});
@@ -339,19 +337,9 @@ class Status extends ImmutablePureComponent {
}
handleBlockClick = (status) => {
- const { dispatch, intl } = this.props;
+ const { dispatch } = this.props;
const account = status.get('account');
-
- dispatch(openModal('CONFIRM', {
- message: @{account.get('acct')} }} />,
- confirm: intl.formatMessage(messages.blockConfirm),
- onConfirm: () => dispatch(blockAccount(account.get('id'))),
- secondary: intl.formatMessage(messages.blockAndReport),
- onSecondary: () => {
- dispatch(blockAccount(account.get('id')));
- dispatch(initReport(account, status));
- },
- }));
+ dispatch(initBlockModal(account));
}
handleReport = (status) => {
diff --git a/app/javascript/flavours/glitch/features/ui/components/block_modal.js b/app/javascript/flavours/glitch/features/ui/components/block_modal.js
new file mode 100644
index 000000000..a07baeaa6
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/ui/components/block_modal.js
@@ -0,0 +1,103 @@
+import React from 'react';
+import { connect } from 'react-redux';
+import PropTypes from 'prop-types';
+import { injectIntl, FormattedMessage } from 'react-intl';
+import { makeGetAccount } from '../../../selectors';
+import Button from '../../../components/button';
+import { closeModal } from '../../../actions/modal';
+import { blockAccount } from '../../../actions/accounts';
+import { initReport } from '../../../actions/reports';
+
+
+const makeMapStateToProps = () => {
+ const getAccount = makeGetAccount();
+
+ const mapStateToProps = state => ({
+ account: getAccount(state, state.getIn(['blocks', 'new', 'account_id'])),
+ });
+
+ return mapStateToProps;
+};
+
+const mapDispatchToProps = dispatch => {
+ return {
+ onConfirm(account) {
+ dispatch(blockAccount(account.get('id')));
+ },
+
+ onBlockAndReport(account) {
+ dispatch(blockAccount(account.get('id')));
+ dispatch(initReport(account));
+ },
+
+ onClose() {
+ dispatch(closeModal());
+ },
+ };
+};
+
+export default @connect(makeMapStateToProps, mapDispatchToProps)
+@injectIntl
+class BlockModal extends React.PureComponent {
+
+ static propTypes = {
+ account: PropTypes.object.isRequired,
+ onClose: PropTypes.func.isRequired,
+ onBlockAndReport: PropTypes.func.isRequired,
+ onConfirm: PropTypes.func.isRequired,
+ intl: PropTypes.object.isRequired,
+ };
+
+ componentDidMount() {
+ this.button.focus();
+ }
+
+ handleClick = () => {
+ this.props.onClose();
+ this.props.onConfirm(this.props.account);
+ }
+
+ handleSecondary = () => {
+ this.props.onClose();
+ this.props.onBlockAndReport(this.props.account);
+ }
+
+ handleCancel = () => {
+ this.props.onClose();
+ }
+
+ setRef = (c) => {
+ this.button = c;
+ }
+
+ render () {
+ const { account } = this.props;
+
+ return (
+
+
+
+ @{account.get('acct')} }}
+ />
+
+
+
+
+
+
+
+
+
+ );
+ }
+
+}
diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_root.js b/app/javascript/flavours/glitch/features/ui/components/modal_root.js
index 303e05db6..0941ce9c8 100644
--- a/app/javascript/flavours/glitch/features/ui/components/modal_root.js
+++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.js
@@ -15,6 +15,7 @@ import FocalPointModal from './focal_point_modal';
import {
OnboardingModal,
MuteModal,
+ BlockModal,
ReportModal,
SettingsModal,
EmbedModal,
@@ -32,6 +33,7 @@ const MODAL_COMPONENTS = {
'DOODLE': () => Promise.resolve({ default: DoodleModal }),
'CONFIRM': () => Promise.resolve({ default: ConfirmationModal }),
'MUTE': MuteModal,
+ 'BLOCK': BlockModal,
'REPORT': ReportModal,
'SETTINGS': SettingsModal,
'ACTIONS': () => Promise.resolve({ default: ActionsModal }),
diff --git a/app/javascript/flavours/glitch/features/ui/components/mute_modal.js b/app/javascript/flavours/glitch/features/ui/components/mute_modal.js
index 3492eca69..dec6413c3 100644
--- a/app/javascript/flavours/glitch/features/ui/components/mute_modal.js
+++ b/app/javascript/flavours/glitch/features/ui/components/mute_modal.js
@@ -11,7 +11,6 @@ import { toggleHideNotifications } from 'flavours/glitch/actions/mutes';
const mapStateToProps = state => {
return {
- isSubmitting: state.getIn(['reports', 'new', 'isSubmitting']),
account: state.getIn(['mutes', 'new', 'account']),
notifications: state.getIn(['mutes', 'new', 'notifications']),
};
@@ -38,7 +37,6 @@ export default @connect(mapStateToProps, mapDispatchToProps)
class MuteModal extends React.PureComponent {
static propTypes = {
- isSubmitting: PropTypes.bool.isRequired,
account: PropTypes.object.isRequired,
notifications: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
@@ -81,11 +79,16 @@ class MuteModal extends React.PureComponent {
values={{ name: @{account.get('acct')} }}
/>
-
diff --git a/app/javascript/flavours/glitch/reducers/blocks.js b/app/javascript/flavours/glitch/reducers/blocks.js
new file mode 100644
index 000000000..1b6507163
--- /dev/null
+++ b/app/javascript/flavours/glitch/reducers/blocks.js
@@ -0,0 +1,22 @@
+import Immutable from 'immutable';
+
+import {
+ BLOCKS_INIT_MODAL,
+} from '../actions/blocks';
+
+const initialState = Immutable.Map({
+ new: Immutable.Map({
+ account_id: null,
+ }),
+});
+
+export default function mutes(state = initialState, action) {
+ switch (action.type) {
+ case BLOCKS_INIT_MODAL:
+ return state.withMutations((state) => {
+ state.setIn(['new', 'account_id'], action.account.get('id'));
+ });
+ default:
+ return state;
+ }
+}
diff --git a/app/javascript/flavours/glitch/reducers/index.js b/app/javascript/flavours/glitch/reducers/index.js
index b03590194..7dbca3a29 100644
--- a/app/javascript/flavours/glitch/reducers/index.js
+++ b/app/javascript/flavours/glitch/reducers/index.js
@@ -16,6 +16,7 @@ import local_settings from './local_settings';
import push_notifications from './push_notifications';
import status_lists from './status_lists';
import mutes from './mutes';
+import blocks from './blocks';
import reports from './reports';
import contexts from './contexts';
import compose from './compose';
@@ -53,6 +54,7 @@ const reducers = {
local_settings,
push_notifications,
mutes,
+ blocks,
reports,
contexts,
compose,
diff --git a/app/javascript/flavours/glitch/reducers/mutes.js b/app/javascript/flavours/glitch/reducers/mutes.js
index 8f52a7704..7111bb710 100644
--- a/app/javascript/flavours/glitch/reducers/mutes.js
+++ b/app/javascript/flavours/glitch/reducers/mutes.js
@@ -7,7 +7,6 @@ import {
const initialState = Immutable.Map({
new: Immutable.Map({
- isSubmitting: false,
account: null,
notifications: true,
}),
@@ -17,7 +16,6 @@ export default function mutes(state = initialState, action) {
switch (action.type) {
case MUTES_INIT_MODAL:
return state.withMutations((state) => {
- state.setIn(['new', 'isSubmitting'], false);
state.setIn(['new', 'account'], action.account);
state.setIn(['new', 'notifications'], true);
});
diff --git a/app/javascript/flavours/glitch/styles/components/modal.scss b/app/javascript/flavours/glitch/styles/components/modal.scss
index ec32c9114..4f3e5babf 100644
--- a/app/javascript/flavours/glitch/styles/components/modal.scss
+++ b/app/javascript/flavours/glitch/styles/components/modal.scss
@@ -405,7 +405,8 @@
.confirmation-modal,
.report-modal,
.actions-modal,
-.mute-modal {
+.mute-modal,
+.block-modal {
background: lighten($ui-secondary-color, 8%);
color: $inverted-text-color;
border-radius: 8px;
@@ -465,7 +466,8 @@
.boost-modal__action-bar,
.favourite-modal__action-bar,
.confirmation-modal__action-bar,
-.mute-modal__action-bar {
+.mute-modal__action-bar,
+.block-modal__action-bar {
display: flex;
justify-content: space-between;
background: $ui-secondary-color;
@@ -495,11 +497,13 @@
font-size: 14px;
}
-.mute-modal {
+.mute-modal,
+.block-modal {
line-height: 24px;
}
-.mute-modal .react-toggle {
+.mute-modal .react-toggle,
+.block-modal .react-toggle {
vertical-align: middle;
}
@@ -712,27 +716,29 @@
}
.confirmation-modal__action-bar,
-.mute-modal__action-bar {
- .confirmation-modal__secondary-button,
- .confirmation-modal__cancel-button,
- .mute-modal__cancel-button {
- background-color: transparent;
- color: $lighter-text-color;
- font-size: 14px;
- font-weight: 500;
-
- &:hover,
- &:focus,
- &:active {
- color: darken($lighter-text-color, 4%);
- }
- }
-
+.mute-modal__action-bar,
+.block-modal__action-bar {
.confirmation-modal__secondary-button {
flex-shrink: 1;
}
}
+.confirmation-modal__secondary-button,
+.confirmation-modal__cancel-button,
+.mute-modal__cancel-button,
+.block-modal__cancel-button {
+ background-color: transparent;
+ color: $lighter-text-color;
+ font-size: 14px;
+ font-weight: 500;
+
+ &:hover,
+ &:focus,
+ &:active {
+ color: darken($lighter-text-color, 4%);
+ }
+}
+
.confirmation-modal__do_not_ask_again {
padding-left: 20px;
padding-right: 20px;
@@ -747,10 +753,10 @@
.confirmation-modal__container,
.mute-modal__container,
+.block-modal__container,
.report-modal__target {
padding: 30px;
font-size: 16px;
- text-align: center;
strong {
font-weight: 500;
@@ -763,6 +769,31 @@
}
}
+.confirmation-modal__container,
+.report-modal__target {
+ text-align: center;
+}
+
+.block-modal,
+.mute-modal {
+ &__explanation {
+ margin-top: 20px;
+ }
+
+ .setting-toggle {
+ margin-top: 20px;
+ margin-bottom: 24px;
+ display: flex;
+ align-items: center;
+
+ &__label {
+ color: $inverted-text-color;
+ margin: 0;
+ margin-left: 8px;
+ }
+ }
+}
+
.report-modal__target {
padding: 15px;
diff --git a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss
index 4c2b76a21..5c7fa87da 100644
--- a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss
+++ b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss
@@ -226,6 +226,7 @@
.boost-modal,
.confirmation-modal,
.mute-modal,
+.block-modal,
.report-modal,
.embed-modal,
.error-modal,
@@ -236,6 +237,7 @@
.boost-modal__action-bar,
.confirmation-modal__action-bar,
.mute-modal__action-bar,
+.block-modal__action-bar,
.onboarding-modal__paginator,
.error-modal__footer {
background: darken($ui-base-color, 6%);
diff --git a/app/javascript/flavours/glitch/util/async-components.js b/app/javascript/flavours/glitch/util/async-components.js
index 6c0acdb27..26255bbb7 100644
--- a/app/javascript/flavours/glitch/util/async-components.js
+++ b/app/javascript/flavours/glitch/util/async-components.js
@@ -122,6 +122,10 @@ export function MuteModal () {
return import(/* webpackChunkName: "flavours/glitch/async/mute_modal" */'flavours/glitch/features/ui/components/mute_modal');
}
+export function BlockModal () {
+ return import(/* webpackChunkName: "flavours/glitch/async/block_modal" */'flavours/glitch/features/ui/components/block_modal');
+}
+
export function ReportModal () {
return import(/* webpackChunkName: "flavours/glitch/async/report_modal" */'flavours/glitch/features/ui/components/report_modal');
}
--
cgit
From 1bfa9149ee64f86ca62031ed4d84b70f2a9e86e8 Mon Sep 17 00:00:00 2001
From: koyu
Date: Sun, 29 Sep 2019 22:20:56 +0200
Subject: [Glitch] Change at icon in notification filter to reply-all
Port cfe2d1cc4a3c531741fd769241593ebbe03b6711 to glitch-soc
Signed-off-by: Thibaut Girka
---
.../flavours/glitch/features/notifications/components/filter_bar.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'app/javascript/flavours')
diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js
index 356ca4721..6118305d6 100644
--- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js
+++ b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js
@@ -64,7 +64,7 @@ class FilterBar extends React.PureComponent {
onClick={this.onClick('mention')}
title={intl.formatMessage(tooltips.mentions)}
>
-
+