diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index a5e7f8bd..633cf2e5 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -228,6 +228,7 @@ linters: - "app/views/schedules/_schedule.html.haml" - "app/views/schedules/_schedule_item.html.haml" - "app/views/schedules/_schedule_tabs.html.haml" + - "app/views/schedules/_qr_code_modal.html.haml" - "app/views/schedules/events.html.haml" - "app/views/schedules/show.html.haml" - "app/views/schedules/show.xml.haml" @@ -310,6 +311,7 @@ linters: # Offense count: 1074 LineLength: + max: 150 exclude: - "app/views/admin/booths/_change_state_dropdown.html.haml" - "app/views/admin/booths/index.html.haml" diff --git a/Gemfile b/Gemfile index ab6192c1..43fcbbd0 100644 --- a/Gemfile +++ b/Gemfile @@ -135,6 +135,8 @@ gem 'country_select' # as PDF generator gem 'prawn-qrcode' gem 'prawn-rails' + +# for QR code generation gem 'rqrcode' # to render XLS spreadsheets diff --git a/app/controllers/schedules_controller.rb b/app/controllers/schedules_controller.rb index 453e38c9..677feff0 100644 --- a/app/controllers/schedules_controller.rb +++ b/app/controllers/schedules_controller.rb @@ -44,6 +44,9 @@ class SchedulesController < ApplicationController end @selected_schedules_ids.compact! @event_schedules_by_room_id = event_schedules.select { |s| @selected_schedules_ids.include?(s.schedule_id) }.group_by(&:room_id) + @qr_code = RQRCode::QRCode.new(conference_schedule_url).as_svg(offset: 20, color: '000', + shape_rendering: 'crispEdges', + module_size: 11) end end end diff --git a/app/views/schedules/_qr_code_modal.html.haml b/app/views/schedules/_qr_code_modal.html.haml new file mode 100644 index 00000000..fbafb0d6 --- /dev/null +++ b/app/views/schedules/_qr_code_modal.html.haml @@ -0,0 +1,27 @@ +/ Button trigger modal +%button.btn.btn-link.btn-lg.pull-right{ 'data-target': '#schedule-modal', + 'data-toggle': 'modal', + type: 'button' } + Get the mobile app! +/ Modal +.modal.fade#schedule-modal{ 'aria-labelledby': 'schedule-modal-label', role: 'dialog', tabindex: '-1' } + .modal-dialog{ role: 'document' } + .modal-content + .modal-header + %button.close{ 'aria-label': 'Close', 'data-dismiss': 'modal', type: 'button' } + %span{ 'aria-hidden': 'true' } + %h4.modal-title#schedule-modal-label + Get the schedule on your mobile with Giggity! + .modal-body.center-block.text-center + = link_to 'https://f-droid.org/packages/net.gaast.giggity' do + %img.img-responsive{ alt: 'Get it on F-Droid', src: 'https://fdroid.gitlab.io/artwork/badge/get-it-on.png' } + %p + \...and point your phone at the QR code... + .img-responsive + = raw qr_code + .modal-footer + %p.small.text-muted.pull-left + Not free of surveilance capitalism yet? Try the + = link_to 'https://play.google.com/store/apps/details?id=net.gaast.giggity' do + google play store... + %button.btn.btn-default{ 'data-dismiss': 'modal', type: 'button' } Close diff --git a/app/views/schedules/show.html.haml b/app/views/schedules/show.html.haml index bd0f9976..a8f15af4 100644 --- a/app/views/schedules/show.html.haml +++ b/app/views/schedules/show.html.haml @@ -26,6 +26,7 @@ .visible-md-inline.visible-lg-inline = render partial: 'carousel', locals: { date: date, hrs_per_slide: 3 } + = render partial: 'qr_code_modal', locals: { qr_code: @qr_code } :javascript // change of active tab and the button title when a date is clicked