From 49520d6e627e49a1f9f1b8cfa9b323450307fcc6 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 24 Aug 2016 17:56:44 +0200 Subject: Adding React.js, Redux, revamping dashboard --- app/views/home/index.html.haml | 11 +--------- app/views/layouts/application.html.haml | 2 +- app/views/layouts/dashboard.html.haml | 39 --------------------------------- 3 files changed, 2 insertions(+), 50 deletions(-) delete mode 100644 app/views/layouts/dashboard.html.haml (limited to 'app/views') diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index a663bf37b..941397384 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,10 +1 @@ -= simple_form_for Status.new, url: statuses_path, method: :post do |f| - = f.input :text, required: true, autofocus: true, label: false, placeholder: 'What are you up to?' - - .form-actions - = f.button :submit, 'Post update' - -- content_for :raw_content do - .activity-stream.activity-stream-embedded - - @timeline.each do |status| - = render partial: 'stream_entries/status', locals: { status: status } += react_component 'Root', { timelines: { home: render(file: 'api/statuses/home', locals: { statuses: @home }, formats: :json), mentions: render(file: 'api/statuses/mentions', locals: { statuses: @mentions }, formats: :json) }}, class: 'app-holder', prerender: false diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index afd29b04a..1746d9964 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,5 +9,5 @@ = javascript_include_tag 'application' = csrf_meta_tags = yield :header_tags - %body + %body{ class: @body_classes } = content_for?(:content) ? yield(:content) : yield diff --git a/app/views/layouts/dashboard.html.haml b/app/views/layouts/dashboard.html.haml deleted file mode 100644 index 7336cdcc4..000000000 --- a/app/views/layouts/dashboard.html.haml +++ /dev/null @@ -1,39 +0,0 @@ -- content_for :content do - .dashboard-wrapper - .dashboard__sidebar - .dashboard__top-bar.alternate -   - .dashboard__current-user - = link_to account_path(current_user.account) do - = image_tag current_user.account.avatar.url(:medium), class: 'dashboard__current-user__avatar' - %strong.dashboard__current-user__display-name= display_name(current_user.account) - %span.dashboard__current-user__username= "@#{current_user.account.username}" - %ul - %li{ class: active_nav_class(root_path) } - = link_to root_path do - = fa_icon 'home' - Home - %li{ class: active_nav_class(oauth_authorized_applications_path) } - = link_to oauth_authorized_applications_path do - = fa_icon 'shield' - Authorized apps - %li{ class: active_nav_class(settings_path) } - = link_to settings_path do - = fa_icon 'user' - Edit profile - - .dashboard__content - .dashboard__top-bar - = content_for?(:page_title) ? yield(:page_title) : 'Mastodon' - %ul - %li= link_to fa_icon('gear'), edit_registration_path(current_user), title: 'Change password' - %li= link_to fa_icon('sign-out'), destroy_user_session_path, method: :delete, title: 'Sign out' - - .dashboard__content__content= yield - - = yield(:raw_content) - - .footer - .domain= Rails.configuration.x.local_domain - -= render template: "layouts/application" -- cgit