From 0944952e9da748446b06c1b3f695a0bf91784789 Mon Sep 17 00:00:00 2001 From: Shyukri Shyukriev Date: Wed, 29 Jun 2016 14:20:41 +0200 Subject: [PATCH] Add default buttons on top if the items are > 5 on tracks, event_types, lodgings, rooms. This should prevent scrolling down to find the button. --- app/views/admin/event_types/index.html.haml | 6 +++++- app/views/admin/lodgings/index.html.haml | 6 ++++-- app/views/admin/rooms/index.html.haml | 4 ++++ app/views/admin/tracks/index.html.haml | 6 ++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/views/admin/event_types/index.html.haml b/app/views/admin/event_types/index.html.haml index 3187282f..177b62c9 100644 --- a/app/views/admin/event_types/index.html.haml +++ b/app/views/admin/event_types/index.html.haml @@ -4,6 +4,11 @@ %h1 Event Types %p.text-muted The character of events in your conference + +- if @conference.program.event_types.size > 5 + .row + .col-md-12.text-right + = link_to 'Add Event Type', new_admin_conference_program_event_type_path(@conference.short_title), class: 'btn btn-primary' .row .col-md-12 %table.table.table-hover#event_types @@ -39,4 +44,3 @@ .row .col-md-12.text-right = link_to 'Add Event Type', new_admin_conference_program_event_type_path(@conference.short_title), class: 'btn btn-primary' - diff --git a/app/views/admin/lodgings/index.html.haml b/app/views/admin/lodgings/index.html.haml index 1f3a89fb..b5192c35 100644 --- a/app/views/admin/lodgings/index.html.haml +++ b/app/views/admin/lodgings/index.html.haml @@ -5,6 +5,10 @@ %p.text-muted Recommended some Hotels, Motels, Hostels or Campsites around your venue +- if @conference.lodgings.size > 5 + .row + .col-md-12.text-right + = link_to 'Add Lodging', new_admin_conference_lodging_path(@conference.short_title), class: 'btn btn-primary' - @conference.lodgings.each_slice(3) do |slice| .row - slice.each do |lodging| @@ -28,8 +32,6 @@ = link_to 'Edit', edit_admin_conference_lodging_path(@conference.short_title, lodging), class: 'btn btn-primary' = link_to 'Delete', admin_conference_lodging_path(@conference.short_title, lodging), method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the lodging #{lodging.name}?" } - - .row .col-md-12.text-right = link_to 'Add Lodging', new_admin_conference_lodging_path(@conference.short_title), class: 'btn btn-primary' diff --git a/app/views/admin/rooms/index.html.haml b/app/views/admin/rooms/index.html.haml index 8bf682c8..12832db9 100644 --- a/app/views/admin/rooms/index.html.haml +++ b/app/views/admin/rooms/index.html.haml @@ -6,6 +6,10 @@ The rooms of your conference venue - if @rooms.any? + - if @rooms.size > 5 + .row + .col-md-12.text-right + = link_to 'Add Room', new_admin_conference_venue_room_path(@conference.short_title), class: 'btn btn-primary' .row .col-md-12 %table.table.table-hover#rooms diff --git a/app/views/admin/tracks/index.html.haml b/app/views/admin/tracks/index.html.haml index f2de8a38..3d1a559e 100644 --- a/app/views/admin/tracks/index.html.haml +++ b/app/views/admin/tracks/index.html.haml @@ -4,6 +4,12 @@ %h1 Tracks %p.text-muted Categorize events in your conference + +- if @tracks.size > 5 + .row + .col-md-12.text-right + = link_to 'New Track', new_admin_conference_program_track_path(@conference.short_title), class: 'btn btn-success' + .row .col-md-12 %table.table.table-hover#tracks