From 2a074227acf79bd9dee8676baac7c833f515ca75 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 25 Apr 2020 18:10:48 +0200 Subject: [PATCH] Clean up inbox layouts --- app/views/inbox/show.html.haml | 31 +++++++++---------------------- app/views/layouts/inbox.haml | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 app/views/layouts/inbox.haml diff --git a/app/views/inbox/show.html.haml b/app/views/inbox/show.html.haml index 778e0a43..be2abe85 100644 --- a/app/views/inbox/show.html.haml +++ b/app/views/inbox/show.html.haml @@ -1,25 +1,12 @@ -- provide(:title, generate_title("Inbox")) -.container.j2-page - .row - .col-md-3.col-xs-12.col-sm-4.d-none.d-sm-block - = render 'inbox/sidebar' - .col-md-9.col-xs-12.col-sm-8 - = render 'layouts/messages' - #entries - - @inbox.each do |i| - = render 'inbox/entry', i: i +#entries + - @inbox.each do |i| + = render 'inbox/entry', i: i - - if @inbox.empty? - = t 'views.inbox.empty' + - if @inbox.empty? + = t 'views.inbox.empty' - = render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @inbox_last_id + = render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @inbox_last_id - - if @more_data_available - %button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @inbox_last_id }} - = t 'views.actions.load' - - .col-md-9.col-xs-12.col-sm-8.d-block.d-sm-none - = render 'inbox/sidebar' - -= render "shared/links" -- Inbox.where(id: @inbox.ids).update_all(new: false) + - if @more_data_available + %button#load-more-btn.btn.btn-default{type: :button, data: { last_id: @inbox_last_id }} + = t 'views.actions.load' diff --git a/app/views/layouts/inbox.haml b/app/views/layouts/inbox.haml new file mode 100644 index 00000000..80848805 --- /dev/null +++ b/app/views/layouts/inbox.haml @@ -0,0 +1,16 @@ +.container.j2-page + .row + .col-md-3.col-xs-12.col-sm-4.d-none.d-sm-block + = render 'inbox/sidebar' + .col-md-9.col-xs-12.col-sm-8 + = render 'layouts/messages' + = yield + + .col-md-9.col-xs-12.col-sm-8.d-block.d-sm-none + = render 'inbox/sidebar' + += render "shared/links" + +- Inbox.where(id: @inbox.ids).update_all(new: false) +- provide(:title, generate_title("Inbox")) +- parent_layout "base" \ No newline at end of file