diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2018-01-02 13:07:56 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-01-02 05:07:56 +0100 |
commit | 2c1ed5f8720dfdba9cf7582d097f4702e19eeeb6 (patch) | |
tree | 180b9f6a82552028677213e9c0502d04514fe0bf | |
parent | 7d376e41be626eec6e8ccafaab452381c7acd8d6 (diff) |
Show mastodon on modal (#6129)
-rw-r--r-- | app/controllers/authorize_follows_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/remote_follow_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/shares_controller.rb | 2 | ||||
-rw-r--r-- | app/javascript/images/mastodon-ui.png (renamed from app/javascript/images/mastodon-drawer.png) | bin | 32449 -> 32449 bytes | |||
-rw-r--r-- | app/javascript/images/wave-compose-standalone.png | bin | 0 -> 5921 bytes | |||
-rw-r--r-- | app/javascript/images/wave-modal.png | bin | 0 -> 5200 bytes | |||
-rw-r--r-- | app/javascript/styles/application.scss | 1 | ||||
-rw-r--r-- | app/javascript/styles/mastodon/components.scss | 2 | ||||
-rw-r--r-- | app/javascript/styles/mastodon/modal.scss | 20 | ||||
-rw-r--r-- | app/views/layouts/modal.html.haml | 2 |
10 files changed, 34 insertions, 2 deletions
diff --git a/app/controllers/authorize_follows_controller.rb b/app/controllers/authorize_follows_controller.rb index 78b564183..7afe664d1 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 48b026aa5..3b988e08d 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 994742c3d..fc2469dea 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 index a1fb642a0..a1fb642a0 100644 --- a/app/javascript/images/mastodon-drawer.png +++ b/app/javascript/images/mastodon-ui.png Binary files differdiff --git a/app/javascript/images/wave-compose-standalone.png b/app/javascript/images/wave-compose-standalone.png new file mode 100644 index 000000000..287ee639b --- /dev/null +++ b/app/javascript/images/wave-compose-standalone.png Binary files differdiff --git a/app/javascript/images/wave-modal.png b/app/javascript/images/wave-modal.png new file mode 100644 index 000000000..88818a6d7 --- /dev/null +++ b/app/javascript/images/wave-modal.png Binary files differdiff --git a/app/javascript/styles/application.scss b/app/javascript/styles/application.scss index 44aa10564..fd6665f65 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 3240b38a4..bc193a15a 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 000000000..310dcb924 --- /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 a819e098d..d01b6b6c5 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' |