Merge branch 'master' into ticket-show-page

This commit is contained in:
Moisés Déniz Alemán 2017-07-18 12:04:21 +02:00 committed by GitHub
commit 121192d21a
66 changed files with 2647 additions and 1492 deletions

View file

@ -0,0 +1,12 @@
%dt
Start Date
%dd
= @cfp.start_date.strftime('%A, %B %e. %Y')
%dt
End Date
%dd
= @cfp.end_date.strftime('%A, %B %e. %Y')
%dt
Days Left
%dd
= pluralize(@cfp.remaining_days, 'day')

View file

@ -1,6 +1,23 @@
.text-center
%h4 #{title}
%canvas.doughnut_chart{ 'data-chart' => data.to_json }
%canvas.doughnut_chart{ id: "dough_#{title}", 'data-chart' => data.to_json }
- if data
- data.each do |key, value|
%span{ 'style' => "border-bottom: 3px solid #{value['color']}" } #{key}: #{value['value']}
:javascript
$(document).ready( function(){
var d = $("#dough_#{title}");
var dt = d.get(0).getContext('2d');
$(window).resize( respondCanvas );
function respondCanvas(){
dt.canvas.width = 150;
dt.canvas.height = 150;
}
respondCanvas();
});

View file

@ -27,3 +27,21 @@
%span{ 'style' => "border-bottom: 3px solid #{conference[:color]};", 'data-chart' => "#{name}" }
%input{ 'type' => 'checkbox', 'name' => "#{conference[:short_title]}" }
#{conference[:short_title]}
:javascript
$(document).ready( function(){
var c = $("#line_chart_#{name}");
var ct = c.get(0).getContext('2d');
var container = $(c).parent();
$(window).resize( respondCanvas );
function respondCanvas(){
c.attr('width', $(container).width() );
c.attr('height', $(container).height() );
}
respondCanvas();
});

View file

@ -20,9 +20,9 @@
%td
= organization.name
%td
= organization.conferences.count
= organization.conferences.upcoming.count
%td
= organization.conferences.count
= organization.conferences.past.count
%td
.btn-group
= link_to 'Edit', edit_admin_organization_path(organization),

View file

@ -7,7 +7,7 @@
.text-muted
= @role.description
= semantic_form_for @role, url: admin_conference_role_path(@conference.short_title, @role.name) do |f|
= semantic_form_for @role, url: @url do |f|
.row
.col-md-5
= f.input :description

View file

@ -14,7 +14,7 @@
- if ( can? :toggle_user, @role )
%td.text-right
= hidden_field_tag "role[user_ids][]", nil
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "/admin/conferences/#{@conference.short_title}/roles/#{@role.name}/toggle_user?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "#{@url}?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
%td= user.id
%td= user.name
%td= user.email

View file

@ -19,13 +19,24 @@
%tr
%td= role.id
%td= role.name.titleize
%td= role.description
%td
= role.description
- if role.resource_type == 'Track'
= link_to role.resource.name, admin_conference_program_track_path(@conference.short_title, role.resource)
%td
= role.users.pluck(:name).first(5).join ', '
- if role.users.count > 5
= link_to '...', admin_conference_role_path(@conference.short_title, role.name)
- if role.resource_type == 'Track'
= link_to '...', track_admin_conference_role_path(@conference.short_title, role.name, role.resource)
- else
= link_to '...', admin_conference_role_path(@conference.short_title, role.name)
%td
.btn-group
= link_to 'Users', admin_conference_role_path(@conference.short_title, role.name), class: 'btn btn-success'
- if can? :edit, role
= link_to 'Edit', edit_admin_conference_role_path(@conference.short_title, role.name), class: 'btn btn-primary'
- if role.resource_type == 'Track'
= link_to 'Users', track_admin_conference_role_path(@conference.short_title, role.name, role.resource), class: 'btn btn-success'
- if can? :edit, role
= link_to 'Edit', track_edit_admin_conference_role_path(@conference.short_title, role.name, role.resource), class: 'btn btn-primary'
- else
= link_to 'Users', admin_conference_role_path(@conference.short_title, role.name), class: 'btn btn-success'
- if can? :edit, role
= link_to 'Edit', edit_admin_conference_role_path(@conference.short_title, role.name), class: 'btn btn-primary'

