diff --git a/app/assets/fonts/ahg.eot b/app/assets/fonts/ahg.eot new file mode 100644 index 0000000..9be536f Binary files /dev/null and b/app/assets/fonts/ahg.eot differ diff --git a/app/assets/fonts/ahg.svg b/app/assets/fonts/ahg.svg new file mode 100644 index 0000000..51213a8 --- /dev/null +++ b/app/assets/fonts/ahg.svg @@ -0,0 +1,344 @@ + + + \ No newline at end of file diff --git a/app/assets/fonts/ahg.ttf b/app/assets/fonts/ahg.ttf new file mode 100644 index 0000000..7986476 Binary files /dev/null and b/app/assets/fonts/ahg.ttf differ diff --git a/app/assets/fonts/ahg.woff b/app/assets/fonts/ahg.woff new file mode 100644 index 0000000..98af99d Binary files /dev/null and b/app/assets/fonts/ahg.woff differ diff --git a/app/assets/fonts/stylesheet.css b/app/assets/fonts/stylesheet.css new file mode 100644 index 0000000..d798597 --- /dev/null +++ b/app/assets/fonts/stylesheet.css @@ -0,0 +1,15 @@ +/* Generated by Font Squirrel (http://www.fontsquirrel.com) on June 29, 2014 */ + + + +@font-face { + font-family: 'Alte Haas Grotesk'; + src: url('altehaasgroteskbold-webfont.eot'); + src: url('altehaasgroteskbold-webfont.eot?#iefix') format('embedded-opentype'), + url('altehaasgroteskbold-webfont.woff') format('woff'), + url('altehaasgroteskbold-webfont.ttf') format('truetype'), + url('altehaasgroteskbold-webfont.svg#alte_haas_groteskbold') format('svg'); + font-weight: normal; + font-style: normal; + +} \ No newline at end of file diff --git a/app/assets/images/Thumbs.db b/app/assets/images/Thumbs.db index a7df432..a26d43f 100644 Binary files a/app/assets/images/Thumbs.db and b/app/assets/images/Thumbs.db differ diff --git a/app/assets/images/logo-text.png b/app/assets/images/logo-text.png new file mode 100644 index 0000000..e35555c Binary files /dev/null and b/app/assets/images/logo-text.png differ diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png new file mode 100644 index 0000000..25f4f38 Binary files /dev/null and b/app/assets/images/logo.png differ diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index aaa3a37..3ecc9f6 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -163,7 +163,13 @@ startTranslating = ($td) -> return $ -> - $(document).foundation(); + trial = document.createElement('script'); + trial.type = 'text/javascript'; + trial.async = true; + trial.src = 'http://easy.myfonts.net/v2/js?sid=158991(font-family=Scotch+Modern+Bold)&sid=174040(font-family=Scotch+Micro)&key=WPfecRji9L'; + head = document.getElementsByTagName("head")[0]; + head.appendChild(trial); + #$(document).foundation(); $('.field.country-select select').change () -> $country = $(this) country = $country.val() diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 6949aff..a521475 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -10,16 +10,25 @@ * */ - -// Fonts and other external imports -@import url(http://fonts.googleapis.com/css?family=Fjalla+One); -@import url(http://fonts.googleapis.com/css?family=Cantarell:400,700,400italic,700italic); +@font-face { + font-family: 'alte_haas_groteskbold'; + src: url('/assets/ahg.eot'); + src: url('/assets/ahg.eot?#iefix') format('embedded-opentype'), + url('/assets/ahg.woff') format('woff'), + url('/assets/ahg.ttf') format('truetype'), + url('/assets/ahg.svg#alte_haas_groteskbold') format('svg'); + font-weight: normal; + font-style: normal; +} // Libraries @import "compass"; @import "foundation_and_overrides"; // Local settings (also edit foundation_and_overrides.scss to modify global variables) +@import "sass/mixins"; @import "sass/layout"; @import "sass/typography"; @import "sass/base"; + +#mfPreviewBarShow, #mfPreviewBar { display: none; } \ No newline at end of file diff --git a/app/assets/stylesheets/foundation_and_overrides.scss b/app/assets/stylesheets/foundation_and_overrides.scss index 641ec4e..db1b3c7 100644 --- a/app/assets/stylesheets/foundation_and_overrides.scss +++ b/app/assets/stylesheets/foundation_and_overrides.scss @@ -37,8 +37,8 @@ // We use these to control header font styles //$header-font-family: 'ff-ernestine-web-pro', sans-serif;//join("Open Sans", $body-font-family); -$header-font-family: 'freight-sans-pro', sans-serif;//join("Open Sans", $body-font-family); -$header-font-weight: 800; +$header-font-family: 'Alte Haas Grotesk', sans-serif;//join("Open Sans", $body-font-family); +$header-font-weight: bold; // $header-font-style: normal; // $header-font-color: #222; // $header-line-height: 1.4; @@ -46,23 +46,25 @@ $header-font-weight: 800; // $header-bottom-margin: .5rem; // $header-text-rendering: optimizeLegibility; -$color-1: #053E8D; // blue -$color-2: #94A427; // green -$color-4: #F4921B; // dark-orange -$color-3: #F4A71C; // light orange -$color-5: #DC3637; // red +$color-1: #00ACEE; // blue +$color-2: #A0C700; // green +$color-3: #F11845; // pink +$color-4: #FFCC00; // yellow +$color-5: #D3BE9B; // beige -$organization-color: $color-2; // red +$conference-color: $color-1; +$organization-color: $color-2; +$article-color: $color-3; //$white: #EEEEE0; -$white: #FFFFF0; -$black: #333; +$white: #FFF; +$black: #393939; $gray: #E1E1E1; // We use these to control various global styles -$body-bg: $black; +$body-bg: $white; $body-font-color: $black; -$body-font-family: 'freight-micro-pro', Helvetica, Arial, sans-serif; +$body-font-family: 'Scotch Micro', serif; // $body-font-weight: normal; // $body-font-style: normal; @@ -78,8 +80,8 @@ $primary-color: $color-1; $secondary-color: $color-2; $alert-color: $color-4; $success-color: $color-2; -$warning-color: $color-5; -$info-color: $color-3; +$warning-color: $color-3; +$info-color: $color-5; // We use these to make sure border radius matches unless we want it different. // $global-radius: 3px; @@ -227,8 +229,8 @@ $align-block-grid-to-grid: true; // We use these to build padding for buttons. // $button-tny: rem-calc(10); $button-sml: 0.25rem; -// $button-med: rem-calc(16); -// $button-lrg: rem-calc(18); +$button-med: 1.3333rem; +$button-lrg: 2rem; // We use this to control the display property. // $button-display: inline-block; @@ -236,24 +238,25 @@ $button-sml: 0.25rem; // We use these to control button text styles. $button-font-family: $header-font-family; -$button-font-color: $primary-color; +$button-font-color: $white; $button-font-color-alt: $secondary-color; // $button-font-tny: rem-calc(11); // $button-font-sml: rem-calc(13); // $button-font-med: rem-calc(16); // $button-font-lrg: rem-calc(20); -// $button-font-weight: normal; -// $button-font-align: center; +$button-font-weight: bold; +$button-font-align: center; // We use these to control various hover effects. // $button-function-factor: 5%; // We use these to control button border styles. -$button-border-width: 1px; +$button-border-width: 0.15em; $button-border-style: solid; +$button-border-color: transparent; // We use this to set the default radius used throughout the core. -$button-radius: 1.5em; +$button-radius: 0; // $button-round: $global-rounded; // We use this to set default opacity for disabled buttons. diff --git a/app/assets/stylesheets/sass/_layout.scss b/app/assets/stylesheets/sass/_layout.scss index 3355ebc..78ca53a 100644 --- a/app/assets/stylesheets/sass/_layout.scss +++ b/app/assets/stylesheets/sass/_layout.scss @@ -4,11 +4,194 @@ */ -html, #footer .container { - background-color: $primary-color +html { + background-color: $white } body { + background-color: $primary-color; +} + +#main-nav { + background-color: $white; + width: 100%; + display: table; + font-size: 0.6667em; + font-size: 2.4vw; + + p { + display: none; + } + + .button { + width: 29%; + margin: 0; + + &.logo { + background-color: $white; + width: 13%; + border: 0; + padding: 0; + vertical-align: top; + + .logo { + width: auto; + height: 2.4em; + } + + .logo-text { + display: none; + } + + &:hover { + background-color: transparent; + color: $black; + } + } + } + + @include breakpoint(medium) { + display: block; + min-height: 100%; + float: left; + width: 25%; + padding: 2.5%; + font-size: 1em; + + .button, p { + display: block; + } + + p { + font-size: 0.9em; + } + + .button { + width: auto; + margin: 0 0 1.25rem; + + &.logo { + width: 100%; + margin-bottom: 2em; + + .logo { + float: left; + width: 40%; + height: auto; + margin-right: 10%; + } + + .logo-text { + display: block; + width: 50%; + } + } + } + } +} + +main { + min-height: 100%; + //overflow: auto; + background-color: $primary-color; +} + +#banner { + position: relative; + padding-bottom: 4em; + background-size: cover; + background-position: center 66.6667%; + color: $white; + background-color: rgba($conference-color, 0.33); + background-blend-mode: overlay; + overflow: hidden; + @include text-shadow(0 0 0.5em $black); + + h1, h2 { + color: inherit; + } + + .no-blend-modes & { + &:before { + content: ''; + display: block; + position: absolute; + background-color: inherit; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + } + } + + &:after { + content: ''; + display: block; + position: absolute; + //background-color: inherit; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + @include background-image(linear-gradient(top, rgba(0,0,0,0) 50%, darken($primary-color, 25) 100%)); + mix-blend-mode: multiply; + } + + .row { + height: 50%; + z-index: 2; + position: relative; + } + + .button { + width: 75%; + color: inherit; + border-color: inherit; + background-color: rgba(darken($article-color, 0), 0.33); + padding: 0.75em 1em; + @include text-shadow(none); + + &:hover { + background-color: $article-color; + color: $white; + border-color: transparent; + } + } + + @include breakpoint(medium) { + min-height: 40em; + height: 100%; + height: 100vh; + } +} + +.align-bottom { + display: -webkit-flexbox; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-align: flex-end; + -ms-flex-align: flex-end; + -webkit-align-items: flex-end; + align-items: flex-end; +} + +.centered { + text-align: center; +} + +#footnotes_debug { + display: none; +} + +#footer { + min-height: 5em; + background-color: inherit; +} + +/*body { height: auto; } @@ -27,18 +210,6 @@ main { .no-banner & { //border-top: 0.25em solid $primary-color; } - - /*.no-banner &:before { - content: '///////////////'; - color: #CCC; - font-weight: 100; - font-family: $header-font-family; - letter-spacing: 0.33333em; - font-size: 1em; - text-align: center; - display: block; - font-style: italic; - }*/ } $body-background-color: $white; @@ -397,7 +568,4 @@ table { } } -/*[class*="block-grid-"] { - margin: 0; -} */ diff --git a/app/assets/stylesheets/sass/_mixins.scss b/app/assets/stylesheets/sass/_mixins.scss new file mode 100644 index 0000000..a5f3830 --- /dev/null +++ b/app/assets/stylesheets/sass/_mixins.scss @@ -0,0 +1,11 @@ +@mixin breakpoint($query) { + @if $query == small { + @media #{$small-only} { @content; } + } @else if $query == medium { + @media #{$medium-up} { @content; } + } @else if $query == large { + @media #{$large-up} { @content; } + } @else { + @media #{$query} { @content; } + } +} diff --git a/app/assets/stylesheets/sass/_typography.scss b/app/assets/stylesheets/sass/_typography.scss index 9543de2..b0001dd 100644 --- a/app/assets/stylesheets/sass/_typography.scss +++ b/app/assets/stylesheets/sass/_typography.scss @@ -4,46 +4,11 @@ */ -$translate-me-bgcolor: rgba(255, 0, 0, 0.25) !default; -$translate-me-outline-color: rgba(255, 0, 0, 0.5) !default; - -.translate-me { - cursor: url(translate_cursor-32.png) 8 31, auto; - - &.untranslated { - background-color: $translate-me-bgcolor; - @include opacity(0.5); - } - - &:hover, - &.selected { - @include opacity(1); - outline: 2px solid $translate-me-outline-color; - outline-offset: 0; - outline-style: dashed; - } - &.preview { - background-color: inherit; - outline-style: solid; - -webkit-animation: preview-translation 2s infinite; - } -} - -@-webkit-keyframes preview-translation { - 0% { - outline-color: rgba(0, 255, 0, 1); - } - 50% { - outline-color: rgba(0, 255, 0, 0); - } - 100% { - outline-color: rgba(0, 255, 0, 1); - } -} +//$translate-me-bgcolor: rgba(255, 0, 0, 0.25) !default; +//$translate-me-outline-color: rgba(255, 0, 0, 0.5) !default; .button, button, input[type="file"] { - background-color: rgba($white, 0.5); - border-radius: 1.5em; + /*background-color: rgba($white, 0.5); color: $primary-color; border: 1px solid; padding: 0.75em 1.5em; @@ -52,6 +17,36 @@ $translate-me-outline-color: rgba(255, 0, 0, 0.5) !default; &:hover { color: #FFF; + }*/ + + background-color: $primary-color; + color: $white; + font-weight: bold; + //font-family: $header-font-family; + font-size: 1.333em; + border: 0.15em solid transparent; + padding: 0.5em 1em; + + &.organization, &.secondary { + background-color: $organization-color; + } + + &.article { + background-color: $article-color; + } + + &:hover { + color: $primary-color; + border: 0.15em solid; + background-color: transparent; + + &.organization { + color: $organization-color; + } + + &.article { + color: $article-color; + } } } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4c6e18d..39afadb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,8 @@ +module ActiveRecord + class PremissionDenied < RuntimeError + end +end + class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. @@ -8,4 +13,12 @@ class ApplicationController < ActionController::Base def capture_page_info $page_info = {:path => request.env['PATH_INFO'], :controller => params['controller'], :action => params['action']} end + + rescue_from ActiveRecord::RecordNotFound do |exception| + render 'pages/404', status: 404 + end + + rescue_from ActiveRecord::PremissionDenied do |exception| + render 'permission_denied', status: 404 + end end diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 0cc7788..893c3e6 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -11,6 +11,7 @@ class ConferencesController < ApplicationController # GET /conferences/1 def show + #puts params[:slug] end # GET /conferences/new @@ -21,6 +22,9 @@ class ConferencesController < ApplicationController # GET /conferences/1/edit def edit + if !current_user + raise ActiveRecord::PremissionDenied + end @host = @conference.organizations[0].locations[0] #points = Geocoder::Calculations.bounding_box([@host.latitude, @host.longitude], 50, { :unit => :km }) result = Geocoder.search(@host.city + ', ' + @host.territory + ' ' + @host.country).first @@ -100,6 +104,23 @@ class ConferencesController < ApplicationController end end + def register + set_conference + @user = User.new + @sub_action = 'registration_register' + render :registration + end + + def register_step + set_conference + data = params + if params[:conference][:user][:email] + user = User.find_by(:email => params[:conference][:user][:email]) + data[:conference][:user][:username] = user.username + end + render json: data + end + def add_field set_conference field = RegistrationFormField.find(params[:field]) @@ -151,8 +172,18 @@ class ConferencesController < ApplicationController private # Use callbacks to share common setup or constraints between actions. def set_conference - @conference = Conference.find_by(slug: params[:conference_slug] || params[:slug]) - set_conference_registration + @conference = nil + if type = ConferenceType.find_by!(slug: params[:conference_type_slug] || 'bikebike') + if @conference = Conference.find_by!(slug: params[:conference_slug] || params[:slug], conference_type_id: type.id) + set_conference_registration + end + end + if current_user + @host_privledge = :admin + end + #if !@conference + # raise ActionController::RoutingError.new('Not Found') + #end end def set_conference_registration diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index e448139..bf438b3 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -101,12 +101,12 @@ class OrganizationsController < ApplicationController end territory = countries[location.country.downcase][:territories][location.territory.downcase] if !orgs[location.country.downcase][location.territory.downcase].has_key?(location.territory.downcase) - orgs[location.country.downcase][location.territory.downcase][location.territory.downcase] = Hash.new - orgs[location.country.downcase][location.territory.downcase][location.territory.downcase][:latitude] = location.latitude - orgs[location.country.downcase][location.territory.downcase][location.territory.downcase][:longitude] = location.longitude - orgs[location.country.downcase][location.territory.downcase][location.territory.downcase][:count] = 0 + orgs[location.country.downcase][location.territory.downcase][location.city.downcase] = Hash.new + orgs[location.country.downcase][location.territory.downcase][location.city.downcase][:latitude] = location.latitude + orgs[location.country.downcase][location.territory.downcase][location.city.downcase][:longitude] = location.longitude + orgs[location.country.downcase][location.territory.downcase][location.city.downcase][:count] = 0 end - orgs[location.country.downcase][location.territory.downcase][location.territory.downcase][orgs[location.country.downcase][location.territory.downcase][location.territory.downcase]['count']] = { + orgs[location.country.downcase][location.territory.downcase][location.city.downcase][orgs[location.country.downcase][location.territory.downcase][location.city.downcase][:count]] = { :title => org.name, :id => org.id, :logo => org.avatar.url(:thumb), @@ -126,7 +126,7 @@ class OrganizationsController < ApplicationController :url => url_for(org), :order => order } - orgs[location.country.downcase][location.territory.downcase][location.territory.downcase][:count] += 1 + orgs[location.country.downcase][location.territory.downcase][location.city.downcase][:count] += 1 order += 1 } render :json => orgs.to_json @@ -135,7 +135,9 @@ class OrganizationsController < ApplicationController private # Use callbacks to share common setup or constraints between actions. def set_organization - @organization = Organization.find_by(slug: params[:slug] || params[:organization_slug]) + if params[:slug] != 'json' + @organization = Organization.find_by!(slug: params[:slug] || params[:organization_slug]) + end end # Only allow a trusted parameter "white list" through. diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 60c9c78..bf7d391 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -3,6 +3,7 @@ include ApplicationHelper class PagesController < ApplicationController def home + @conference = Conference.find(:first, :order => "start_date DESC") end def translate diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5e8b1da..8887a46 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,6 +4,8 @@ module ApplicationHelper @@lastTranslation = nil @@allTranslations = nil @@no_banner = true + @@banner_attribution_details = nil + @@banner_image = nil def ThereAreTranslationsOnThisPage? @@translationsOnThisPage @@ -17,13 +19,17 @@ module ApplicationHelper content_for(:title) { page_title.to_s } end - def banner_image(banner_image) + def banner_image(banner_image, name: nil, id: nil, user_id: nil, src: nil) @@no_banner = false + if (name || id || user_id || src) + @@banner_attribution_details = {:name => name, :id => id, :user_id => user_id, :src => src} + end content_for(:banner_image) { banner_image.to_s } end def banner_attrs(banner_image) if banner_image.length > 0 + @@banner_image = banner_image return {style: 'background-image: url(' + banner_image + ');', class: 'has-image' } end {class: 'no-image'} @@ -38,6 +44,25 @@ module ApplicationHelper content_for(:banner) { ('