From 540c982771ea96c4f17e563179139e976519c3ea Mon Sep 17 00:00:00 2001 From: shlok007 Date: Thu, 13 Jul 2017 04:02:13 +0530 Subject: [PATCH 1/9] mention organization in dashboard, splashpage and admin/conference#edit --- app/views/admin/conferences/edit.html.haml | 1 + app/views/admin/conferences/show.html.haml | 2 +- app/views/conferences/show.html.haml | 3 +++ spec/features/conference_spec.rb | 9 +++++++++ spec/features/splashpage_spec.rb | 11 +++++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/views/admin/conferences/edit.html.haml b/app/views/admin/conferences/edit.html.haml index 2d5df126..49d65235 100644 --- a/app/views/admin/conferences/edit.html.haml +++ b/app/views/admin/conferences/edit.html.haml @@ -9,6 +9,7 @@ = semantic_form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f| = f.input :title, hint: "The full title of the conference, e.g. 'openSUSE Conference 2014'" = f.input :short_title, hint: "A short title, e.g. 'oSC14', to be used in URLs" + = f.input :organization, hint: 'The organization in which this conference belongs', input_html: { disabled: true } = f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } } = f.input :color, hint: 'The color will be used eg for the dashboard.', input_html: {size: 6, type: 'color'} = f.label 'Conference Logo' diff --git a/app/views/admin/conferences/show.html.haml b/app/views/admin/conferences/show.html.haml index cddae4c2..f270867b 100644 --- a/app/views/admin/conferences/show.html.haml +++ b/app/views/admin/conferences/show.html.haml @@ -1,6 +1,6 @@ %h1 %span.fa.fa-tachometer - Dashboard for #{@conference.title} + Dashboard for #{@conference.title} ( by #{@conference.organization.name} ) %hr .row .col-sm-4.col-xs-4 diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index fb488e22..b133c26a 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -22,6 +22,9 @@ .col-md-8 %h1 = @conference.title + %h3 + %i + = "( by #{@conference.organization.name} )" %p.lead - if @conference.venue = "#{@conference.venue.city} / #{@conference.venue.country_name}" diff --git a/spec/features/conference_spec.rb b/spec/features/conference_spec.rb index d17ce5fc..5b9f9c54 100644 --- a/spec/features/conference_spec.rb +++ b/spec/features/conference_spec.rb @@ -71,6 +71,15 @@ feature Conference do end describe 'admin' do + let!(:conference) { create(:conference) } + + scenario 'has organization name in edit form', feature: true, js: true do + sign_in user + visit edit_admin_conference_path(conference.short_title) + org_id = find('#conference_organization_id').value + expect(Organization.find(org_id)).to eq conference.organization + end + it_behaves_like 'add and update conference' end end diff --git a/spec/features/splashpage_spec.rb b/spec/features/splashpage_spec.rb index e913d023..ee9b63d5 100644 --- a/spec/features/splashpage_spec.rb +++ b/spec/features/splashpage_spec.rb @@ -61,4 +61,15 @@ feature Splashpage do expect(current_path).to eq(root_path) end end + + context 'public splashpage already created' do + let!(:splashpage) { create(:splashpage, conference: conference, public: true)} + + scenario 'should have organization name', feature: true, js: true do + sign_in participant + visit conference_path(conference.short_title) + + expect(page).to have_text(conference.organization.name) + end + end end From cdc08052b140fc1bca6bb8847f40a4e61a1e169f Mon Sep 17 00:00:00 2001 From: shlok007 Date: Mon, 24 Jul 2017 13:46:09 +0530 Subject: [PATCH 2/9] display organization name in menu bar --- app/views/admin/conferences/edit.html.haml | 1 - app/views/conferences/show.html.haml | 3 --- app/views/layouts/_navigation.html.haml | 5 ++++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/admin/conferences/edit.html.haml b/app/views/admin/conferences/edit.html.haml index 49d65235..2d5df126 100644 --- a/app/views/admin/conferences/edit.html.haml +++ b/app/views/admin/conferences/edit.html.haml @@ -9,7 +9,6 @@ = semantic_form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f| = f.input :title, hint: "The full title of the conference, e.g. 'openSUSE Conference 2014'" = f.input :short_title, hint: "A short title, e.g. 'oSC14', to be used in URLs" - = f.input :organization, hint: 'The organization in which this conference belongs', input_html: { disabled: true } = f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } } = f.input :color, hint: 'The color will be used eg for the dashboard.', input_html: {size: 6, type: 'color'} = f.label 'Conference Logo' diff --git a/app/views/conferences/show.html.haml b/app/views/conferences/show.html.haml index b133c26a..fb488e22 100644 --- a/app/views/conferences/show.html.haml +++ b/app/views/conferences/show.html.haml @@ -22,9 +22,6 @@ .col-md-8 %h1 = @conference.title - %h3 - %i - = "( by #{@conference.organization.name} )" %p.lead - if @conference.venue = "#{@conference.venue.city} / #{@conference.venue.country_name}" diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 6683ea23..92be2e89 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -7,7 +7,10 @@ %span.icon-bar %span.icon-bar %span.icon-bar - = link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager' + - if @conference.nil? || @conference.new_record? + = link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager' + - else + = link_to (ENV['OSEM_NAME'] || "#{@conference.organization.name} Organization"), organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager' .collapse.navbar-collapse - if content_for :splash_nav %ul.nav.navbar-nav#splash-nav From 17eacaec0dcf154f8d4a11af6b83d0d3bcfbb68e Mon Sep 17 00:00:00 2001 From: shlok007 Date: Tue, 25 Jul 2017 08:16:44 +0530 Subject: [PATCH 3/9] add tests for organization name in conference views remove tests for organization name in conference#edit --- app/views/admin/conferences/show.html.haml | 2 +- app/views/layouts/_navigation.html.haml | 4 ++-- app/views/layouts/application.html.haml | 2 +- spec/features/conference_spec.rb | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/admin/conferences/show.html.haml b/app/views/admin/conferences/show.html.haml index f270867b..cddae4c2 100644 --- a/app/views/admin/conferences/show.html.haml +++ b/app/views/admin/conferences/show.html.haml @@ -1,6 +1,6 @@ %h1 %span.fa.fa-tachometer - Dashboard for #{@conference.title} ( by #{@conference.organization.name} ) + Dashboard for #{@conference.title} %hr .row .col-sm-4.col-xs-4 diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 92be2e89..dbbfdbc0 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -7,10 +7,10 @@ %span.icon-bar %span.icon-bar %span.icon-bar - - if @conference.nil? || @conference.new_record? + - if conference.nil? || conference.new_record? = link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager' - else - = link_to (ENV['OSEM_NAME'] || "#{@conference.organization.name} Organization"), organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager' + = link_to (ENV['OSEM_NAME'] || "#{conference.organization.name} Organization"), organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager' .collapse.navbar-collapse - if content_for :splash_nav %ul.nav.navbar-nav#splash-nav diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 09be2523..c1a6ce78 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -21,7 +21,7 @@ = yield(:head) %body - = render 'layouts/navigation' + = render 'layouts/navigation', conference: @conference -# Admin area - if controller.class.name.split("::").first=="Admin" = render 'layouts/admin' diff --git a/spec/features/conference_spec.rb b/spec/features/conference_spec.rb index 5b9f9c54..5ac9f29b 100644 --- a/spec/features/conference_spec.rb +++ b/spec/features/conference_spec.rb @@ -73,11 +73,11 @@ feature Conference do describe 'admin' do let!(:conference) { create(:conference) } - scenario 'has organization name in edit form', feature: true, js: true do + scenario 'has organization name in menu bar for conference views', feature: true, js: true do sign_in user - visit edit_admin_conference_path(conference.short_title) - org_id = find('#conference_organization_id').value - expect(Organization.find(org_id)).to eq conference.organization + visit admin_conference_path(conference.short_title) + + expect(find('.navbar-brand').text).to eq "#{conference.organization.name} Organization" end it_behaves_like 'add and update conference' From 28b55a9d72e8c3b4de5e1271ed4082d31e97fe0a Mon Sep 17 00:00:00 2001 From: shlok007 Date: Wed, 2 Aug 2017 15:00:08 +0530 Subject: [PATCH 4/9] remove OSEM_NAME from navigation --- app/views/layouts/_navigation.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index dbbfdbc0..193e6b76 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -10,7 +10,7 @@ - if conference.nil? || conference.new_record? = link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager' - else - = link_to (ENV['OSEM_NAME'] || "#{conference.organization.name} Organization"), organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager' + = link_to "#{conference.organization.name} Organization", organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager' .collapse.navbar-collapse - if content_for :splash_nav %ul.nav.navbar-nav#splash-nav From 83abc9f71f1f857ceab691dfea6b2664baaea847 Mon Sep 17 00:00:00 2001 From: shlok007 Date: Wed, 9 Aug 2017 23:34:58 +0530 Subject: [PATCH 5/9] remove Organization suffix from navbar-brand in navigation --- app/views/layouts/_navigation.html.haml | 2 +- spec/features/conference_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 193e6b76..9750be92 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -10,7 +10,7 @@ - if conference.nil? || conference.new_record? = link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager' - else - = link_to "#{conference.organization.name} Organization", organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager' + = link_to conference.organization.name, organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager' .collapse.navbar-collapse - if content_for :splash_nav %ul.nav.navbar-nav#splash-nav diff --git a/spec/features/conference_spec.rb b/spec/features/conference_spec.rb index 5ac9f29b..f3205e07 100644 --- a/spec/features/conference_spec.rb +++ b/spec/features/conference_spec.rb @@ -77,7 +77,7 @@ feature Conference do sign_in user visit admin_conference_path(conference.short_title) - expect(find('.navbar-brand').text).to eq "#{conference.organization.name} Organization" + expect(find('.navbar-brand').text).to eq(conference.organization.name) end it_behaves_like 'add and update conference' From f31651ad9c0ce80a3fe41013d01773c9c7cb0307 Mon Sep 17 00:00:00 2001 From: siddhantbajaj Date: Mon, 7 Aug 2017 15:10:06 +0530 Subject: [PATCH 6/9] Added registration-ticket Added registration type tickets that will used in the check-in process --- app/controllers/admin/tickets_controller.rb | 2 +- app/views/admin/tickets/_form.html.haml | 1 + app/views/admin/tickets/index.html.haml | 3 +++ .../20170807092805_add_registration_ticket_to_tickets.rb | 5 +++++ db/schema.rb | 3 ++- 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20170807092805_add_registration_ticket_to_tickets.rb diff --git a/app/controllers/admin/tickets_controller.rb b/app/controllers/admin/tickets_controller.rb index c7161409..cf6e0f80 100644 --- a/app/controllers/admin/tickets_controller.rb +++ b/app/controllers/admin/tickets_controller.rb @@ -50,7 +50,7 @@ module Admin private def ticket_params - params.require(:ticket).permit(:conference, :title, :url, :description, :conference_id, :price_cents, :price_currency, :price) + params.require(:ticket).permit(:conference, :title, :url, :description, :conference_id, :price_cents, :price_currency, :price, :registration_ticket) end end end diff --git a/app/views/admin/tickets/_form.html.haml b/app/views/admin/tickets/_form.html.haml index 94a54692..11aff78d 100644 --- a/app/views/admin/tickets/_form.html.haml +++ b/app/views/admin/tickets/_form.html.haml @@ -13,5 +13,6 @@ = f.input :description, input_html: { rows: 5, data: { provide: "markdown-editable" } } = f.input :price = f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY'], include_blank: false + = f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.' %p.text-right = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/admin/tickets/index.html.haml b/app/views/admin/tickets/index.html.haml index bb2804bf..b8cdb505 100644 --- a/app/views/admin/tickets/index.html.haml +++ b/app/views/admin/tickets/index.html.haml @@ -14,6 +14,7 @@ %th Price %th Sold %th Turnover + %th Registration Ticket %th Actions %tbody - @conference.tickets.each do |ticket| @@ -27,6 +28,8 @@ = ticket.tickets_sold %td = humanized_money_with_symbol ticket.tickets_turnover + %td + = ticket.registration_ticket? ? 'Yes' : 'No' %td .btn-group = link_to 'Edit', edit_admin_conference_ticket_path(@conference.short_title, ticket.id), diff --git a/db/migrate/20170807092805_add_registration_ticket_to_tickets.rb b/db/migrate/20170807092805_add_registration_ticket_to_tickets.rb new file mode 100644 index 00000000..0ee2410d --- /dev/null +++ b/db/migrate/20170807092805_add_registration_ticket_to_tickets.rb @@ -0,0 +1,5 @@ +class AddRegistrationTicketToTickets < ActiveRecord::Migration + def change + add_column :tickets, :registration_ticket, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index d49dfa03..ce680725 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170721001700) do +ActiveRecord::Schema.define(version: 20170807092805) do create_table "ahoy_events", force: :cascade do |t| t.integer "visit_id" @@ -507,6 +507,7 @@ ActiveRecord::Schema.define(version: 20170721001700) do t.text "description" t.integer "price_cents", default: 0, null: false t.string "price_currency", default: "USD", null: false + t.boolean "registration_ticket", default: false end create_table "tracks", force: :cascade do |t| From bd62df14c3999b7968586d886141bc60557d99a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Mar=C3=ADa=20Mart=C3=ADnez=20G=C3=B3mez?= Date: Thu, 20 Jul 2017 14:37:22 +0200 Subject: [PATCH 7/9] Fix vagrant broken after updating to Ruby 2.4 Ruby got updated in https://github.com/openSUSE/osem/pull/1588, But there was a repo missed, so Ruby 2.4 can be installed in our Vagrant machine. Closes https://github.com/openSUSE/osem/issues/1601 Mob-programmed by @mdeniz, @DavidKang and @Ana06. --- bootstrap.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index f0ac49fb..92a8d746 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,6 +2,8 @@ pushd /vagrant echo -e "\ninstalling required software packages...\n" +zypper -q ar -f http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_42.2/devel:languages:ruby.repo +zypper -q --gpg-auto-import-keys --non-interactive ref zypper -q -n install update-alternatives ruby2.4-devel make gcc gcc-c++ \ libxml2-devel libxslt-devel nodejs screen mariadb \ libmysqld-devel sqlite3-devel ImageMagick From 88e31ad902f729412a616b18f50bf2e1f38cac25 Mon Sep 17 00:00:00 2001 From: Wexpo Lyu Date: Wed, 2 Aug 2017 11:24:37 -0500 Subject: [PATCH 8/9] Expose enable_starttls_auto & openssl_verify_mode. And align `ENV` calls to keep up with codes above. My fault for using tabs. which caused a real misalignment. --- config/environments/production.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index d2b43a46..cb3a5d67 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -77,8 +77,9 @@ Osem::Application.configure do user_name: ENV['OSEM_SMTP_USERNAME'], password: ENV['OSEM_SMTP_PASSWORD'], authentication: ENV['OSEM_SMTP_AUTHENTICATION'].try(:to_sym), - domain: ENV['OSEM_SMTP_DOMAIN'], - enable_starttls_auto: true + domain: ENV['OSEM_SMTP_DOMAIN'], + enable_starttls_auto: ENV['OSEM_SMTP_ENABLE_STARTTLS_AUTO'], + openssl_verify_mode: ENV['OSEM_SMTP_OPENSSL_VERIFY_MODE'] } # Set the secret_key_base from the env, if not set by any other means From 33aee342b43d14cf3ade75a0f45ae6018982566b Mon Sep 17 00:00:00 2001 From: Wexpo Lyu Date: Wed, 2 Aug 2017 21:19:13 -0500 Subject: [PATCH 9/9] Add new envs to dotenv.example. --- dotenv.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotenv.example b/dotenv.example index 0c852658..77c28e4c 100644 --- a/dotenv.example +++ b/dotenv.example @@ -58,6 +58,8 @@ OSEM_SMTP_USERNAME="" OSEM_SMTP_PASSWORD="" OSEM_SMTP_AUTHENTICATION="" OSEM_SMTP_DOMAIN="" +OSEM_SMTP_ENABLE_STARTTLS_AUTO="" +OSEM_SMTP_OPENSSL_VERIFY_MODE="" # Enable the usage of the devise ichain plugin OSEM_ICHAIN_ENABLED=false