View file

@ -6,14 +6,20 @@
Role
= @role.name.titleize
- if can? :edit, @role
= link_to 'Edit', edit_admin_conference_role_path(@conference.short_title, @role.name), class: 'btn btn-primary pull-right'
- if @track
= link_to 'Edit', track_edit_admin_conference_role_path(@conference.short_title, @role.name, @track), class: 'btn btn-primary pull-right'
- else
= link_to 'Edit', edit_admin_conference_role_path(@conference.short_title, @role.name), class: 'btn btn-primary pull-right'
.text-muted
= @role.description
- if @track
= link_to @track.name, admin_conference_program_track_path(@conference.short_title, @track)
.row.col-md-3
- if ( can? :toggle_user, @role ) && !@role.new_record?
= semantic_form_for :user, url: toggle_user_admin_conference_role_path(@conference.short_title, @role.name), method: :post do |u|
= semantic_form_for :user, url: @url, method: :post do |u|
= u.label 'Add user by email: '
.input-group

View file

@ -8,9 +8,11 @@
Track
.row
.col-md-12
= semantic_form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path : admin_conference_program_track_path(@conference.short_title, @track.short_name))) do |f|
= semantic_form_for(@track, url: (@track.new_record? ? admin_conference_program_tracks_path : admin_conference_program_track_path(@conference.short_title, @track))) do |f|
= f.input :name
= f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }
= f.input :color, input_html: {size: 6, type: 'color'}, required: true
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint
- if @track.self_organized?
= f.input :cfp_active, label: 'Allow event submitters to select this track for their proposal'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -11,29 +11,55 @@
%th Name
%th Short name
%th Description
%th Submitter
%th Color
%th State
%th Included in the Cfp
%th Actions
%tbody
- @tracks.each do |track|
%tr
%td
= link_to(admin_conference_program_track_path(@conference.short_title, track.short_name)) do
= link_to(admin_conference_program_track_path(@conference.short_title, track)) do
= track.name
%td
= track.short_name
%td
%p
= truncate(track.description)
%td
- if track.self_organized?
= link_to track.submitter.name, admin_user_path(track.submitter)
- else
N/A
%td
%span.label{style: "background-color: #{track.color}; color: #{ contrast_color(track.color) }"}
= track.color
%td
- if track.self_organized?
= track.state
- else
N/A
%td
- if track.self_organized?
= check_box_tag "#{@conference.short_title}_#{track.short_name}", track.id, track.cfp_active,
class: 'switch-checkbox', method: :patch,
url: toggle_cfp_inclusion_admin_conference_program_track_path(@conference.short_title, id: track.short_name)+"?included=",
data: { size: 'small',
on_color: 'success',
off_color: 'warning',
on_text: 'Yes',
off_text: 'No' }
- else
%i.fa.fa-check
%td
.btn-group{role: "group"}
= link_to 'Edit', edit_admin_conference_program_track_path(@conference.short_title, track.short_name),
= link_to 'Edit', edit_admin_conference_program_track_path(@conference.short_title, track),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_program_track_path(@conference.short_title, track.short_name),
method: :delete, class: 'btn btn-danger',
data: { confirm: "Do you really want to delete #{track.name}? Attention: This track will be removed from all Events that have it set" }
- if can? :destroy, track
= link_to 'Delete', admin_conference_program_track_path(@conference.short_title, track),
method: :delete, class: 'btn btn-danger',
data: { confirm: "Do you really want to delete #{track.name}? Attention: This track will be removed from all Events that have it set" }
.row
.col-md-12.text-right
= link_to 'New Track', new_admin_conference_program_track_path(@conference.short_title), class: 'btn btn-success'

View file

