From 616b6867a0ef4ebfc1a6e6f0bd776c7a253f11f5 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 2 Jan 2018 13:07:56 +0900 Subject: [PATCH] Show mastodon on modal (#6129) --- .../authorize_follows_controller.rb | 5 +++++ app/controllers/remote_follow_controller.rb | 4 ++++ app/controllers/shares_controller.rb | 2 +- .../{mastodon-drawer.png => mastodon-ui.png} | Bin .../images/wave-compose-standalone.png | Bin 0 -> 5921 bytes app/javascript/images/wave-modal.png | Bin 0 -> 5200 bytes app/javascript/styles/application.scss | 1 + .../styles/mastodon/components.scss | 2 +- app/javascript/styles/mastodon/modal.scss | 20 ++++++++++++++++++ app/views/layouts/modal.html.haml | 2 ++ 10 files changed, 34 insertions(+), 2 deletions(-) rename app/javascript/images/{mastodon-drawer.png => mastodon-ui.png} (100%) create mode 100644 app/javascript/images/wave-compose-standalone.png create mode 100644 app/javascript/images/wave-modal.png create mode 100644 app/javascript/styles/mastodon/modal.scss diff --git a/app/controllers/authorize_follows_controller.rb b/app/controllers/authorize_follows_controller.rb index 78b5641836..7afe664d1b 100644 --- a/app/controllers/authorize_follows_controller.rb +++ b/app/controllers/authorize_follows_controller.rb @@ -4,6 +4,7 @@ class AuthorizeFollowsController < ApplicationController layout 'modal' before_action :authenticate_user! + before_action :set_body_classes def show @account = located_account || render(:error) @@ -58,4 +59,8 @@ class AuthorizeFollowsController < ApplicationController def acct_params params.fetch(:acct, '') end + + def set_body_classes + @body_classes = 'modal-layout' + end end diff --git a/app/controllers/remote_follow_controller.rb b/app/controllers/remote_follow_controller.rb index 48b026aa5a..3b988e08d8 100644 --- a/app/controllers/remote_follow_controller.rb +++ b/app/controllers/remote_follow_controller.rb @@ -38,4 +38,8 @@ class RemoteFollowController < ApplicationController def suspended_account? @account.suspended? end + + def set_body_classes + @body_classes = 'modal-layout' + end end diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb index 994742c3df..fc2469deaa 100644 --- a/app/controllers/shares_controller.rb +++ b/app/controllers/shares_controller.rb @@ -25,6 +25,6 @@ class SharesController < ApplicationController end def set_body_classes - @body_classes = 'compose-standalone' + @body_classes = 'modal-layout compose-standalone' end end diff --git a/app/javascript/images/mastodon-drawer.png b/app/javascript/images/mastodon-ui.png similarity index 100% rename from app/javascript/images/mastodon-drawer.png rename to app/javascript/images/mastodon-ui.png diff --git a/app/javascript/images/wave-compose-standalone.png b/app/javascript/images/wave-compose-standalone.png new file mode 100644 index 0000000000000000000000000000000000000000..287ee639b3426947ff629f9b8d183d38d0f767cf GIT binary patch literal 5921 zcmV++7vAWJP)EX>4Tx07!|ImUmPXSsKM(Rp&%%Xfiah$vGp?EXLrxe*|WFK_v&}P^Ui(m)%&9^03-)i za&jUp1V9oujpyrZM-L7OrQ@Ce67q-u9MEL3Q3mz zB+Q9QWg|A;2uE^K*+~eWMOcHK%u7R<<8*%wq9k03b#neR>8v2Js>0BCN;d#BmWmg|Ia{mc>DM0b#AAq|FGEWDr)1 z{1=~?fAfs|=E-8keB-sVd==h5Dm5*NuK$02j{mKs#PmPcSpDkcC~kls@)kf!2Ka+0 zkP6a}kq(fh)1tD{RwvqTPTs>}-;JEv?ysKOApnGE09?P$PUmH;^;WM7U;q&a0#P6d;wg%2n4*SC!;TSjt z&W7{hy>JCw2cLjD;4APgcns#lFW^NKK#@>1lmbc{Wrngxd7(m4(I_5jJE{;>j;ceo zqPkK2s5>Y=Y993gjYU(@bhI|w677NxK(o;)=nxirdsz0W?7SRJjwu%}S0;B!Zcd&mZ!I4uUnYN9 z{yANYZc9(3SJ3>SGXkoO>wYXY!S`*r2ZCmXO?H27x9h#1ZPM%Ju z&P!co-B8{Ay8XIe^o;cq^^WU3)ECir)6diI)_-lFVZb)1GPr9!z#}tyosIR(xx^b%gbg)_fZU8$Fpm_V!QC3ld$!)gVYPUn%Be(bNP}-5dV>;J4w{a(NXTr{3^7Qgb z^WN?X+SQ#eo1dFM^_}x~Ed>Gvyn>0{mb+`dM}Hsp{m>r6J%{&vDdZ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&#fy2ur4@?QbObjD-8x zp!Ja`J`Za(f2WdZtkFV5Hd@SHr+Y9G9B@J2L(;jdW3SoYP9-<+S}p4upMd-7Pk6u? zAuahdH(EDF4X?sxw3y>s#a@HfT_PFUme7S+$6b*2rjkz@qs2%*7=euz3cgnHF`p10 z8#?Ynus7X$Waw`ZBDZp7(F#5`T8Im+EW)kn<8*5Vo`&|Z=7RQdeWdh*)6mfPq(KXt zhK7a~HVq984J~XM8X6i}*fcaWG_L literal 0 HcmV?d00001 diff --git a/app/javascript/images/wave-modal.png b/app/javascript/images/wave-modal.png new file mode 100644 index 0000000000000000000000000000000000000000..88818a6d78a30e2827d4e86db12f2b0d3d8f24fe GIT binary patch literal 5200 zcmV-W6tC-vP)EX>4Tx07!|ImUmPXSsKM(Rp&%%Xfiah$vGp?EXLrxe*|WFK_v&}P^Ui(m)%&9^03-)i za&jUp1V9oujpyrZM-L7OrQ@Ce67q-u9MEL3Q3mz zB+Q9QWg|A;2uE^K*+~eWMOcHK%u7R<<8*%wq9k03b#neR>8v2Js>0BCN;d#BmWmg|Ia{mc>DM0b#AAq|FGEWDr)1 z{1=~?fAfs|=E-8keB-sVd==h5Dm5*NuK$02j{mKs#PmPcSpDkcC~kls@)kf!2Ka+0 zkP6a}kq(fh)1tD{RwvqTPTs>}-;JEv?ysKOApnGE09?P$PUmH;^;WM7U;q&a0#P6d;wg%2n4*SC!;TSjt z&W7{hy>JCw2cLjD;4APgcns#lFW^NKK#@>1lmbc{Wrngxd7(m4(I_5jJE{;>j;ceo zqPkK2s5>Y=Y993gjYU(@bhI|w677NxK(o;)=nxirdsz0W?7SRJjwu%}S0;B!Zcd&mZ!I4uUnYN9 z{yANYZc9(3SJ3>SGXkoO>wYXY!S`*r2ZCmXO?H27x9h#1ZPM%Ju z&P!co-B8{Ay8XIe^o;cq^^WU3)ECir)6diI)_-lFVZb)1GPr9!z#}tyosIR(xx^b%gbg)_fZU8$Fpm_V!QC3ld$!)gVYPUn%Be(bNP}-5dV>;J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;%031F)CH zyGQ)`e7RsDGl7&;8=cYPEmr&CUBK!Ayln!qU83F^>K=WELMTTX?&ZKSrOk_SR#=)* z+GPN8EpScwX;xT+j6k2E6F5)){Vw1RDK)3y`z7e8#OLeY?Z5)1&0(d@&eCCrl%01- zMsXU0z3lx)N>8^%X>)k6p^Vbz5+KtU@m0N-gZI`=r_yFyA@BCL3CL^k-tuja9%P{V zbl|P`%miLg+Wbpt)2FmK8E?($b}2nO8cS+lBJKc|NQ53sptZj!#TQ6~OM&rn*4bBb zMwx1y_^R3zyyfXfOW*R4K6@?ROV%BY^>x+B=v<(ukaxE`$y7QewfwNgf-DBTc&|jV zts)%ioQJpT|er%n+zQ+&SgJMj=-MXW>crr<*w(@KTn+X=DwGYd`VZ(<@s$ND;4 zUk`0HeLoEGzOyzwUDHw*~sKquy8ZdGAAF)KN1dH(Uo+umAaD7GM(O9uwF zbhAFD6$SYJP}W(qKK9iETC--&3ecK0D?n@3tXTnCvt|Wo&6+hUKx@{l0IgZGW(8=? zniZfmYu2m)ty!}Iv}Vnk6`(b1R)E&5S+fGPX3YxFnl)>K*?$12?(={*Bz+hF0000< KMNUMnLSTZg*XzIl literal 0 HcmV?d00001 diff --git a/app/javascript/styles/application.scss b/app/javascript/styles/application.scss index 44aa105645..fd6665f65c 100644 --- a/app/javascript/styles/application.scss +++ b/app/javascript/styles/application.scss @@ -6,6 +6,7 @@ @import 'mastodon/reset'; @import 'mastodon/basics'; +@import 'mastodon/modal'; @import 'mastodon/containers'; @import 'mastodon/lists'; @import 'mastodon/footer'; diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 3240b38a42..bc193a15ad 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1773,7 +1773,7 @@ } > .mastodon { - background: url('../images/mastodon-drawer.png') no-repeat left bottom / contain; + background: url('../images/mastodon-ui.png') no-repeat left bottom / contain; flex: 1; } } diff --git a/app/javascript/styles/mastodon/modal.scss b/app/javascript/styles/mastodon/modal.scss new file mode 100644 index 0000000000..310dcb9249 --- /dev/null +++ b/app/javascript/styles/mastodon/modal.scss @@ -0,0 +1,20 @@ +.modal-layout { + background: $ui-base-color url('../images/wave-modal.png') repeat-x bottom fixed; + display: flex; + flex-direction: column; + height: 100vh; + padding: 0; +} + +.modal-layout__mastodon { + display: flex; + flex: 1; + flex-direction: column; + justify-content: flex-end; + + > * { + flex: 1; + max-height: 235px; + background: url('../images/mastodon-ui.png') no-repeat left bottom / contain; + } +} diff --git a/app/views/layouts/modal.html.haml b/app/views/layouts/modal.html.haml index a819e098d6..d01b6b6c56 100644 --- a/app/views/layouts/modal.html.haml +++ b/app/views/layouts/modal.html.haml @@ -12,5 +12,7 @@ = fa_icon 'sign-out' .container= yield + .modal-layout__mastodon + %div = render template: 'layouts/application'