Merge branch 'master' into issue_1608

This commit is contained in:
Stella Rouzi 2017-08-11 12:06:27 +03:00 committed by GitHub
commit 678d0ae90e
12 changed files with 44 additions and 6 deletions

View file

@ -50,7 +50,7 @@ module Admin
private private
def ticket_params 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 end
end end

View file

@ -13,5 +13,6 @@
= f.input :description, input_html: { rows: 5, data: { provide: "markdown-editable" } } = f.input :description, input_html: { rows: 5, data: { provide: "markdown-editable" } }
= f.input :price = 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'], include_blank: false
= f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.'
%p.text-right %p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -14,6 +14,7 @@
%th Price %th Price
%th Sold %th Sold
%th Turnover %th Turnover
%th Registration Ticket
%th Actions %th Actions
%tbody %tbody
- @conference.tickets.each do |ticket| - @conference.tickets.each do |ticket|
@ -27,6 +28,8 @@
= ticket.tickets_sold = ticket.tickets_sold
%td %td
= humanized_money_with_symbol ticket.tickets_turnover = humanized_money_with_symbol ticket.tickets_turnover
%td
= ticket.registration_ticket? ? 'Yes' : 'No'
%td %td
.btn-group .btn-group
= link_to 'Edit', edit_admin_conference_ticket_path(@conference.short_title, ticket.id), = link_to 'Edit', edit_admin_conference_ticket_path(@conference.short_title, ticket.id),

View file

@ -7,7 +7,10 @@
%span.icon-bar %span.icon-bar
%span.icon-bar %span.icon-bar
%span.icon-bar %span.icon-bar
- if conference.nil? || conference.new_record?
= link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager' = link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager'
- else
= link_to conference.organization.name, organizations_path, class: 'navbar-brand', title: 'Open Source Event Manager'
.collapse.navbar-collapse .collapse.navbar-collapse
- if content_for :splash_nav - if content_for :splash_nav
%ul.nav.navbar-nav#splash-nav %ul.nav.navbar-nav#splash-nav

View file

@ -21,7 +21,7 @@
= yield(:head) = yield(:head)
%body %body
= render 'layouts/navigation' = render 'layouts/navigation', conference: @conference
-# Admin area -# Admin area
- if controller.class.name.split("::").first=="Admin" - if controller.class.name.split("::").first=="Admin"
= render 'layouts/admin' = render 'layouts/admin'

View file

@ -2,6 +2,8 @@
pushd /vagrant pushd /vagrant
echo -e "\ninstalling required software packages...\n" 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++ \ zypper -q -n install update-alternatives ruby2.4-devel make gcc gcc-c++ \
libxml2-devel libxslt-devel nodejs screen mariadb \ libxml2-devel libxslt-devel nodejs screen mariadb \
libmysqld-devel sqlite3-devel ImageMagick libmysqld-devel sqlite3-devel ImageMagick

View file

@ -78,7 +78,8 @@ Osem::Application.configure do
password: ENV['OSEM_SMTP_PASSWORD'], password: ENV['OSEM_SMTP_PASSWORD'],
authentication: ENV['OSEM_SMTP_AUTHENTICATION'].try(:to_sym), authentication: ENV['OSEM_SMTP_AUTHENTICATION'].try(:to_sym),
domain: ENV['OSEM_SMTP_DOMAIN'], domain: ENV['OSEM_SMTP_DOMAIN'],
enable_starttls_auto: true 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 # Set the secret_key_base from the env, if not set by any other means

View file

@ -0,0 +1,5 @@
class AddRegistrationTicketToTickets < ActiveRecord::Migration
def change
add_column :tickets, :registration_ticket, :boolean, default: false
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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| create_table "ahoy_events", force: :cascade do |t|
t.integer "visit_id" t.integer "visit_id"
@ -507,6 +507,7 @@ ActiveRecord::Schema.define(version: 20170721001700) do
t.text "description" t.text "description"
t.integer "price_cents", default: 0, null: false t.integer "price_cents", default: 0, null: false
t.string "price_currency", default: "USD", null: false t.string "price_currency", default: "USD", null: false
t.boolean "registration_ticket", default: false
end end
create_table "tracks", force: :cascade do |t| create_table "tracks", force: :cascade do |t|

View file

@ -58,6 +58,8 @@ OSEM_SMTP_USERNAME=""
OSEM_SMTP_PASSWORD="" OSEM_SMTP_PASSWORD=""
OSEM_SMTP_AUTHENTICATION="" OSEM_SMTP_AUTHENTICATION=""
OSEM_SMTP_DOMAIN="" OSEM_SMTP_DOMAIN=""
OSEM_SMTP_ENABLE_STARTTLS_AUTO=""
OSEM_SMTP_OPENSSL_VERIFY_MODE=""
# Enable the usage of the devise ichain plugin # Enable the usage of the devise ichain plugin
OSEM_ICHAIN_ENABLED=false OSEM_ICHAIN_ENABLED=false

View file

@ -71,6 +71,15 @@ feature Conference do
end end
describe 'admin' do describe 'admin' do
let!(:conference) { create(:conference) }
scenario 'has organization name in menu bar for conference views', feature: true, js: true do
sign_in user
visit admin_conference_path(conference.short_title)
expect(find('.navbar-brand').text).to eq(conference.organization.name)
end
it_behaves_like 'add and update conference' it_behaves_like 'add and update conference'
end end
end end

View file

@ -61,4 +61,15 @@ feature Splashpage do
expect(current_path).to eq(root_path) expect(current_path).to eq(root_path)
end end
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 end