@ -16,7 +16,7 @@
%span.fa.fa-cog
Manage
= conference.short_title
- if (current_user.is_admin) || (current_user.has_role? :organizer, :any)
- if can? :new, Conference.new
%li
= link_to(new_admin_conference_path) do
%span.fa.fa-plus

View file

@ -16,7 +16,7 @@
%span.fa.fa-cog
Manage
= conference.short_title
- if can? :create, Conference
- if can? :new, Conference.new
%li
= link_to(new_admin_conference_path) do
%span.fa.fa-plus

View file

@ -60,13 +60,13 @@
.dropdown-menu
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
= form_tag User.ichain_login_url do
= text_field_tag 'username', nil, id: 'user_ichain_email_dd', placeholder: 'Username'
= password_field_tag 'password', nil, id: 'user_ichain_password_dd', placeholder: 'Password'
= text_field_tag 'username', nil, id: 'user_ichain_email_dd', class: 'form-control', placeholder: 'Username'
= password_field_tag 'password', nil, id: 'user_ichain_password_dd', class: 'form-control', placeholder: 'Password'
%button.btn.btn-success.btn-block Sign in
- else
= form_tag new_user_session_path do
= text_field_tag 'user[login]', nil, id: 'user_login_dd', placeholder: 'Username / E-Mail'
= password_field_tag 'user[password]', nil, id: 'user_password_dd', placeholder: 'Password'
= text_field_tag 'user[login]', nil, id: 'user_login_dd', class: 'form-control', placeholder: 'Username / E-Mail'
= password_field_tag 'user[password]', nil, id: 'user_password_dd', class: 'form-control', placeholder: 'Password'
%p.text-right
%small
%label{for: 'user_remember_me'} Remember me

View file

@ -28,10 +28,10 @@
= link_to(admin_conferences_path()) do
%span.fa.fa-home
Administration
- if can? :create, Conference
- if can? :new, Conference.new
=link_to(new_admin_conference_path) do
%span.fa.fa-plus
Create Conference
New Conference
-if @conference and @conference.id and can? :show, @conference
%li
= link_to(admin_conference_path(@conference.short_title)) do

View file

@ -1,62 +0,0 @@
prawn_document(filename: @file_name, page_layout: @ticket_layout, :page_size =>'A4' ) do |pdf|
# Vertical Layout
top = pdf.bounds.top
bottom = pdf.bounds.bottom
left = pdf.bounds.left
right = pdf.bounds.right
mid_vertical = (pdf.bounds.top-pdf.bounds.bottom)/2
mid_horizontal = (pdf.bounds.right-pdf.bounds.left)/2
x = 0
pdf.move_down mid_vertical
pdf.dash(2, :space => 1)
pdf.stroke_horizontal_rule
pdf.stroke_vertical_line pdf.bounds.top, pdf.bounds.bottom, :at => mid_horizontal
pdf.move_up mid_vertical
pdf.draw_text "TICKET HOLDER", :at => [x,pdf.cursor-30], :size => 17
pdf.dash(2, :space => 0)
pdf.stroke_rectangle [x, pdf.cursor-50], 230, 150
pdf.move_down 80
pdf.draw_text "NAME", :at => [x+10,pdf.cursor], :size => 13
pdf.fill_color "808080"
pdf.draw_text "#{@user.name}", :at => [x+10,pdf.cursor-25], size: 20
pdf.fill_color "000000"
pdf.draw_text "EMAIL", :at => [x+10,pdf.cursor-50], :size => 13
pdf.fill_color "808080"
pdf.draw_text "#{@user.email}", :at => [x+10,pdf.cursor-75], size: 20
pdf.fill_color "000000"
pdf.move_up 20
if @conference.picture?
if 7 * @conference.picture.image[:width] > 12 * @conference.picture.image[:height]
pdf.image "#{Rails.root}/public#{@conference.picture_url}", :at => [mid_horizontal+30, pdf.cursor], :width => 120
else
pdf.image "#{Rails.root}/public#{@conference.picture_url}", :at => [mid_horizontal+30, pdf.cursor], :height => 70
end
else
pdf.image "#{Rails.root}/public/img/osem-logo.png", :at => [mid_horizontal+30, pdf.cursor], :height => 70
end
pdf.move_down 70
pdf.draw_text "#{@conference.title}", :at => [mid_horizontal+30,pdf.cursor-30], :size => 12
pdf.draw_text "#{@conference.organization.name}", :at => [mid_horizontal+30,pdf.cursor-50], :size => 12
pdf.draw_text "#{@conference.venue.name}", :at => [mid_horizontal+30,pdf.cursor-70]
pdf.move_up 130
pdf.move_down mid_vertical
pdf.draw_text "EVENT", :at => [x,pdf.cursor-40], :size => 15
pdf.fill_color "808080"
pdf.draw_text "#{@conference.title}", :at => [x,pdf.cursor-60], size: 12
pdf.draw_text "#{@conference.start_date.strftime('%B %d, %Y')}", :at => [x,pdf.cursor-80], size: 12
pdf.move_down 80
pdf.fill_color "000000"
pdf.draw_text "TICKET", :at => [x,pdf.cursor-30], :size => 15
pdf.fill_color "808080"
pdf.draw_text "#{@physical_ticket.ticket.title}", :at => [x,pdf.cursor-50], size: 12
pdf.move_down 50
pdf.fill_color "000000"
pdf.draw_text "TICKET REF.", :at => [x,pdf.cursor-30], :size => 15
pdf.fill_color "808080"
pdf.draw_text "#{@physical_ticket.ticket_purchase.id}", :at => [x,pdf.cursor-50], size: 12
pdf.move_down 50
pdf.fill_color "000000"
pdf.draw_text "Powered By OSEM", :at => [(mid_horizontal-left-100)/2,pdf.cursor-100], :size => 11
pdf.move_up 180
end

