From c9b70c22edd18bc832bc3d8b61a683bac2710bef Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 15 Sep 2017 22:42:14 +0200 Subject: [PATCH 1/5] add CHF currency --- app/views/admin/tickets/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/tickets/_form.html.haml b/app/views/admin/tickets/_form.html.haml index 11aff78d..319f7996 100644 --- a/app/views/admin/tickets/_form.html.haml +++ b/app/views/admin/tickets/_form.html.haml @@ -12,7 +12,7 @@ = f.input :title = 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 :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], 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' } From 8ddcd695f02bd6ad23058bdce437306e72e155bb Mon Sep 17 00:00:00 2001 From: James Mason Date: Wed, 11 Oct 2017 16:47:51 -0700 Subject: [PATCH 2/5] Add vendor picture interface; include in splash Vendor has a picture atrribute, and was displayed in one form of the splashpage, but it wasn't exposed in the vendor editing form, nor was it included in the "map view" on the splash page. Additionally, the map popup was rendered inline. This commit: * Adds a from input for editing Venue#picture, consistent with other form elements * Displays the picture on the splash page in either style (map or static) * Moves the splash page map popup from inline HTML to it's own partial --- app/views/admin/venues/_form.html.haml | 6 ++++++ app/views/conferences/_venue_map.html.haml | 5 ++--- app/views/conferences/_venue_map_marker.html.haml | 13 +++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 app/views/conferences/_venue_map_marker.html.haml diff --git a/app/views/admin/venues/_form.html.haml b/app/views/admin/venues/_form.html.haml index 7dd08a2c..6674305b 100644 --- a/app/views/admin/venues/_form.html.haml +++ b/app/views/admin/venues/_form.html.haml @@ -15,6 +15,12 @@ = semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f| = f.inputs :name, :website = f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint + = f.label 'Venue Logo' + %br + - if @venue.picture? + = image_tag @venue.picture.thumb.url + = f.input :picture, label: false, hint: 'This will be displayed on the venue are of the splash page.' + = f.hidden_field :picture_cache = f.inputs :street, :postalcode, :city, :country, :latitude, :longitude = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } diff --git a/app/views/conferences/_venue_map.html.haml b/app/views/conferences/_venue_map.html.haml index 717069d5..9f34117f 100644 --- a/app/views/conferences/_venue_map.html.haml +++ b/app/views/conferences/_venue_map.html.haml @@ -1,5 +1,4 @@ #map{style: "height: 500px;" } -- popup = "

#{@conference.venue.name}


#{@conference.venue.street}
#{@conference.venue.city}
#{@conference.venue.country_name}" - content_for(:script_body) do :javascript // create a map in the "map" div, set the view to a given place and zoom @@ -10,8 +9,8 @@ maxZoom: 18 }).addTo(map); // add a marker in the given location, attach some popup content to it and open the popup - L.marker([#{h(@conference.venue.latitude)}, #{h(@conference.venue.longitude)}]).addTo(map) - .bindPopup("#{h(popup)}") + L.marker([#{h @conference.venue.latitude}, #{h @conference.venue.longitude}]).addTo(map) + .bindPopup("#{escape_javascript(render '/conferences/venue_map_marker', venue: @conference.venue)}") .openPopup(); // Turn scrollwheel on when user clicks map.on('focus', function(e) { diff --git a/app/views/conferences/_venue_map_marker.html.haml b/app/views/conferences/_venue_map_marker.html.haml new file mode 100644 index 00000000..c5f78345 --- /dev/null +++ b/app/views/conferences/_venue_map_marker.html.haml @@ -0,0 +1,13 @@ +- if venue.picture? + = image_tag venue.picture.thumb.url, + alt: venue.name, + class: 'img-responsive pull-right' +%h3= venue.name +%p + = venue.street + %br + = venue.city + %br + = venue.country_name +- if venue.website + %p.text-center.clearfix= sanitize(link_to venue.website, venue.website) From e96a5338e2030b4094152d103b9f744a043bec09 Mon Sep 17 00:00:00 2001 From: James Mason Date: Fri, 13 Oct 2017 10:39:10 -0700 Subject: [PATCH 3/5] Attempting to stabilize another flaky test. --- app/views/proposals/index.html.haml | 2 +- spec/features/versions_spec.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/proposals/index.html.haml b/app/views/proposals/index.html.haml index 06154d47..5ed332dc 100644 --- a/app/views/proposals/index.html.haml +++ b/app/views/proposals/index.html.haml @@ -55,7 +55,7 @@ %p Knowing the number of visitors for the conference helps the organizers plan better. - %table.table.table-striped + %table.table.table-striped#events - @events.each do |event| %tr %td{style: "padding:20px 8px 20px 8px;"} diff --git a/spec/features/versions_spec.rb b/spec/features/versions_spec.rb index 0db2d1f9..1bf114a0 100644 --- a/spec/features/versions_spec.rb +++ b/spec/features/versions_spec.rb @@ -193,7 +193,9 @@ feature 'Version' do click_link 'Reject event' visit conference_program_proposals_path(conference_id: conference.short_title) - click_link 'Re-Submit' + within('#events') do + click_link 'Re-Submit' + end visit admin_conference_program_events_path(conference.short_title) click_button 'New' From f44e6e5ca5d683de4678c395d0c9edca8a86c342 Mon Sep 17 00:00:00 2001 From: ViditChitkara Date: Fri, 13 Oct 2017 22:30:08 +0530 Subject: [PATCH 4/5] fixed openid username closes #1747 minor changes for styling issue --- app/controllers/users/omniauth_callbacks_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index cf6eb6a8..ed7ce011 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -11,13 +11,13 @@ module Users def handle(provider) auth_hash = request.env['omniauth.auth'] - uid = auth_hash[:uid] + username = auth_hash.info.email.split('@')[0] openid = Openid.find_for_oauth(auth_hash) # Get or create openid # If openid exists and is associated with a user, sign in with associated user, # even if the email of the associated user and the email of the provided openid are different unless (user = openid.user) user = User.find_for_auth(auth_hash, current_user) # Get or create users - user.username = "#{uid}@#{provider}" if user.username.blank? + user.username = "#{username}@#{provider}" if user.username.blank? end begin From 3d8b32d90bb6aa55fe54f8519097f2ec9f7e4dfc Mon Sep 17 00:00:00 2001 From: Udit Jindal Date: Thu, 19 Oct 2017 01:41:40 +0530 Subject: [PATCH 5/5] fixed doubly typed route --- config/routes.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 0d7e7aec..fcee2564 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -165,7 +165,6 @@ Osem::Application.routes.draw do member do get :registrations patch '/withdraw' => 'proposals#withdraw' - get :registrations patch '/confirm' => 'proposals#confirm' patch '/restart' => 'proposals#restart' end