@ -0,0 +1,130 @@ |
|||
conference |
|||
- title : string |
|||
- slug : string |
|||
- start_date : datetime |
|||
- end_date : datetime |
|||
- info : text |
|||
- poster : *image |
|||
- banner : *image |
|||
- workshop_schedule_published : boolean |
|||
- registration_open : boolean |
|||
- meals_provided : boolean |
|||
- meal_info : *text |
|||
|
|||
- conference_type : [conference_type] |
|||
- host_organizations : NtoN[organization] |
|||
- locations : *NtoN[location] |
|||
- registration_form_fields : *NtoN[registration_form_field] |
|||
- workshop_resources : *NtoN[workshop_resource] |
|||
|
|||
*conference_type |
|||
- title : string |
|||
- slug : string |
|||
- info : text |
|||
|
|||
event |
|||
- title : string |
|||
- slug : string |
|||
- conference : [conference] |
|||
- info : text |
|||
- location : *[location] |
|||
- start_time : *datetime |
|||
- end_time : *datetime |
|||
|
|||
*location |
|||
- title : *string |
|||
- latitude : *float |
|||
- longitude : *float |
|||
- country : *string |
|||
- territory : *string |
|||
- city : *string |
|||
- street : *string |
|||
- postal_code : *string |
|||
|
|||
*organization |
|||
- name : string |
|||
- slug : string |
|||
- email_address : string |
|||
- shop_status : list(string) |
|||
- year_founded : integer |
|||
- info : text |
|||
- url : string |
|||
- logo : image |
|||
- icon : image |
|||
- requires_approval : boolean |
|||
- secret_question : *string |
|||
- secret_answer : *string(hashed) |
|||
- location : [location] |
|||
- members : NtoN[user_organization_replationship] |
|||
|
|||
registration_form_field |
|||
- title : string |
|||
- slug : string |
|||
- required : boolean |
|||
- field_type : list(string) |
|||
- options : *string |
|||
- other_option : *boolean |
|||
- retired : boolean |
|||
|
|||
request |
|||
- comment : text |
|||
- object : Nto1[object] |
|||
- is_invite : boolean |
|||
- state : list(string) |
|||
|
|||
*user_organization_relationship |
|||
- user : [user] |
|||
- organization : [organization] |
|||
- relationship : string |
|||
|
|||
workshop |
|||
- title : string |
|||
- slug : string |
|||
- info : text |
|||
- conference : [conference] |
|||
- stream : [workshop_stream] |
|||
- presentation_style : [presentation_style] |
|||
- requested_resources : NtoN[workshop_resource] |
|||
- facilitators : NtoN[user] |
|||
- min_facilitators : integer |
|||
- location : *[location] |
|||
- start_time : *datetime |
|||
- end_time : *datetime |
|||
|
|||
*workshop_presentation_style |
|||
- name : string |
|||
- slug : string |
|||
- info : text |
|||
|
|||
*workshop_resource |
|||
- name : string |
|||
- slug : string |
|||
- info : text |
|||
|
|||
*workshop_stream |
|||
- name : string |
|||
- slug : string |
|||
- info : text |
|||
|
|||
rails g scaffold organization name:string slug:string email_address:string url:string year_founded:integer info:text logo:string avatar:string requires_approval:boolean secret_question:string secret_answer:string location_id:integer user_organization_replationship_id:integer |
|||
|
|||
organization_status:string |
|||
user_organization_replationship_id:integer |
|||
|
|||
|
|||
conference title:string slug:string start_date:datetime end_date:datetime info:text poster:string banner:string workshop_schedule_published:boolean registration_open:boolean meals_provided:boolean meal_info:text travel_info:text conference_type:conference_type_id |
|||
|
|||
conference_hosts_organizations conference_id:integer organization_id:integer |
|||
|
|||
- host_organizations : NtoN[organization] |
|||
- locations : *NtoN[location] |
|||
- registration_form_fields : *NtoN[registration_form_field] |
|||
- workshop_resources : *NtoN[workshop_resource] |
|||
|
|||
registration_form_field |
|||
- title : string |
|||
- help : text |
|||
- required : boolean |
|||
- field_type : list(string) |
|||
- options : string |
|||
- retired : boolean |
@ -0,0 +1,10 @@ |
|||
Bike!Bike! Icon Font |
|||
=========== |
|||
|
|||
To add to the icon font: |
|||
|
|||
* Go to icomoon.io/app/ |
|||
* Import the .svg in this folder |
|||
* Add you own svg icons |
|||
* Genreate and download the font |
|||
* Unzip and overwrite the contents into this directory |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 693 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 357 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 453 KiB |
@ -0,0 +1,175 @@ |
|||
#= require jquery |
|||
#= require jquery_ujs |
|||
#= require jquery.ui.sortable |
|||
#= require jquery.turbolinks |
|||
#= require turbolinks |
|||
#= require foundation |
|||
|
|||
# FRONT END |
|||
|
|||
# JS HANDLEBARS TEMPLATES |
|||
# require handlebars.runtime |
|||
# require jquery_nested_form |
|||
|
|||
# I18n |
|||
#= require i18n |
|||
#= require i18n/translations |
|||
|
|||
# ALL THE REST |
|||
#= require_tree . |
|||
|
|||
'use strict' |
|||
|
|||
I18n.defaultLocale = '<%= I18n.default_locale %>' |
|||
I18n.locale = $('html').attr 'lang' |
|||
|
|||
try Typekit.load() catch |
|||
|
|||
startSpinner = -> |
|||
$('#loading-spinner').show() |
|||
|
|||
stopSpinner = -> |
|||
$('#loading-spinner').fadeOut() |
|||
|
|||
# Turbolinks Spinner |
|||
document.addEventListener 'page:fetch', startSpinner |
|||
document.addEventListener 'page:receive', stopSpinner |
|||
|
|||
readURL = (input) -> |
|||
reader = null |
|||
if input.files && input.files[0] |
|||
reader = new FileReader() |
|||
reader.readAsDataURL input.files[0] |
|||
reader.onload = (e) -> |
|||
$(input).prev().attr('src', e.target.result) |
|||
|
|||
createOverlay = () -> |
|||
if $('#overlay').length > 0 |
|||
$('#overlay').remove() |
|||
$('body').append('<div id="overlay" class="loading"><div id="overlay-inner"></div></div>') |
|||
$('#overlay-dlg') |
|||
|
|||
setOverlayHTML = (html) -> |
|||
$('#overlay-inner').append('<div id="overlay-dlg">' + html + '</div>'); |
|||
$('#overlay').removeAttr('class').click(destroyOverlay) |
|||
|
|||
destroyOverlay = () -> |
|||
$('#overlay').remove() |
|||
|
|||
selectA = (type, event, $emptyObj) -> |
|||
event.preventDefault() |
|||
# = $(this) |
|||
$overlay = createOverlay() |
|||
objs = [] |
|||
$('.' + type + '-select-field.added input.' + type + '-id').each () -> obj.push($(this).val()) |
|||
$.post $emptyObj.data().url + (if type == 'organization' then '/nonhosts' else '/nonmembers'), {added: objs}, |
|||
(html) -> |
|||
setOverlayHTML(html).addClass('' + type + '-select') |
|||
$('#select-' + type + '-list a').click (event) -> |
|||
event.preventDefault() |
|||
|
|||
$this = $(this) |
|||
$old_field = $emptyObj.closest('.field') |
|||
$field = $old_field.clone() |
|||
|
|||
oldID = parseInt($old_field.find('input[type="hidden"]').attr('name').match(/\[(\d+)\]\[id\]/)[1]) |
|||
newID = oldID + 1 |
|||
|
|||
$field.find('input.' + type + '-id').val($this.data().id) |
|||
$field.find('.' + type + 'name').html($this.find('.' + type + 'name').html()).before('<img src="' + $this.find('img').attr('src') + '" />') |
|||
$field.find('.select-' + type + '').remove() |
|||
$field.removeClass('new').addClass('added') |
|||
$old_field.html (i, html) -> |
|||
pregex = new RegExp('\\[' + oldID + '\\]', 'g'); |
|||
aregex = new RegExp('_' + oldID + '_', 'g'); |
|||
html.replace(pregex, '[' + newID + ']').replace(aregex, '_' + newID + '_') |
|||
$field.insertBefore($old_field) |
|||
$('a.select-' + type + '').click (event) -> selectA(type, event, $(this)) |
|||
|
|||
destroyOverlay() |
|||
return |
|||
, 'html' |
|||
|
|||
updateFormField = () -> |
|||
$form = $('form#new_registration_form_field') |
|||
$field_type = $form.find('#registration_form_field_field_type') |
|||
field_type = $field_type.val() |
|||
$form.find('.registration-form-field-field').hide() |
|||
$form.find('.registration-form-field-field.field-type-' + field_type).show() |
|||
|
|||
updateFormFieldForm = () -> |
|||
$('form #registration_form_field_field_type').change updateFormField |
|||
updateFormField() |
|||
$('form#new_registration_form_field').submit (event) -> |
|||
event.preventDefault() |
|||
$form = $(this) |
|||
serialized = $form.serialize() |
|||
$.post $form.attr('action'), serialized, |
|||
(json) -> |
|||
$form.replaceWith(json.form) |
|||
$('#registration-form-field-list').html(json.list) |
|||
updateFormFieldForm() |
|||
, 'json' |
|||
updateFormFieldList = () -> |
|||
$('#registration-form-field-list .add-form-field').click () -> |
|||
$.post 'form/add-field', {field: $(this).data().id}, |
|||
(json) -> |
|||
$('#conference-form').html(json.form) |
|||
$('#registration-form-field-list').html(json.list) |
|||
#console.log json |
|||
updateFormFieldList() |
|||
return |
|||
$('#conference-form .remove-form-field').click () -> |
|||
$.post 'form/remove-field', {field: $(this).data().id}, |
|||
(json) -> |
|||
$('#conference-form').html(json.form) |
|||
$('#registration-form-field-list').html(json.list) |
|||
updateFormFieldList() |
|||
return |
|||
|
|||
$ -> |
|||
$(document).foundation(); |
|||
$('.field.country-select select').change () -> |
|||
$country = $(this) |
|||
country = $country.val() |
|||
$territory = $('.field.subregion-select select') |
|||
if $territory.data().country == country |
|||
$territory.removeClass('can cant').addClass('can') |
|||
return |
|||
|
|||
$.post '/location/territories', {country: country}, |
|||
(json) -> |
|||
$territory.html('') |
|||
if json && Object.keys(json).length |
|||
$.each json, (code, name) -> |
|||
$territory.append($('<option>').text(name).attr('value', code)) |
|||
return |
|||
$territory.removeClass('can cant').addClass('can') |
|||
$territory.data().country = country |
|||
else |
|||
$territory.removeClass('can cant').addClass('cant') |
|||
return |
|||
, 'json' |
|||
|
|||
return |
|||
|
|||
$('img + input[type="file"]').change () -> |
|||
readURL(this); |
|||
|
|||
$('a.select-user, a.select-organization').click (event) -> selectA($(this).attr('class').match(/(^|\s)select\-([^\s]+)/)[2], event, $(this)) |
|||
updateFormFieldForm() |
|||
updateFormFieldList() |
|||
|
|||
$('ul.sortable').sortable |
|||
handle: '.drag-sort', |
|||
items: 'li', |
|||
update: (event, props) -> |
|||
$(this).children().each (index, child) -> |
|||
$(child).find('.sortable-position').val(index + 1) |
|||
url = $(this).data().url |
|||
if url |
|||
data = $(this).find('input, select, textarea').serialize() |
|||
$.post url, data#, |
|||
# (json) -> |
|||
# console.log json |
|||
#, 'json' |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,121 @@ |
|||
# I18n |
|||
#= require i18n |
|||
#= require i18n/translations |
|||
|
|||
'use strict' |
|||
|
|||
$(document).ready -> |
|||
$('#translation-control form').unbind('submit').bind('submit', (event)-> |
|||
event.preventDefault() |
|||
event.stopPropagation() |
|||
$form = $(this) |
|||
serialized = $form.serialize() |
|||
$form.find('select, button, textarea').prop 'disabled', true |
|||
$.post $form.attr('action'), serialized, |
|||
(json) -> |
|||
if json.success |
|||
$span = $('.translate-me[data-translate-key="' + json.key + '"]') |
|||
$span.html(json.translation) |
|||
$span.attr('data-translate-untranslated', json.translation) |
|||
$span.removeClass 'untranslated' |
|||
else if json.test |
|||
console.log json.test |
|||
$form.find('select, button, textarea').prop 'disabled', false |
|||
return |
|||
, 'json' |
|||
return |
|||
) |
|||
$('.translate-me').click (event)-> |
|||
if event.altKey |
|||
event.preventDefault() |
|||
key = $(this).attr('data-translate-key') |
|||
$('#translationkey').val key |
|||
resetTranslation key |
|||
$('#translationvalue').focus() |
|||
return |
|||
#$('#translationvalue, #translationkey').focus -> |
|||
$('#translation-control *').focus -> |
|||
key = $('#translationkey').val() |
|||
selectTranslation key |
|||
updateTranslation key |
|||
return |
|||
$('#translationkey').change (event)-> |
|||
#$('#translationvalue').val('') |
|||
key = $('#translationkey').val() |
|||
selectTranslation key |
|||
resetTranslation key |
|||
#$('#translation').focus() |
|||
#console.log event |
|||
return |
|||
# $('#translationvalue, #translationkey').blur -> |
|||
$('#translation-control *').blur -> |
|||
selectTranslation() |
|||
return |
|||
$('#translationvalue').bind 'input propertychange', ()-> |
|||
updateTranslation $('#translationkey').val() |
|||
return |
|||
return |
|||
|
|||
selectTranslation = (key)-> |
|||
$span = $('.translate-me.selected'); |
|||
$span.removeClass 'selected' |
|||
$span.removeClass 'preview' |
|||
$('#translatevars').hide() |
|||
$('#translatepluralizations').hide() |
|||
$('#translatevars ul').html '' |
|||
$('#translationhascount').val('0') |
|||
if key |
|||
$target = $('.translate-me[data-translate-key="' + key + '"]') |
|||
if !$target || !$target.length |
|||
return |
|||
vars = $target.addClass('selected').data().vars |
|||
if vars |
|||
keys = Object.keys(vars) |
|||
if keys.length |
|||
for i in [0...keys.length] |
|||
$('#translatevars ul').append ('<li class="var-' + keys[i] + '" title="Value: ' + vars[keys[i]] + '">' + keys[i] + '</li>') |
|||
if keys[i] == 'count' |
|||
$('#translatepluralizations').show() |
|||
$('#translationhascount').val('1') |
|||
$('#translatevars').show() |
|||
else |
|||
$span.html ()-> |
|||
$(this).attr('data-translate-untranslated') |
|||
return |
|||
|
|||
updateTranslation = (key)-> |
|||
$span = $('.translate-me[data-translate-key="' + key + '"]') |
|||
val = $('#translationvalue').val() |
|||
is_preview = ($span.hasClass 'preview') |
|||
$('#translatevars li').removeClass('used') |
|||
if val |
|||
if !is_preview |
|||
$span.addClass 'preview' |
|||
if !$span || !$span.length |
|||
return |
|||
vars = $span.data().vars |
|||
keys = Object.keys(vars) |
|||
for i in [0...keys.length] |
|||
_var = new RegExp('%{' + keys[i] + '}') |
|||
if val.match _var |
|||
# console.log 'Match!' |
|||
$('#translatevars li.var-' + keys[i]).addClass('used') |
|||
val = val.replace _var, vars[keys[i]] |
|||
else |
|||
if is_preview |
|||
$span.removeClass 'preview' |
|||
$span.html (val || $span.attr('data-translate-untranslated')) |
|||
return |
|||
|
|||
resetTranslation = (key)-> |
|||
$target = $('.translate-me[data-translate-key="' + key + '"]') |
|||
if $target && $target.length |
|||
translated = $target.data().translateTranslated |
|||
counts = ['zero', 'one', 'two', 'few', 'many'] |
|||
for i in counts |
|||
val = translated[key + '.' + i] |
|||
$('#translationvalue_' + i).val(val || '') |
|||
$('#translationpluralization_' + i).prop('checked', !!val) |
|||
val = (translated[key] || translated[key + '.other']) |
|||
$('#translationvalue').val(val || '') |
|||
return |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,3 @@ |
|||
# Place all the behaviors and hooks related to the matching controller here. |
|||
# All this logic will automatically be available in application.js. |
|||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
@ -0,0 +1,37 @@ |
|||
#= require jquery |
|||
#= require jquery_ujs |
|||
#= require jquery.turbolinks |
|||
#= require turbolinks |
|||
#= require foundation |
|||
|
|||
# FRONT END |
|||
|
|||
# JS HANDLEBARS TEMPLATES |
|||
# require handlebars.runtime |
|||
|
|||
# I18n |
|||
#= require i18n |
|||
#= require i18n/translations |
|||
|
|||
# ALL THE REST |
|||
#= require_tree . |
|||
|
|||
'use strict' |
|||
|
|||
I18n.defaultLocale = '<%= I18n.default_locale %>' |
|||
I18n.locale = $('html').attr 'lang' |
|||
|
|||
startSpinner = -> |
|||
$('#loading-spinner').show() |
|||
|
|||
stopSpinner = -> |
|||
$('#loading-spinner').fadeOut() |
|||
|
|||
# Turbolinks Spinner |
|||
document.addEventListener 'page:fetch', startSpinner |
|||
document.addEventListener 'page:receive', stopSpinner |
|||
|
|||
alert('123'); |
|||
|
|||
$ -> |
|||
$(document).foundation(); |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the conference_admins controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the conference_host_organizations controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the conference_registration_responses controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the conference_registrations controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the conference_registraton_form_fields controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the conference_types controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the conferences controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the Locations controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the organization_statuses controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the organizations controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the registration_form_fields controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,69 @@ |
|||
body { |
|||
background-color: #fff; |
|||
color: #333; |
|||
font-family: verdana, arial, helvetica, sans-serif; |
|||
font-size: 13px; |
|||
line-height: 18px; |
|||
} |
|||
|
|||
p, ol, ul, td { |
|||
font-family: verdana, arial, helvetica, sans-serif; |
|||
font-size: 13px; |
|||
line-height: 18px; |
|||
} |
|||
|
|||
pre { |
|||
background-color: #eee; |
|||
padding: 10px; |
|||
font-size: 11px; |
|||
} |
|||
|
|||
a { |
|||
color: #000; |
|||
&:visited { |
|||
color: #666; |
|||
} |
|||
&:hover { |
|||
color: #fff; |
|||
background-color: #000; |
|||
} |
|||
} |
|||
|
|||
div { |
|||
&.field, &.actions { |
|||
margin-bottom: 10px; |
|||
} |
|||
} |
|||
|
|||
#notice { |
|||
color: green; |
|||
} |
|||
|
|||
.field_with_errors { |
|||
padding: 2px; |
|||
background-color: red; |
|||
display: table; |
|||
} |
|||
|
|||
#error_explanation { |
|||
width: 450px; |
|||
border: 2px solid red; |
|||
padding: 7px; |
|||
padding-bottom: 0; |
|||
margin-bottom: 20px; |
|||
background-color: #f0f0f0; |
|||
h2 { |
|||
text-align: left; |
|||
font-weight: bold; |
|||
padding: 5px 5px 5px 15px; |
|||
font-size: 12px; |
|||
margin: -7px; |
|||
margin-bottom: 0px; |
|||
background-color: #c00; |
|||
color: #fff; |
|||
} |
|||
ul li { |
|||
font-size: 12px; |
|||
list-style: square; |
|||
} |
|||
} |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the user_organization_relationships controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the UserSessions controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the users controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the versions controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the workshop_presentation_styles controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the workshop_resources controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,3 @@ |
|||
// Place all the styles related to the workshop_streams controller here. |
|||
// They will automatically be included in application.css. |
|||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
@ -0,0 +1,65 @@ |
|||
/* |
|||
Syntax error: File to import not found or unreadable: foundation. |
|||
Load paths: |
|||
C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/blueprint/stylesheets |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/compass/stylesheets |
|||
Compass::SpriteImporter |
|||
on line 1327 of C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/foundation_and_overrides.scss |
|||
from line 20 of C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/application.css.scss |
|||
|
|||
Backtrace: |
|||
C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/foundation_and_overrides.scss:1327 |
|||
C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/application.css.scss:20 |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:67:in `rescue in import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:45:in `import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:28:in `imported_file' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:37:in `css_import?' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:217:in `visit_import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:37:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:100:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:227:in `block in visit_import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:227:in `map' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:227:in `visit_import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:37:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:100:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:53:in `block in visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:53:in `map' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:53:in `visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:109:in `block in visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:121:in `with_environment' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:108:in `visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:37:in `block in visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:128:in `visit_root' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:37:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:100:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:7:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/root_node.rb:20:in `render' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/engine.rb:315:in `_render' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/engine.rb:262:in `render' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:140:in `block (2 levels) in compile' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:126:in `timed' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:139:in `block in compile' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/logger.rb:45:in `red' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:138:in `compile' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:118:in `compile_if_required' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:103:in `block (2 levels) in run' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:101:in `each' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:101:in `block in run' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:126:in `timed' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:100:in `run' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/commands/update_project.rb:45:in `perform' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/commands/base.rb:18:in `execute' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/commands/project_base.rb:19:in `execute' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:43:in `perform!' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:30:in `block in <top (required)>' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:44:in `call' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:44:in `<top (required)>' |
|||
C:/RailsInstaller/Ruby2.0.0/bin/compass:23:in `load' |
|||
C:/RailsInstaller/Ruby2.0.0/bin/compass:23:in `<main>' |
|||
*/ |
|||
body:before { |
|||
white-space: pre; |
|||
font-family: monospace; |
|||
content: "Syntax error: File to import not found or unreadable: foundation.\A Load paths:\A C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets\A C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/blueprint/stylesheets\A C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/compass/stylesheets\A Compass::SpriteImporter\A on line 1327 of C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/foundation_and_overrides.scss\A from line 20 of C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/application.css.scss"; } |
@ -0,0 +1,58 @@ |
|||
/* |
|||
Syntax error: File to import not found or unreadable: foundation. |
|||
Load paths: |
|||
C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/blueprint/stylesheets |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/compass/stylesheets |
|||
Compass::SpriteImporter |
|||
on line 1327 of C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/foundation_and_overrides.scss |
|||
|
|||
Backtrace: |
|||
C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/foundation_and_overrides.scss:1327 |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:67:in `rescue in import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:45:in `import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:28:in `imported_file' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/import_node.rb:37:in `css_import?' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:217:in `visit_import' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:37:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:100:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:53:in `block in visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:53:in `map' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:53:in `visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:109:in `block in visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:121:in `with_environment' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:108:in `visit_children' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:37:in `block in visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:128:in `visit_root' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/base.rb:37:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:100:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:7:in `visit' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/tree/root_node.rb:20:in `render' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/engine.rb:315:in `_render' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/sass-3.2.12/lib/sass/engine.rb:262:in `render' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:140:in `block (2 levels) in compile' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:126:in `timed' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:139:in `block in compile' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/logger.rb:45:in `red' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:138:in `compile' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:118:in `compile_if_required' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:103:in `block (2 levels) in run' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:101:in `each' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:101:in `block in run' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:126:in `timed' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/compiler.rb:100:in `run' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/commands/update_project.rb:45:in `perform' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/commands/base.rb:18:in `execute' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/commands/project_base.rb:19:in `execute' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:43:in `perform!' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:30:in `block in <top (required)>' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:44:in `call' |
|||
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:44:in `<top (required)>' |
|||
C:/RailsInstaller/Ruby2.0.0/bin/compass:23:in `load' |
|||
C:/RailsInstaller/Ruby2.0.0/bin/compass:23:in `<main>' |
|||
*/ |
|||
body:before { |
|||
white-space: pre; |
|||
font-family: monospace; |
|||
content: "Syntax error: File to import not found or unreadable: foundation.\A Load paths:\A C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets\A C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/blueprint/stylesheets\A C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/compass-0.12.2/frameworks/compass/stylesheets\A Compass::SpriteImporter\A on line 1327 of C:/Users/Godwin/My Sites/bikebike/app/assets/stylesheets/foundation_and_overrides.scss"; } |
@ -0,0 +1,37 @@ |
|||
#= require jquery |
|||
#= require jquery_ujs |
|||
#= require jquery.turbolinks |
|||
#= require turbolinks |
|||
#= require foundation |
|||
|
|||
# FRONT END |
|||
|
|||
# JS HANDLEBARS TEMPLATES |
|||
# require handlebars.runtime |
|||
|
|||
# I18n |
|||
#= require i18n |
|||
#= require i18n/translations |
|||
|
|||
# ALL THE REST |
|||
#= require_tree . |
|||
|
|||
'use strict' |
|||
|
|||
I18n.defaultLocale = '<%= I18n.default_locale %>' |
|||
I18n.locale = $('html').attr 'lang' |
|||
|
|||
startSpinner = -> |
|||
$('#loading-spinner').show() |
|||
|
|||
stopSpinner = -> |
|||
$('#loading-spinner').fadeOut() |
|||
|
|||
# Turbolinks Spinner |
|||
document.addEventListener 'page:fetch', startSpinner |
|||
document.addEventListener 'page:receive', stopSpinner |
|||
|
|||
alert('321'); |
|||
|
|||
$ -> |
|||
$(document).foundation(); |
@ -0,0 +1,58 @@ |
|||
class ConferenceAdminsController < ApplicationController |
|||
before_action :set_conference_admin, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /conference_admins |
|||
def index |
|||
@conference_admins = ConferenceAdmin.all |
|||
end |
|||
|
|||
# GET /conference_admins/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /conference_admins/new |
|||
def new |
|||
@conference_admin = ConferenceAdmin.new |
|||
end |
|||
|
|||
# GET /conference_admins/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /conference_admins |
|||
def create |
|||
@conference_admin = ConferenceAdmin.new(conference_admin_params) |
|||
|
|||
if @conference_admin.save |
|||
redirect_to @conference_admin, notice: 'Conference admin was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /conference_admins/1 |
|||
def update |
|||
if @conference_admin.update(conference_admin_params) |
|||
redirect_to @conference_admin, notice: 'Conference admin was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /conference_admins/1 |
|||
def destroy |
|||
@conference_admin.destroy |
|||
redirect_to conference_admins_url, notice: 'Conference admin was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_conference_admin |
|||
@conference_admin = ConferenceAdmin.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def conference_admin_params |
|||
params.require(:conference_admin).permit(:conference_id, :user_id) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class ConferenceHostOrganizationsController < ApplicationController |
|||
before_action :set_conference_host_organization, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /conference_host_organizations |
|||
def index |
|||
@conference_host_organizations = ConferenceHostOrganization.all |
|||
end |
|||
|
|||
# GET /conference_host_organizations/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /conference_host_organizations/new |
|||
def new |
|||
@conference_host_organization = ConferenceHostOrganization.new |
|||
end |
|||
|
|||
# GET /conference_host_organizations/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /conference_host_organizations |
|||
def create |
|||
@conference_host_organization = ConferenceHostOrganization.new(conference_host_organization_params) |
|||
|
|||
if @conference_host_organization.save |
|||
redirect_to @conference_host_organization, notice: 'Conference host organization was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /conference_host_organizations/1 |
|||
def update |
|||
if @conference_host_organization.update(conference_host_organization_params) |
|||
redirect_to @conference_host_organization, notice: 'Conference host organization was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /conference_host_organizations/1 |
|||
def destroy |
|||
@conference_host_organization.destroy |
|||
redirect_to conference_host_organizations_url, notice: 'Conference host organization was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_conference_host_organization |
|||
@conference_host_organization = ConferenceHostOrganization.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def conference_host_organization_params |
|||
params.require(:conference_host_organization).permit(:conference_id, :organization_id, :order) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class ConferenceRegistrationResponsesController < ApplicationController |
|||
before_action :set_conference_registration_response, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /conference_registration_responses |
|||
def index |
|||
@conference_registration_responses = ConferenceRegistrationResponse.all |
|||
end |
|||
|
|||
# GET /conference_registration_responses/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /conference_registration_responses/new |
|||
def new |
|||
@conference_registration_response = ConferenceRegistrationResponse.new |
|||
end |
|||
|
|||
# GET /conference_registration_responses/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /conference_registration_responses |
|||
def create |
|||
@conference_registration_response = ConferenceRegistrationResponse.new(conference_registration_response_params) |
|||
|
|||
if @conference_registration_response.save |
|||
redirect_to @conference_registration_response, notice: 'Conference registration response was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /conference_registration_responses/1 |
|||
def update |
|||
if @conference_registration_response.update(conference_registration_response_params) |
|||
redirect_to @conference_registration_response, notice: 'Conference registration response was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /conference_registration_responses/1 |
|||
def destroy |
|||
@conference_registration_response.destroy |
|||
redirect_to conference_registration_responses_url, notice: 'Conference registration response was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_conference_registration_response |
|||
@conference_registration_response = ConferenceRegistrationResponse.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def conference_registration_response_params |
|||
params.require(:conference_registration_response).permit(:conference_registration_id, :registration_form_field_id, :data) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class ConferenceRegistrationsController < ApplicationController |
|||
before_action :set_conference_registration, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /conference_registrations |
|||
def index |
|||
@conference_registrations = ConferenceRegistration.all |
|||
end |
|||
|
|||
# GET /conference_registrations/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /conference_registrations/new |
|||
def new |
|||
@conference_registration = ConferenceRegistration.new |
|||
end |
|||
|
|||
# GET /conference_registrations/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /conference_registrations |
|||
def create |
|||
@conference_registration = ConferenceRegistration.new(conference_registration_params) |
|||
|
|||
if @conference_registration.save |
|||
redirect_to @conference_registration, notice: 'Conference registration was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /conference_registrations/1 |
|||
def update |
|||
if @conference_registration.update(conference_registration_params) |
|||
redirect_to @conference_registration, notice: 'Conference registration was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /conference_registrations/1 |
|||
def destroy |
|||
@conference_registration.destroy |
|||
redirect_to conference_registrations_url, notice: 'Conference registration was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_conference_registration |
|||
@conference_registration = ConferenceRegistration.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def conference_registration_params |
|||
params.require(:conference_registration).permit(:conference_id, :user_id, :is_attending) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class ConferenceRegistratonFormFieldsController < ApplicationController |
|||
before_action :set_conference_registraton_form_field, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /conference_registraton_form_fields |
|||
def index |
|||
@conference_registraton_form_fields = ConferenceRegistratonFormField.all |
|||
end |
|||
|
|||
# GET /conference_registraton_form_fields/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /conference_registraton_form_fields/new |
|||
def new |
|||
@conference_registraton_form_field = ConferenceRegistratonFormField.new |
|||
end |
|||
|
|||
# GET /conference_registraton_form_fields/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /conference_registraton_form_fields |
|||
def create |
|||
@conference_registraton_form_field = ConferenceRegistratonFormField.new(conference_registraton_form_field_params) |
|||
|
|||
if @conference_registraton_form_field.save |
|||
redirect_to @conference_registraton_form_field, notice: 'Conference registraton form field was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /conference_registraton_form_fields/1 |
|||
def update |
|||
if @conference_registraton_form_field.update(conference_registraton_form_field_params) |
|||
redirect_to @conference_registraton_form_field, notice: 'Conference registraton form field was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /conference_registraton_form_fields/1 |
|||
def destroy |
|||
@conference_registraton_form_field.destroy |
|||
redirect_to conference_registraton_form_fields_url, notice: 'Conference registraton form field was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_conference_registraton_form_field |
|||
@conference_registraton_form_field = ConferenceRegistratonFormField.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def conference_registraton_form_field_params |
|||
params.require(:conference_registraton_form_field).permit(:conference_id, :registration_form_field_id, :order) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class ConferenceTypesController < ApplicationController |
|||
before_action :set_conference_type, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /conference_types |
|||
def index |
|||
@conference_types = ConferenceType.all |
|||
end |
|||
|
|||
# GET /conference_types/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /conference_types/new |
|||
def new |
|||
@conference_type = ConferenceType.new |
|||
end |
|||
|
|||
# GET /conference_types/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /conference_types |
|||
def create |
|||
@conference_type = ConferenceType.new(conference_type_params) |
|||
|
|||
if @conference_type.save |
|||
redirect_to @conference_type, notice: 'Conference type was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /conference_types/1 |
|||
def update |
|||
if @conference_type.update(conference_type_params) |
|||
redirect_to @conference_type, notice: 'Conference type was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /conference_types/1 |
|||
def destroy |
|||
@conference_type.destroy |
|||
redirect_to conference_types_url, notice: 'Conference type was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_conference_type |
|||
@conference_type = ConferenceType.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def conference_type_params |
|||
params.require(:conference_type).permit(:title, :info) |
|||
end |
|||
end |
@ -0,0 +1,140 @@ |
|||
class ConferencesController < ApplicationController |
|||
before_action :set_conference, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /conferences |
|||
def index |
|||
@conferences = Conference.all |
|||
end |
|||
|
|||
# GET /conferences/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /conferences/new |
|||
def new |
|||
@conference = Conference.new |
|||
@conference.build_conference_type |
|||
end |
|||
|
|||
# GET /conferences/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /conferences |
|||
def create |
|||
@conference = Conference.new(conference_params) |
|||
|
|||
if @conference.save |
|||
redirect_to @conference, notice: 'Conference was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /conferences/1 |
|||
def update |
|||
if params[:register] |
|||
params.each do |key, value| |
|||
matches = /^field_(\d+)(_(\d+|other))?/.match(key) |
|||
if matches |
|||
x |
|||
end |
|||
end |
|||
render action: 'show' |
|||
elsif @conference.update(conference_params) |
|||
redirect_to @conference, notice: 'Conference was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
def hosts |
|||
set_conference |
|||
@conference.conference_host_organizations.build |
|||
end |
|||
|
|||
def nonhosts |
|||
set_conference |
|||
@available_orgs = Organization.where(["id NOT IN (?)", @conference.organizations.map(&:id) + (params[:added] || [])]) |
|||
html = '<h2>Select an Organization</h2><div id="select-organization-list">' |
|||
@available_orgs.each do |organization| |
|||
html += '<a href="#" class="organization-preview" data-id="' + organization.id.to_s + '"><img src="' + (organization.avatar.url :thumb) + '" /><div class="username">' + (organization.name) + '</div></a>' |
|||
end |
|||
render :text => (html + '</div>') |
|||
end |
|||
|
|||
def registration |
|||
set_conference |
|||
@sub_action = 'registration' + (params[:sub_action] ? '_' + params[:sub_action] : '') |
|||
if params[:sub_action] == 'form' |
|||
@registration_form_field = RegistrationFormField.new |
|||
@registration_form_fields = RegistrationFormField.where(["id NOT IN (?)", @conference.registration_form_fields.map(&:id)]) |
|||
end |
|||
end |
|||
|
|||
def add_field |
|||
set_conference |
|||
field = RegistrationFormField.find(params[:field]) |
|||
@conference.registration_form_fields << field |
|||
|
|||
@registration_form_fields = RegistrationFormField.where(["id NOT IN (?)", @conference.registration_form_fields.map(&:id)]) |
|||
|
|||
form = render_to_string :partial => 'registration_form_fields/conference_form' |
|||
list = render_to_string :partial => 'registration_form_fields/list' |
|||
render json: {form: form, list: list} |
|||
end |
|||
|
|||
def remove_field |
|||
set_conference |
|||
field = RegistrationFormField.find(params[:field]) |
|||
@conference.registration_form_fields.delete(field) |
|||
|
|||
@registration_form_fields = RegistrationFormField.where(["id NOT IN (?)", @conference.registration_form_fields.map(&:id)]) |
|||
|
|||
form = render_to_string :partial => 'registration_form_fields/conference_form' |
|||
list = render_to_string :partial => 'registration_form_fields/list' |
|||
render json: {form: form, list: list} |
|||
end |
|||
|
|||
def reorder |
|||
set_conference |
|||
params[:registration_form_field_id].each do |key, value| |
|||
update_field_position(value.to_i, params[:position][key].to_i) |
|||
end |
|||
render json: [].to_json |
|||
end |
|||
|
|||
def form |
|||
set_conference |
|||
end |
|||
|
|||
# DELETE /conferences/1 |
|||
def destroy |
|||
@conference.destroy |
|||
redirect_to conferences_url, notice: 'Conference was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_conference |
|||
@conference = Conference.find_by(slug: params[:slug] || params[:conference_slug]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def conference_params |
|||
params.require(:conference).permit(:title, :slug, :start_date, :end_date, :info, :poster, :cover, :workshop_schedule_published, :registration_open, :meals_provided, :meal_info, :travel_info, :conference_type_id, conference_types: [:id]) |
|||
end |
|||
|
|||
def update_field_position(field_id, position) |
|||
#ConferenceRegistrationFormField.where(:conference_id => @conference.id, :registration_form_field_id => field_id).update_all(:position => position) |
|||
data = [] |
|||
for i in 0..@conference.conference_registration_form_fields.length |
|||
f = @conference.conference_registration_form_fields[i] |
|||
if f.registration_form_field_id == field_id |
|||
data << (f.registration_form_field_id.to_s + ' == ' + field_id.to_s + ' [position: ' + position.to_s + ' == ' + f.position.to_s + ']') |
|||
f.update_attributes(:position => position) |
|||
return |
|||
end |
|||
end |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class LocationsController < ApplicationController |
|||
before_action :set_location, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /locations |
|||
def index |
|||
@locations = Location.all |
|||
end |
|||
|
|||
# GET /locations/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /locations/new |
|||
def new |
|||
@location = Location.new |
|||
end |
|||
|
|||
# GET /locations/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /locations |
|||
def create |
|||
@location = Location.new(location_params) |
|||
|
|||
if @location.save |
|||
redirect_to @location, notice: 'Location was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /locations/1 |
|||
def update |
|||
if @location.update(location_params) |
|||
redirect_to @location, notice: 'Location was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /locations/1 |
|||
def destroy |
|||
@location.destroy |
|||
redirect_to locations_url, notice: 'Location was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_location |
|||
@location = Location.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def location_params |
|||
params.require(:location).permit(:title, :address, :latitude, :longitude) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class OrganizationStatusesController < ApplicationController |
|||
before_action :set_organization_status, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /organization_statuses |
|||
def index |
|||
@organization_statuses = OrganizationStatus.all |
|||
end |
|||
|
|||
# GET /organization_statuses/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /organization_statuses/new |
|||
def new |
|||
@organization_status = OrganizationStatus.new |
|||
end |
|||
|
|||
# GET /organization_statuses/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /organization_statuses |
|||
def create |
|||
@organization_status = OrganizationStatus.new(organization_status_params) |
|||
|
|||
if @organization_status.save |
|||
redirect_to @organization_status, notice: 'Organization status was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /organization_statuses/1 |
|||
def update |
|||
if @organization_status.update(organization_status_params) |
|||
redirect_to @organization_status, notice: 'Organization status was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /organization_statuses/1 |
|||
def destroy |
|||
@organization_status.destroy |
|||
redirect_to organization_statuses_url, notice: 'Organization status was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_organization_status |
|||
@organization_status = OrganizationStatus.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def organization_status_params |
|||
params.require(:organization_status).permit(:name, :slug, :info) |
|||
end |
|||
end |
@ -0,0 +1,96 @@ |
|||
class OrganizationsController < ApplicationController |
|||
before_action :set_organization, only: [:show, :edit, :update, :destroy] |
|||
|
|||
before_filter :require_login, :except => [:index, :show] |
|||
|
|||
# GET /organizations |
|||
def index |
|||
@organizations = Organization.all |
|||
end |
|||
|
|||
# GET /organizations/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /organizations/new |
|||
def new |
|||
@organization = Organization.new |
|||
#@organization.location = Location.new |
|||
@organization.locations.build |
|||
@organization.locations_organization.build |
|||
@organization.user_organization_relationships.build |
|||
end |
|||
|
|||
# GET /organizations/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /organizations |
|||
def create |
|||
@organization = Organization.new(organization_params) |
|||
params[:organization][:locations_attributes].each do |k, v| |
|||
@organization.locations << Location.new(locations_organization_params(k)) |
|||
end |
|||
@organization.user_organization_relationship << UserOrganizationRelationship.new(:user_id => current_user.id, :relationship => UserOrganizationRelationship::Administrator) |
|||
|
|||
if @organization.save! |
|||
redirect_to @organization, notice: 'Organization was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /organizations/1 |
|||
def update |
|||
if @organization.update_attributes(organization_params) |
|||
redirect_to @organization, notice: 'Organization was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /organizations/1 |
|||
def destroy |
|||
@organization.destroy |
|||
redirect_to organizations_url, notice: 'Organization was successfully destroyed.' |
|||
end |
|||
|
|||
def members |
|||
set_organization |
|||
@organization.user_organization_relationships.build |
|||
end |
|||
|
|||
def nonmembers |
|||
set_organization |
|||
#puts "\n\tPARAMS: " + params[:addedUsers].to_json.to_s + "\n" |
|||
@available_users = User.where(["id NOT IN (?)", @organization.users.map(&:id) + (params[:added] || [])]) |
|||
html = '<h2>Select a User</h2><div id="select-user-list">' |
|||
@available_users.each do |user| |
|||
html += '<a href="#" class="user-preview" data-id="' + user.id.to_s + '"><img src="' + (user.avatar.url :thumb) + '" /><div class="username">' + (user.username) + '</div></a>' |
|||
end |
|||
render :text => (html + '</div>') |
|||
end |
|||
|
|||
def identity |
|||
set_organization |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_organization |
|||
@organization = Organization.find_by(slug: params[:slug] || params[:organization_slug]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def organization_params |
|||
params.require(:organization).permit(:name, :slug, :email_address, :url, :year_founded, :info, :logo, :avatar, :cover, :requires_approval, :secret_question, :secret_answer, user_organization_relationships_attributes: [:id, :user_id, :relationship, :_destroy], locations: [:country, :territory, :city, :street, :postal_code]) |
|||
end |
|||
|
|||
def locations_organization_params(index) |
|||
params[:organization][:locations_attributes].require(index.to_s).permit(:country, :territory, :city, :street, :postal_code) |
|||
end |
|||
|
|||
def user_organization_params(index) |
|||
params[:organization][:user_organization_relationships_attributes].require(index.to_s).permit(:user_id, :relationship) |
|||
end |
|||
end |
@ -1,6 +1,60 @@ |
|||
require 'rubygems' |
|||
require 'ruby_drupal_hash' |
|||
|
|||
include ApplicationHelper |
|||
|
|||
class PagesController < ApplicationController |
|||
|
|||
def home |
|||
@title_img = '/assets/nola.jpg' |
|||
#password = "" |
|||
#hash = "" |
|||
#@testResult = RubyDrupalHash::verify(password, hash) |
|||
end |
|||
|
|||
def translate |
|||
key = params[:translationkey] |
|||
value = params[:translationvalue] |
|||
if params[:translationhascount] == '1' |
|||
['zero', 'one', 'two', 'few', 'many'].each { |c| |
|||
if params['translationpluralization_' + c] |
|||
if !value.is_a?(Hash) |
|||
value = Hash.new |
|||
end |
|||
value[c] = params['translationvalue_' + c] |
|||
else |
|||
Translation.destroy_all(:locale => params[:translationlang], :key => (key + '.' + c)) |
|||
end |
|||
} |
|||
if value.is_a?(Hash) |
|||
value['other'] = params[:translationvalue] |
|||
Translation.destroy_all(:locale => params[:translationlang], :key => key) |
|||
else |
|||
Translation.destroy_all(:locale => params[:translationlang], :key => (key + '.other')) |
|||
end |
|||
end |
|||
store_translations(params[:translationlang], {key => value}, :escape => false) |
|||
begin |
|||
render json: {success: true, key: key, jkey: key.gsub('.', '--'), translation: I18n.translate!(key, {:raise => false})} |
|||
rescue |
|||
render json: {error: 'Failed to load translation'} |
|||
end |
|||
end |
|||
|
|||
def location_territories |
|||
#render json: (Carmen:::RegionCollection.new(Carmen::Country.coded(params[:country])) || []).to_json |
|||
territories = {} |
|||
Carmen::Country.coded(params[:country]).subregions.each { |t| territories[t.code] = t.name } |
|||
render json: territories.to_json |
|||
end |
|||
|
|||
private |
|||
def store_translations(locale, data, options = {}) |
|||
escape = options.fetch(:escape, true) |
|||
I18n.backend.flatten_translations(locale, data, escape, false).each do |key, value| |
|||
t = Translation.find_or_create_by!(locale: locale.to_s, key: key.to_s) |
|||
t.value = value |
|||
t.save |
|||
end |
|||
I18n.backend.reload! |
|||
end |
|||
end |
|||
|
@ -0,0 +1,66 @@ |
|||
class RegistrationFormFieldsController < ApplicationController |
|||
before_action :set_registration_form_field, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /registration_form_fields |
|||
def index |
|||
@registration_form_fields = RegistrationFormField.all |
|||
end |
|||
|
|||
# GET /registration_form_fields/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /registration_form_fields/new |
|||
def new |
|||
@registration_form_field = RegistrationFormField.new |
|||
end |
|||
|
|||
# GET /registration_form_fields/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /registration_form_fields |
|||
def create |
|||
@registration_form_field = RegistrationFormField.new(registration_form_field_params) |
|||
ajax_return(@registration_form_field.save) |
|||
end |
|||
|
|||
# PATCH/PUT /registration_form_fields/1 |
|||
def update |
|||
ajax_return(@registration_form_field.update(registration_form_field_params)) |
|||
end |
|||
|
|||
# DELETE /registration_form_fields/1 |
|||
def destroy |
|||
@registration_form_field.destroy |
|||
redirect_to registration_form_fields_url, notice: 'Registration form field was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
def ajax_return(success) |
|||
@registration_form_fields = RegistrationFormField.all |
|||
if success |
|||
@registration_form_field = RegistrationFormField.new |
|||
end |
|||
|
|||
form = render_to_string :partial => 'form' |
|||
list = render_to_string :partial => 'list' |
|||
render json: {form: form, list: list} |
|||
end |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_registration_form_field |
|||
@registration_form_field = RegistrationFormField.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def registration_form_field_params |
|||
#type = params[:type] |
|||
#allowed = RegistrationFormField::Types[type] |
|||
#allowed << 'field_type' |
|||
rff_params = params.require(:registration_form_field) |
|||
allowed = RegistrationFormField::GetNonOptionKeys(rff_params[:field_type], rff_params) |
|||
p = rff_params.send('permit', *allowed)#permit(:title, :help, :required, :field_type, :options, :is_retired) |
|||
p[:options] = RegistrationFormField::GetOptions(rff_params[:field_type], rff_params).to_json.to_s |
|||
p |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class UserOrganizationRelationshipsController < ApplicationController |
|||
before_action :set_user_organization_relationship, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /user_organization_relationships |
|||
def index |
|||
@user_organization_relationships = UserOrganizationRelationship.all |
|||
end |
|||
|
|||
# GET /user_organization_relationships/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /user_organization_relationships/new |
|||
def new |
|||
@user_organization_relationship = UserOrganizationRelationship.new |
|||
end |
|||
|
|||
# GET /user_organization_relationships/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /user_organization_relationships |
|||
def create |
|||
@user_organization_relationship = UserOrganizationRelationship.new(user_organization_relationship_params) |
|||
|
|||
if @user_organization_relationship.save |
|||
redirect_to @user_organization_relationship, notice: 'User organization relationship was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /user_organization_relationships/1 |
|||
def update |
|||
if @user_organization_relationship.update(user_organization_relationship_params) |
|||
redirect_to @user_organization_relationship, notice: 'User organization relationship was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /user_organization_relationships/1 |
|||
def destroy |
|||
@user_organization_relationship.destroy |
|||
redirect_to user_organization_relationships_url, notice: 'User organization relationship was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_user_organization_relationship |
|||
@user_organization_relationship = UserOrganizationRelationship.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def user_organization_relationship_params |
|||
params.require(:user_organization_relationship).permit(:user_id, :organization_id, :relationship) |
|||
end |
|||
end |
@ -0,0 +1,21 @@ |
|||
class UserSessionsController < ApplicationController |
|||
def new |
|||
session[:return_to] ||= request.referer |
|||
@user = User.new |
|||
end |
|||
|
|||
def create |
|||
if @user = login(params[:email], params[:password]) |
|||
#redirect_back_or_to(:users, notice: 'Login successful') |
|||
redirect_to session.delete(:return_to) |
|||
else |
|||
flash.now[:alert] = "Login failed" |
|||
render action: "new" |
|||
end |
|||
end |
|||
|
|||
def destroy |
|||
logout |
|||
redirect_to(:users, notice: 'Logged out!') |
|||
end |
|||
end |
@ -0,0 +1,68 @@ |
|||
include ApplicationHelper |
|||
|
|||
class UsersController < ApplicationController |
|||
before_action :set_user, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /users |
|||
def index |
|||
@users = User.all |
|||
end |
|||
|
|||
# GET /users/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /users/new |
|||
def new |
|||
@user = User.new |
|||
end |
|||
|
|||
# GET /users/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /users |
|||
def create |
|||
@user = User.new(user_params) |
|||
|
|||
if @user.save |
|||
redirect_to @user, notice: 'User was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /users/1 |
|||
def update |
|||
#if !user_params[:password] || user_params[:password].length < 1 |
|||
# puts "\nNo Password! ( " + @user.to_json.to_s + " \n" |
|||
# user_params[:password] = user_params[:password_confirmation] = 'Oha1otbt!@#' |
|||
#end |
|||
if @user.update(user_params) |
|||
redirect_to @user, notice: 'User was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /users/1 |
|||
def destroy |
|||
@user.destroy |
|||
redirect_to users_url, notice: 'User was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_user |
|||
@user = User.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def session_params |
|||
params.require(:user).permit(:username, :email, :password, :avatar, :avatar_cache) |
|||
end |
|||
|
|||
def user_params |
|||
params.require(:user).permit(:username, :email, :password, :password_confirmation, :avatar, :avatar_cache, :remove_avatar) |
|||
end |
|||
end |
@ -0,0 +1,2 @@ |
|||
class VersionsController < ApplicationController |
|||
end |
@ -0,0 +1,58 @@ |
|||
class WorkshopPresentationStylesController < ApplicationController |
|||
before_action :set_workshop_presentation_style, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /workshop_presentation_styles |
|||
def index |
|||
@workshop_presentation_styles = WorkshopPresentationStyle.all |
|||
end |
|||
|
|||
# GET /workshop_presentation_styles/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /workshop_presentation_styles/new |
|||
def new |
|||
@workshop_presentation_style = WorkshopPresentationStyle.new |
|||
end |
|||
|
|||
# GET /workshop_presentation_styles/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /workshop_presentation_styles |
|||
def create |
|||
@workshop_presentation_style = WorkshopPresentationStyle.new(workshop_presentation_style_params) |
|||
|
|||
if @workshop_presentation_style.save |
|||
redirect_to @workshop_presentation_style, notice: 'Workshop presentation style was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /workshop_presentation_styles/1 |
|||
def update |
|||
if @workshop_presentation_style.update(workshop_presentation_style_params) |
|||
redirect_to @workshop_presentation_style, notice: 'Workshop presentation style was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /workshop_presentation_styles/1 |
|||
def destroy |
|||
@workshop_presentation_style.destroy |
|||
redirect_to workshop_presentation_styles_url, notice: 'Workshop presentation style was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_workshop_presentation_style |
|||
@workshop_presentation_style = WorkshopPresentationStyle.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def workshop_presentation_style_params |
|||
params.require(:workshop_presentation_style).permit(:name, :slug, :info) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class WorkshopResourcesController < ApplicationController |
|||
before_action :set_workshop_resource, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /workshop_resources |
|||
def index |
|||
@workshop_resources = WorkshopResource.all |
|||
end |
|||
|
|||
# GET /workshop_resources/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /workshop_resources/new |
|||
def new |
|||
@workshop_resource = WorkshopResource.new |
|||
end |
|||
|
|||
# GET /workshop_resources/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /workshop_resources |
|||
def create |
|||
@workshop_resource = WorkshopResource.new(workshop_resource_params) |
|||
|
|||
if @workshop_resource.save |
|||
redirect_to @workshop_resource, notice: 'Workshop resource was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /workshop_resources/1 |
|||
def update |
|||
if @workshop_resource.update(workshop_resource_params) |
|||
redirect_to @workshop_resource, notice: 'Workshop resource was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /workshop_resources/1 |
|||
def destroy |
|||
@workshop_resource.destroy |
|||
redirect_to workshop_resources_url, notice: 'Workshop resource was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_workshop_resource |
|||
@workshop_resource = WorkshopResource.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def workshop_resource_params |
|||
params.require(:workshop_resource).permit(:name, :slug, :info) |
|||
end |
|||
end |
@ -0,0 +1,58 @@ |
|||
class WorkshopStreamsController < ApplicationController |
|||
before_action :set_workshop_stream, only: [:show, :edit, :update, :destroy] |
|||
|
|||
# GET /workshop_streams |
|||
def index |
|||
@workshop_streams = WorkshopStream.all |
|||
end |
|||
|
|||
# GET /workshop_streams/1 |
|||
def show |
|||
end |
|||
|
|||
# GET /workshop_streams/new |
|||
def new |
|||
@workshop_stream = WorkshopStream.new |
|||
end |
|||
|
|||
# GET /workshop_streams/1/edit |
|||
def edit |
|||
end |
|||
|
|||
# POST /workshop_streams |
|||
def create |
|||
@workshop_stream = WorkshopStream.new(workshop_stream_params) |
|||
|
|||
if @workshop_stream.save |
|||
redirect_to @workshop_stream, notice: 'Workshop stream was successfully created.' |
|||
else |
|||
render action: 'new' |
|||
end |
|||
end |
|||
|
|||
# PATCH/PUT /workshop_streams/1 |
|||
def update |
|||
if @workshop_stream.update(workshop_stream_params) |
|||
redirect_to @workshop_stream, notice: 'Workshop stream was successfully updated.' |
|||
else |
|||
render action: 'edit' |
|||
end |
|||
end |
|||
|
|||
# DELETE /workshop_streams/1 |
|||
def destroy |
|||
@workshop_stream.destroy |
|||
redirect_to workshop_streams_url, notice: 'Workshop stream was successfully destroyed.' |
|||
end |
|||
|
|||
private |
|||
# Use callbacks to share common setup or constraints between actions. |
|||
def set_workshop_stream |
|||
@workshop_stream = WorkshopStream.find(params[:id]) |
|||
end |
|||
|
|||
# Only allow a trusted parameter "white list" through. |
|||
def workshop_stream_params |
|||
params.require(:workshop_stream).permit(:name, :slug, :info) |
|||
end |
|||
end |
@ -1,9 +1,480 @@ |
|||
module ApplicationHelper |
|||
@@keyQueue = nil |
|||
@@translationsOnThisPage = nil |
|||
@@lastTranslation = nil |
|||
@@allTranslations = nil |
|||
@@no_banner = true |
|||
|
|||
def ThereAreTranslationsOnThisPage? |
|||
@@translationsOnThisPage |
|||
end |
|||
|
|||
def get_all_translations |
|||
@@allTranslations |
|||
end |
|||
|
|||
def title(page_title) |
|||
content_for(:title) { page_title.to_s } |
|||
end |
|||
|
|||
def banner_image(banner_image) |
|||
@@no_banner = false |
|||
content_for(:banner_image) { banner_image.to_s } |
|||
end |
|||
|
|||
def banner_attrs(banner_image) |
|||
if banner_image.length > 0 |
|||
return {style: 'background-image: url(' + banner_image + ');', class: 'has-image' } |
|||
end |
|||
{class: 'no-image'} |
|||
end |
|||
|
|||
def has_banner? |
|||
!@@no_banner |
|||
end |
|||
|
|||
def banner_title(banner_title) |
|||
@@no_banner = false |
|||
content_for(:banner) { ('<div class="row"><h1>' + banner_title.to_s + '</h1></div>').html_safe } |
|||
end |
|||
|
|||
def page_style(style) |
|||
classes = ['page-style-' + style.to_s] |
|||
if @@no_banner |
|||
classes << 'no-banner' |
|||
end |
|||
if ThereAreTranslationsOnThisPage? |
|||
classes << 'has-translations' |
|||
end |
|||
if params[:controller] |
|||
classes << params[:controller] |
|||
|
|||
if params[:action] |
|||
classes << params[:controller] + '-' + params[:action] |
|||
end |
|||
end |
|||
content_for(:page_style) { classes.join(' ') } |
|||
end |
|||
|
|||
def yield_or_default(section, default = '') |
|||
content_for?(section) ? content_for(section) : default |
|||
end |
|||
|
|||
def _lorem_ipsum(method, size) |
|||
options = {:random => true} |
|||
case method.to_s |
|||
when 'c', 'char', 'character', 'characters' |
|||
if size |
|||
return Forgery::LoremIpsum.characters size, options |
|||
end |
|||
return Forgery::LoremIpsum.character, options |
|||
when 'w', 'word', 'words' |
|||
if size |
|||
return Forgery::LoremIpsum.words size, options |
|||
end |
|||
#return'LOREM' |
|||
return Forgery::LoremIpsum.word options |
|||
when 's', 'sentence', 'sentences' |
|||
if size |
|||
return Forgery::LoremIpsum.sentences size, options |
|||
end |
|||
return Forgery::LoremIpsum.sentence options |
|||
when 'p', 'paragraph', 'paragraphs' |
|||
if size |
|||
return Forgery::LoremIpsum.paragraphs size, options.merge({:sentences => 10}) |
|||
end |
|||
return Forgery::LoremIpsum.sentences 10, options |
|||
when 't', 'title' |
|||
return Forgery::LoremIpsum.sentences 1, options |
|||
end |
|||
return nil |
|||
end |
|||
|
|||
def _(key, behavior = nil, behavior_size = nil, fake: nil, vars: {}, html: nil, blockData: {}, &block) |
|||
|
|||
queued_keys = nil |
|||
result = nil |
|||
|
|||
if key.kind_of?(Hash) |
|||
blockData.merge!(key) |
|||
key = key.keys |
|||
end |
|||
|
|||
if block_given? |
|||
@@keyQueue ||= Array.new |
|||
|
|||
if key.kind_of?(Array) |
|||
@@keyQueue += key |
|||
else |
|||
@@keyQueue << key |
|||
end |
|||
end |
|||
|
|||
if key.kind_of?(Array) |
|||
new_key = key.shift |
|||
if key.count > 0 |
|||
queued_keys = key.dup |
|||
end |
|||
key = new_key |
|||
end |
|||
|
|||
if blockData[key] |
|||
behavior = blockData[key][:behavior] || nil |
|||
behavior_size = blockData[key][:behavior_size] || nil |
|||
vars = blockData[key][:vars] || {} |
|||
end |
|||
|
|||
@@lastTranslation = nil |
|||
generate_control = _can_translate? |
|||
|
|||
translation = _do_translate(key, vars, behavior, behavior_size) |
|||
|
|||
if block_given? |
|||
html = capture(&block) |
|||
end |
|||
|
|||
if html |
|||
translation['html'] = html.gsub('%' + key + '%', translation['untranslated']) |
|||
end |
|||
|
|||
if generate_control |
|||
@@lastTranslation = translation |
|||
@@allTranslations ||= Hash.new |
|||
@@allTranslations[key] = key |
|||
|
|||
result = _translate_me(translation) |
|||
end |
|||
|
|||
result ||= translation['html'] || translation['untranslated'] |
|||
|
|||
if queued_keys |
|||
return _ queued_keys, behavior, behavior_size, vars: vars, html: result, blockData: blockData |
|||
end |
|||
|
|||
return result |
|||
end |
|||
|
|||
def _translate_me(translation) |
|||
@@translationsOnThisPage = true |
|||
datakeys = '' |
|||
translation['vars'].each { |key, value| datakeys += ' data-var-' + key.to_s + '="' + value.to_s.gsub('"', '"') + '"' } |
|||
('<span class="translate-me ' + (translation['is_translated'] ? '' : 'un') + 'translated lang-' + (translation['lang']) + ' key--' + translation['key'].gsub('.', '--') + '" data-translate-key="' + translation['key'] + '" data-translate-untranslated="' + translation['untranslated'].gsub('"', '"') + (translation['translated'] ? '" data-translate-translated="' + translation['translated'] : '') + '" data-vars="' + (translation['vars'].length ? translation['vars'].to_json.gsub('"', '"') : '') + '" title="' + ('translate.alt_click') + '">' + (translation['html'] || translation['untranslated']) + '</span>').to_s.html_safe |
|||
end |
|||
|
|||
def _do_translate(key, vars, behavior, behavior_size) |
|||
translation = {'key' => key, 'lang' => '0', 'vars' => vars} |
|||
v = vars.dup |
|||
begin |
|||
v[:raise] = true |
|||
translation['untranslated'] = I18n.translate!(key, v) |
|||
translation['lang'] = I18n.locale.to_s |
|||
translation['is_translated'] = true |
|||
|
|||
hash = Hash.new |
|||
translations = Translation.where(["locale = ? AND key LIKE ?", I18n.locale, key + '%']).take(6).each { |o| hash[o.key] = o.value } |
|||
translation['translated'] = hash.to_json.gsub('"', '"') |
|||
rescue I18n::MissingTranslationData |
|||
begin |
|||
translation['untranslated'] = I18n.translate!(config.i18n.default_locale, key, vars) |
|||
translation['lang'] = config.i18n.default_locale.to_s |
|||
rescue |
|||
puts _lorem_ipsum(behavior, behavior_size) |
|||
translation['untranslated'] = behavior ? _lorem_ipsum(behavior, behavior_size) || key.gsub(/^.*\.(.+)?$/, '\1') : key.gsub(/^.*\.(.+)?$/, '\1') |
|||
end |
|||
end |
|||
return translation |
|||
end |
|||
|
|||
def _can_translate?() |
|||
false |
|||
end |
|||
|
|||
def _!() |
|||
if @@keyQueue |
|||
return '%' + @@keyQueue.shift + '%' |
|||
end |
|||
end |
|||
|
|||
def _?() |
|||
if @@keyQueue |
|||
return '%' + @@keyQueue[0] + '%' |
|||
end |
|||
end |
|||
|
|||
def field(form, name, type = nil, param = nil, html: nil, help: false, attrs: [], classes: nil, label: nil, placeholder: nil) |
|||
|
|||
if form.is_a?(Symbol) || form.is_a?(String) |
|||
param = type |
|||
type = name |
|||
name = form |
|||
form = nil |
|||
end |
|||
|
|||
if attrs && !attrs.is_a?(Array) |
|||
attrs = [attrs] |
|||
end |
|||
|
|||
attrs_used = 0 |
|||
|
|||
root = 'div' |
|||
|
|||
lang_key = "form.#{name.to_s}" |
|||
if form |
|||
lang_key = form.object.class.name.underscore.pluralize + '.' + lang_key |
|||
elsif params[:controller] |
|||
lang_key = params[:controller] + '.' + lang_key |
|||
end |
|||
|
|||
select_prompt = nil |
|||
show_label = true |
|||
label_after = true |
|||
|
|||
if /select(_tag)?$/.match(type.to_s) |
|||
placeholder = nil |
|||
if !label |
|||
select_prompt = 'Select a ' + name.to_s |
|||
label_html = '' |
|||
show_label = false |
|||
end |
|||
label_after = false |
|||
if param && param.is_a?(Array) |
|||
param = options_for_select(param) |
|||
end |
|||
elsif type.to_s == 'image_field' || type.to_s == 'user_select_field' || type.to_s == 'organization_select_field' |
|||
placeholder = nil |
|||
label_html = '' |
|||
show_label = false |
|||
else |
|||
if /^password/.match(type.to_s) |
|||
placeholder = nil |
|||
elsif !placeholder |
|||
placeholder = 'Type in a ' + name.to_s |
|||
end |
|||
end |
|||
|
|||
if show_label |
|||
label_html = eval("(" + (form ? 'form.label' : 'label_tag') + " name, '<span>#{label ? CGI.escapeHTML(label) : name}</span>'.html_safe)") |
|||
end |
|||
|
|||
if label === false |
|||
label_html = '' |
|||
end |
|||
|
|||
if /text_area(_tag)?$/.match(type.to_s) |
|||
root = nil |
|||
end |
|||
|
|||
html_options = nil |
|||
if html |
|||
html_options = '' |
|||
html.each do |key, v| |
|||
html_options += ', ' + key.to_s + ": html[:" + key.to_s + "]" |
|||
end |
|||
end |
|||
|
|||
if classes |
|||
if classes.is_a?(String) |
|||
classes = [classes] |
|||
end |
|||
else |
|||
classes = [] |
|||
end |
|||
|
|||
if type == :image_field |
|||
form_html = form.label name do |
|||
('<div>' + image_tag(param || 'http://placehold.it/300x300&text=Click%20to%20upload%20an%20Image') + (form.file_field name) + (form.hidden_field (name.to_s + '_cache')) + '</div><span><span>' + name.to_s + '</span></span>').html_safe |
|||
end |
|||
elsif type == :user_select_field |
|||
form_html = form.hidden_field(:id, { class: 'id' }).html_safe |
|||
form_html += form.check_box(:_destroy).html_safe |
|||
form_html += form.label(:_destroy, '×').html_safe |
|||
form_html += form.hidden_field(:user_id, { class: 'user-id'} ).html_safe |
|||
if param && param.id |
|||
form_html += image_tag(param.avatar.url :thumb).html_safe + ('<div class="username">' + param.username + '</div>').html_safe |
|||
if attrs && attrs.length > 0 && attrs[0].is_a?(UserOrganizationRelationship) |
|||
form_html += form.select(:relationship, options_for_select(UserOrganizationRelationship::AllRelationships, attrs[0].relationship), {}, {class: 'small'}).html_safe |
|||
attrs_used += 1 |
|||
end |
|||
else |
|||
classes << 'new' |
|||
if attrs && attrs.length > 0 && attrs[0].is_a?(UserOrganizationRelationship) |
|||
form_html += ('<a href="#" class="select-user" data-url="' + url_for(attrs[0].organization) + '">' + image_tag('http://placehold.it/120x120&text=%252B').html_safe + '</a><div class="username"></div>').html_safe |
|||
form_html += form.select(:relationship, options_for_select(UserOrganizationRelationship::AllRelationships, UserOrganizationRelationship::DefaultRelationship), {}, {class: 'small'}).html_safe |
|||
attrs_used += 1 |
|||
end |
|||
end |
|||
elsif type == :organization_select_field |
|||
form_html = form.hidden_field(:id, { class: 'id' }).html_safe |
|||
form_html += form.check_box(:_destroy).html_safe |
|||
form_html += form.label(:_destroy, '×').html_safe |
|||
form_html += form.hidden_field(:organization_id, { class: 'organzation-id'} ).html_safe |
|||
if param && param.id |
|||
form_html += image_tag(param.avatar.url :thumb).html_safe + ('<div class="organizationname">' + param.name + '</div>').html_safe |
|||
else |
|||
classes << 'new' |
|||
form_html += ('<a href="#" class="select-organization" data-url="' + url_for(param) + '">' + image_tag('http://placehold.it/120x120&text=%252B').html_safe + '</a><div class="organizationname"></div>').html_safe |
|||
end |
|||
else |
|||
ph = '' |
|||
if placeholder |
|||
if form |
|||
ph = ", :placeholder => '#{placeholder}'" |
|||
else |
|||
ph = ", nil, placeholder: '#{placeholder}'" |
|||
end |
|||
end |
|||
form_html = (form ? "form.#{type} :#{name}" : "#{type} :#{name}") + ph + (param ? ', param' : '') |
|||
attrs.each_index { |i| form_html += (i >= attrs_used ? ', attrs[' + i.to_s + ']' : '') } |
|||
if select_prompt |
|||
if form |
|||
form_html += ', {prompt: select_prompt}' |
|||
else |
|||
form_html += ', prompt: select_prompt' |
|||
end |
|||
end |
|||
form_html += (html_options || '') |
|||
puts "\n\t" + form_html + "\n" |
|||
form_html = eval(form_html) |
|||
if root |
|||
form_html = "<#{root}>" + form_html + "</#{root}>" |
|||
end |
|||
end |
|||
|
|||
if help |
|||
form_html = ('<p>' + (_ (lang_key + '.help'), :w, 20) + '</p>').html_safe + form_html.html_safe |
|||
end |
|||
|
|||
return ("<div class=\"field #{type.to_s.gsub('_', '-').gsub(/\-tag$/, '')} field-#{name.to_s.gsub('_', '-')}#{classes.length > 0 ? ' ' + classes.join(' ') : ''}\">" + (label_after ? '' : label_html) + form_html + (label_after ? label_html : '') + "</div>").html_safe |
|||
end |
|||
|
|||
def actions(action) |
|||
('<div class="actions"><button name="' + action.to_s + '" type="submit">' + action.to_s + '</button></div>').html_safe |
|||
end |
|||
|
|||
def sortable(objects, id = 'id', url: nil, &block) |
|||
result = '<ul class="sortable sortable-' + objects[0].class.name.underscore.gsub('_', '-') + (url ? ('" data-url="' + url) : '') + '" data-id="' + id + '">' |
|||
objects.each_index do |i| |
|||
@this = objects[i] |
|||
result += '<li class="sortable-item">' |
|||
result += hidden_field_tag (id + "[#{i}]"), objects[i][id] |
|||
result += hidden_field_tag ('position' + "[#{i}]"), i, :class => 'sortable-position' |
|||
if block_given? |
|||
result += capture(objects[i], &block) |
|||
end |
|||
result += '</li>' |
|||
end |
|||
result += '</div>' |
|||
result.html_safe |
|||
end |
|||
|
|||
def tabs object, tabs |
|||
type = object.class.name.downcase |
|||
tab_list = '' |
|||
|
|||
tabs.each do |tab| |
|||
link = nil |
|||
if self.respond_to?(type + '_' + tab.to_s + '_path') |
|||
link = self.send(type + '_' + tab.to_s + '_path', object) |
|||
elsif self.respond_to?(tab.to_s + '_' + type + '_path') |
|||
link = self.send(tab.to_s + '_' + type + '_path', object) |
|||
end |
|||
|
|||
c = ['tab', 'tab-' + (link ? tab.to_s : 'show')] |
|||
if params[:action] == tab.to_s |
|||
c << 'current' |
|||
end |
|||
tab_list += link_to tab, link || object, :class => c |
|||
end |
|||
('<nav class="row centered"> |
|||
<div class="tabs">' + |
|||
tab_list + |
|||
'</div> |
|||
</nav>').html_safe |
|||
end |
|||
|
|||
def tabs! |
|||
object = nil |
|||
tabs = nil |
|||
case params[:controller] |
|||
when 'organizations' |
|||
object = @organization |
|||
tabs = OrganizationsHelper::TABS |
|||
when 'conferences' |
|||
object = @conference |
|||
tabs = ConferencesHelper::TABS |
|||
end |
|||
|
|||
if object && tabs |
|||
return tabs object, tabs |
|||
end |
|||
end |
|||
|
|||
def sub_tabs object, tabs |
|||
type = object.class.name.downcase |
|||
tab_list = '' |
|||
|
|||
tabs.each do |tab| |
|||
link = nil |
|||
if self.respond_to?(type + '_' + tab.to_s + '_path') |
|||
link = self.send(type + '_' + tab.to_s + '_path', object) |
|||
elsif self.respond_to?(tab.to_s + '_' + type + '_path') |
|||
link = self.send(tab.to_s + '_' + type + '_path', object) |
|||
end |
|||
|
|||
c = ['sub-tab', 'sub-tab-' + (link ? tab.to_s : 'show')] |
|||
if current_page?(link) |
|||
c << 'current' |
|||
end |
|||
tab_list += link_to tab, link || object, :class => c |
|||
end |
|||
('<nav class="sub-tabs">' + tab_list + '</nav>').html_safe |
|||
end |
|||
|
|||
def sub_tabs! |
|||
object = nil |
|||
tabs = nil |
|||
case params[:controller] |
|||
when 'organizations' |
|||
object = @organization |
|||
tabs = OrganizationsHelper::SUB_TABS |
|||
when 'conferences' |
|||
object = @conference |
|||
tabs = ConferencesHelper::SUB_TABS |
|||
end |
|||
|
|||
if object && tabs |
|||
return sub_tabs object, tabs |
|||
end |
|||
end |
|||
|
|||
def p(object, attribute) |
|||
('<p>' + object.send(attribute.to_s).strip.gsub(/\s*\n+\s*/, '</p><p>') + '</p>').html_safe |
|||
end |
|||
|
|||
def form_field(f) |
|||
id = 'field_' + f.id.to_s |
|||
html = p(f, 'title')#'<label for="' + id + '">' + f.title + '</label>' |
|||
|
|||
options = JSON.parse(f.options) |
|||
if f.field_type == 'multiple' |
|||
if f.help |
|||
html += ('<div class="help">' + p(f, 'help') + '</div>').html_safe |
|||
end |
|||
|
|||
opts = Hash.new |
|||
options['options'].split(/\s*\n\s*/).each do |value| |
|||
kv = value.split(/\s*\|\s*/, 2) |
|||
opts[kv[0]] = kv[1] |
|||
end |
|||
opts.each do |key, value| |
|||
#html += self.send(options['selection_type'] + '_tag', 'field-' + id) |
|||
html += field((id + '_' + key), options['selection_type'] + '_tag', label: value) |
|||
end |
|||
else |
|||
html += field(id.to_sym, options['input_type'] + '_tag', label: false, placeholder: f.help) |
|||
end |
|||
|
|||
html.html_safe |
|||
end |
|||
|
|||
end |
|||
|
@ -0,0 +1,2 @@ |
|||
module ConferenceAdminsHelper |
|||
end |
@ -0,0 +1,2 @@ |
|||
module ConferenceHostOrganizationsHelper |
|||
end |
@ -0,0 +1,2 @@ |
|||
module ConferenceRegistrationResponsesHelper |
|||
end |
@ -0,0 +1,2 @@ |
|||
module ConferenceRegistrationsHelper |
|||
end |
@ -0,0 +1,2 @@ |
|||
module ConferenceRegistratonFormFieldsHelper |
|||
end |
@ -0,0 +1,2 @@ |
|||
module ConferenceTypesHelper |
|||
end |
@ -0,0 +1,4 @@ |
|||
module ConferencesHelper |
|||
TABS = [:show, :edit, :hosts, :workshops, :schedule, :registration] |
|||
SUB_TABS = [:registration, :registration_form, :registration_register, :registration_stats] |
|||
end |
@ -0,0 +1,2 @@ |
|||
module LocationsHelper |
|||
end |
@ -0,0 +1,2 @@ |
|||
module OrganizationStatusesHelper |
|||
end |
@ -0,0 +1,3 @@ |
|||
module OrganizationsHelper |
|||
TABS = [:show, :edit, :members, :identity, :settings] |
|||
end |
@ -0,0 +1,3 @@ |
|||
module PagesHelper |
|||
|
|||
end |
@ -0,0 +1,2 @@ |
|||
module RegistrationFormFieldsHelper |
|||
end |