View file

@ -0,0 +1,17 @@
.container
.row
.col-md-12
.page-header
%h1
- if @track.new_record?
New
= @track.name
Track
.row
.col-md-12
= semantic_form_for(@track, url: (@track.new_record? ? conference_program_tracks_path : conference_program_track_path(@conference.short_title, @track))) do |f|
= f.input :name
= f.input :short_name, hint: "A short and unique handle for the track, using only letters, numbers, underscores, and dashes. This will be used to identify the track in URLs etc. Example: 'my_awesome_track'", input_html: { required: 'required', pattern: '[a-zA-Z0-9_-]+', title: 'Only letters, numbers, underscores, and dashes.' }
= f.input :color, input_html: {size: 6, type: 'color'}, required: true
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, required: true, hint: markdown_hint
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -0,0 +1,43 @@
.container
.row
.col-md-12.page-header
%h1
Track requests for
%span.notranslate
= @conference.title
- if @tracks.any?
.row
.col-md-12
%table.table.table-hover#tracks
%thead
%th Name
%th Short name
%th Description
%th Color
%th State
%th Actions
%tbody
- @tracks.each do |track|
%tr
%td
= link_to(conference_program_track_path(@conference.short_title, track)) do
= track.name
%td
= track.short_name
%td
%p
= truncate(track.description)
%td
%span.label{style: "background-color: #{track.color}; color: #{ contrast_color(track.color) }"}
= track.color
%td
= track.state
%td
= link_to 'Edit', edit_conference_program_track_path(@conference.short_title, track),
method: :get, class: 'btn btn-primary'
.row
.col-md-12
- if can? :create, @track
= link_to "New Track request", new_conference_program_track_path(@conference.short_title), class: 'btn btn-success pull-right'

View file

@ -0,0 +1,26 @@
.container
.row
.col-md-12
.page-header
%h1
= @track.name
Track
.row
.col-md-8
%dl.dl-horizontal
%dt
Color:
%dd
%span.label{style: "background-color: #{@track.color}; color: #{ contrast_color(@track.color) }"}
= @track.color
%dt
State:
%dd
= @track.state
%dt
Description
%dd
= @track.description
.row
.col-md-12.text-right
= link_to 'Edit Track request', edit_conference_program_track_path(@conference.short_title, @track), class: 'btn btn-primary'