Merge branch 'user-facing-engine' into 2.0

This commit is contained in:
Petko Bordjukov 2015-08-10 22:01:12 +03:00
commit 00a4e32939
121 changed files with 2033 additions and 150 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "lib/open_fest/app/vendor/initfest"]
path = lib/open_fest/app/vendor/initfest
url = https://github.com/initLab/initfest.git

21
Capfile
View File

@ -1,10 +1,10 @@
# Load DSL and Setup Up Stages
# Load DSL and set up stages
require 'capistrano/setup'
# Includes default deployment tasks
# Include default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
@ -13,16 +13,19 @@ require 'capistrano/deploy'
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
# https://github.com/capistrano/passenger
#
# require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
# require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require 'capistrano/rails'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/puma'
require 'capistrano/puma/nginx' # if you want to upload a nginx site template
# require 'capistrano/passenger'
require 'capistrano/rvm'
require 'capistrano/git-submodule-strategy'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

11
Gemfile
View File

@ -28,10 +28,6 @@ gem 'phony_rails'
gem 'carrierwave'
gem 'rmagick'
gem 'capistrano'
gem 'capistrano-rails'
gem 'capistrano-rvm'
gem 'puma', group: :production
gem 'globalize'
@ -49,6 +45,8 @@ gem 'jquery-datatables-rails'
gem 'morrisjs-rails'
gem 'raphael-rails'
gem 'open_fest', path: 'lib/open_fest'
group :development do
gem 'spring'
gem 'spring-commands-rspec'
@ -58,6 +56,11 @@ group :development do
gem 'hirb'
gem 'awesome_print'
gem 'quiet_assets'
gem 'capistrano'
gem 'capistrano-rails'
gem 'capistrano-rvm'
gem 'capistrano3-puma'
gem 'capistrano-git-submodule-strategy'
end
group :development, :test do

View File

@ -5,6 +5,14 @@ GIT
specs:
yaml_db (0.2.3)
PATH
remote: lib/open_fest
specs:
open_fest (0.0.1)
devise
font-awesome-sass
rails (~> 4.2.3)
GEM
remote: https://rubygems.org/
specs:
@ -43,7 +51,7 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.2)
arel (6.0.3)
autoprefixer-rails (5.2.1.1)
execjs
json
@ -64,12 +72,17 @@ GEM
capistrano-bundler (1.1.4)
capistrano (~> 3.1)
sshkit (~> 1.2)
capistrano-git-submodule-strategy (0.1.17)
capistrano (~> 3.1)
capistrano-rails (1.1.3)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
capistrano3-puma (1.1.0)
capistrano (~> 3.0)
puma (>= 2.6)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@ -95,7 +108,7 @@ GEM
currencies (~> 0.4.2)
i18n_data (~> 0.7.0)
currencies (0.4.2)
devise (3.5.1)
devise (3.5.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
@ -122,12 +135,12 @@ GEM
font-awesome-sass (4.3.2.1)
sass (~> 3.2)
formatador (0.2.5)
globalid (0.3.5)
globalid (0.3.6)
activesupport (>= 4.1.0)
globalize (5.0.1)
activemodel (>= 4.2.0, < 4.3)
activerecord (>= 4.2.0, < 4.3)
guard (2.12.8)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
lumberjack (~> 1.0)
@ -137,20 +150,20 @@ GEM
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.6.2)
guard-rspec (4.6.4)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
highline (1.7.2)
highline (1.7.3)
hirb (0.7.3)
i18n (0.7.0)
i18n-tasks (0.8.5)
activesupport
i18n-tasks (0.8.7)
activesupport (>= 2.3.18)
easy_translate (>= 0.5.0)
erubis
highline
highline (>= 1.7.3)
i18n
term-ansicolor
term-ansicolor (>= 1.3.2)
terminal-table (>= 1.5.1)
i18n_data (0.7.0)
jquery-datatables-rails (3.3.0)
@ -164,7 +177,7 @@ GEM
thor (>= 0.14, < 2.0)
json (1.8.3)
libv8 (3.16.14.11)
listen (3.0.2)
listen (3.0.3)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
loofah (2.0.2)
@ -175,7 +188,7 @@ GEM
method_source (0.8.2)
mime-types (2.6.1)
mini_portile (0.6.2)
minitest (5.7.0)
minitest (5.8.0)
morrisjs-rails (0.5.1)
railties (> 3.1, < 5)
nenv (0.2.0)
@ -185,12 +198,12 @@ GEM
net-ssh (2.9.2)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
notiffany (0.0.6)
notiffany (0.0.7)
nenv (~> 0.1)
shellany (~> 0.0)
orm_adapter (0.5.0)
pg (0.18.2)
phony (2.14.10)
phony (2.14.13)
phony_rails (0.12.9)
activesupport (>= 3.0)
countries (~> 0.11, >= 0.11.5)
@ -201,7 +214,7 @@ GEM
slop (~> 3.4)
pry-rails (0.3.4)
pry (>= 0.9.10)
puma (2.12.2)
puma (2.12.3)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.4)
@ -224,7 +237,7 @@ GEM
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-erd (1.4.1)
rails-erd (1.4.2)
activerecord (>= 3.2)
activesupport (>= 3.2)
choice (~> 0.2.0)
@ -247,7 +260,7 @@ GEM
ref (2.0.0)
responders (2.1.0)
railties (>= 4.2.0, < 5)
rmagick (2.15.2)
rmagick (2.15.3)
rspec (3.3.0)
rspec-core (~> 3.3.0)
rspec-expectations (~> 3.3.0)
@ -342,8 +355,10 @@ DEPENDENCIES
bootstrap-sass-extras
bootswatch-rails
capistrano
capistrano-git-submodule-strategy
capistrano-rails
capistrano-rvm
capistrano3-puma
capybara
carrierwave
coffee-rails
@ -360,6 +375,7 @@ DEPENDENCIES
jquery-rails
morrisjs-rails
nested_form
open_fest!
pg
phony_rails
pry-rails

View File

@ -1,9 +1,5 @@
class ApplicationController < ActionController::Base
def require_current_conference
if not current_conference?
redirect_to '/', alert: 'No conference selected'
end
end
include CurrentConferenceAssigning
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.

View File

@ -0,0 +1,30 @@
module CurrentConferenceAssigning
extend ActiveSupport::Concern
included do
helper_method :current_conference?
helper_method :current_conference
end
def current_conference?
current_conference.present?
end
def current_conference
if not @current_conference
if @conference and not @conference.new_record?
@current_conference = @conference
elsif params[:conference_id].present?
@current_conference = Conference.find(params[:conference_id])
end
end
@current_conference
end
def require_current_conference!
if not current_conference?
raise ActionController::RoutingError.new('Not Found')
end
end
end

View File

@ -6,24 +6,6 @@ module Management
private
def current_conference?
current_conference.present?
end
helper_method :current_conference?
def current_conference
if not @current_conference
if @conference
@current_conference = @conference
elsif params[:conference_id].present?
@current_conference = Conference.find(params[:conference_id])
end
end
@current_conference
end
helper_method :current_conference
def authorize_user!
head :forbidden unless current_user.admin?
end

View File

@ -24,12 +24,12 @@ class Conference < ActiveRecord::Base
end
def submissions_grouped_by_day
submissions = events.group('date(events.created_at)').select('events.created_at, count(events.id) as number')
submissions = events.group('date(events.created_at)').select('date(events.created_at) as created_at, count(events.id) as number')
submissions.group_by { |s| s.created_at.to_date }
end
def submissions_grouped_by_confirmation_day
submissions = events.approved.confirmed.group('date(events.confirmed_at)').select('events.confirmed_at, count(events.id) as number')
submissions = events.approved.confirmed.group('date(events.confirmed_at)').select('date(events.confirmed_at) as confirmed_at, count(events.id) as number')
submissions.group_by { |s| s.confirmed_at.to_date }
end

View File

@ -9,26 +9,18 @@ class User < ActiveRecord::Base
has_many :workshops
has_many :events
default_scope { order id: :desc }
# TODO (2015-08-05) Copy previous profile
def build_personal_profile(conference, params)
personal_profiles.build({conference_id: conference.id}.merge(params))
end
def personal_profile(conference)
personal_profiles.find_by(conference_id: conference.id)
end
default_scope { order id: :desc }
def toggle_admin!
update admin: !admin
end
def clone_recent_profile(new_conference)
recent_profile = personal_profiles.order('created_at DESC').first
personal_profiles.build(conference: new_conference) do |new_profile|
if recent_profile.present?
new_profile.attributes = recent_profile.attributes.except(
"id", "created_at", "updated_at", "conference_id"
)
new_profile.remote_picture_url = recent_profile.picture.url
end
end
end
end

View File

@ -1,24 +1,16 @@
br
- if controller_name != 'sessions'
= link_to t('sessions.sign_in'), new_session_path(resource_name)
= link_to t('sessions.sign_in'), new_user_session_path
br
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to t('registrations.sign_up'), new_registration_path(resource_name)
= link_to t('registrations.sign_up'), new_user_registration_path
br
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to t('passwords.forgotten_password'), new_password_path(resource_name)
= link_to t('passwords.forgotten_password'), new_user_password_path
br
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to t('confirmations.did_not_receive_confirmation_instructions'), new_confirmation_path(resource_name)
= link_to t('confirmations.did_not_receive_confirmation_instructions'), new_user_confirmation_path
br
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to t('unlocks.did_not_receive_unlock_instructions'), new_unlock_path(resource_name)
br
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to t('sessions.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider)

View File

@ -45,5 +45,5 @@ nav.navbar.navbar-static-top.navbar-inverse role="navigation"
= link_to t("locales.#{locale}"), "?locale=#{locale}"
- if user_signed_in?
li
= link_to destroy_user_session_path, method: :delete do
= link_to destroy_management_user_session_path, method: :delete do
= icon 'sign-out', t('sessions.sign_out')

View File

@ -22,7 +22,12 @@
tr
td= event.title
td= event.subtitle
td= link_to proposer_profile.name, [:management, @conference, proposer]
td
- if proposer_profile
= link_to proposer_profile.name, [:management, @conference, proposer_profile]
- else
| No profile for user #{proposer.email}
td #{event.length} minutes
td= event.language

View File

@ -1,17 +1,18 @@
# config valid only for Capistrano 3.1
lock '3.2.1'
# config valid only for current version of Capistrano
lock '3.4.0'
set :application, 'clarion'
set :repo_url, 'https://github.com/ignisf/clarion.git'
# Default branch is :master
ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/home/barf/clarion'
# Default value for :scm is :git
# set :scm, :git
set :git_strategy, Capistrano::Git::SubmoduleStrategy
# Default value for :format is :pretty
# set :format, :pretty
@ -23,10 +24,10 @@ set :deploy_to, '/home/barf/clarion'
# set :pty, true
# Default value for :linked_files is []
set :linked_files, %w{config/puma.rb config/database.yml config/secrets.yml}
set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads}
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
@ -34,7 +35,17 @@ set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public
# Default value for keep_releases is 5
# set :keep_releases, 5
set :rvm_ruby_version, '2.1.3'
set :rvm_ruby_version, '2.2.2'
set :puma_bind, ["tcp://127.0.0.1:9087"]
set :puma_init_active_record, true
set :puma_access_log, "#{shared_path}/log/puma_access.log"
set :puma_error_log, "#{shared_path}/log/puma_error.log"
set :puma_preload_app, true
set :nginx_sites_available_path, "#{shared_path}"
set :nginx_sites_enabled_path, "/tmp"
set :nginx_server_name, 'cfp.openfest.org'
namespace :deploy do

View File

@ -1,33 +1,53 @@
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary server in each group
# is considered to be the first unless any hosts have the primary
# property set. Don't declare `role :all`, it's a meta role.
# Extended Server Syntax
# server-based syntax
# ======================
# This can be used to drop a more detailed server definition into the
# server list. The second argument is a, or duck-types, Hash and is
# used to set extended properties on the server.
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
server 'marla.ludost.net', user: 'barf', roles: %w{app db web}
# role-based syntax
# ==================
# Defines a role with one or multiple servers. The primary server in each
# group is considered to be the first unless any hosts have the primary
# property set. Specify the username and a domain or IP for the server.
# Don't use `:all`, it's a meta role.
# role :app, %w{deploy@example.com}, my_property: :my_value
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
# role :db, %w{deploy@example.com}
# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
# These variables are then only loaded and set in this stage.
# For available Capistrano configuration variables see the documentation page.
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.
server 'marla.ludost.net', user: 'barf', roles: %w{web db app}
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
# limited set of options, consult the Net::SSH documentation.
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
#
# Global options
# --------------
# set :ssh_options, {
set :ssh_options, {
# keys: %w(/home/rlisowski/.ssh/id_rsa),
# forward_agent: false,
forward_agent: true,
# auth_methods: %w(password)
# }
}
#
# And/or per server (overrides global)
# The server-based syntax can be used to override options:
# ------------------------------------
# server 'example.com',
# user: 'user_name',

View File

@ -1,8 +1,9 @@
Rails.application.routes.draw do
devise_for :users
mount OpenFest::Engine, at: '/', constraints: {subdomain: 'cfp'}, conference_id: 1
namespace :management do
root to: 'home#index'
devise_for :users
resources :conferences do
resources :events

View File

@ -1,15 +1,18 @@
class EventType < ActiveRecord::Base
end
class CreateEventTypesForAllExistingEvents < ActiveRecord::Migration
def up
event_types = execute 'SELECT DISTINCT(events.type) as type_name, tracks.conference_id, events.created_at, events.updated_at FROM events INNER JOIN tracks ON tracks.id = events.track_id WHERE events.type NOT NULL GROUP BY type_name;'
event_types = execute 'SELECT events.type AS type_name, tracks.conference_id, MIN(events.created_at) AS created_at FROM events
INNER JOIN tracks ON tracks.id = events.track_id
WHERE events.type IS NOT NULL
GROUP BY type_name, tracks.conference_id;'
event_types.each do |type|
execute "INSERT INTO event_types (conference_id, created_at, updated_at)
VALUES (#{type['conference_id']}, '#{type['created_at']}', '#{type['updated_at']}');"
event_type_id = execute('SELECT MAX(id) AS last_id FROM event_types;').first['last_id']
event_type = EventType.create! conference_id: type['conference_id'], created_at: type['created_at'], updated_at: type['created_at']
execute "INSERT INTO event_type_translations (event_type_id, locale, created_at, updated_at, name, description)
VALUES (#{event_type_id}, 'en', '#{type['created_at']}', '#{type['created_at']}', '#{type['type_name']}', 'None');"
VALUES (#{event_type.id}, 'en', '#{event_type.created_at}', '#{event_type.created_at}', '#{type['type_name']}', 'None');"
end
end

View File

@ -1,6 +1,6 @@
class PopulateEventTypeOfExistingEvents < ActiveRecord::Migration
def up
event_ids = execute('SELECT id FROM events WHERE type NOT NULL;').map { |row| row['id'] };
event_ids = execute('SELECT id FROM events WHERE type IS NOT NULL;').map { |row| row['id'] };
event_ids.each do |id|
event_type_id = execute("SELECT ett.event_type_id FROM events JOIN event_type_translations AS ett ON events.type = ett.name WHERE events.id = #{id};").first['event_type_id']

View File

@ -1,11 +1,13 @@
class CreateParticipations < ActiveRecord::Migration
def change
create_table :participations do |t|
t.references :participant, index: true, foreign_key: true
t.references :participant, index: true
t.references :event, index: true, foreign_key: true
t.boolean :approved, default: false
t.timestamps null: false
end
add_foreign_key :participations, :users, column: :participant_id
end
end

View File

@ -6,8 +6,11 @@ class CreateParticipationRecords < ActiveRecord::Migration
event_to_speaker_profiles = execute 'SELECT * FROM events_speaker_profiles'
event_to_speaker_profiles.each do |event_to_speaker_profile|
profile = PersonalProfile.find_by(id: event_to_speaker_profile['speaker_profile_id'])
next if not profile
Participation.create! event_id: event_to_speaker_profile['event_id'],
participant_id: PersonalProfile.find(event_to_speaker_profile['speaker_profile_id']).user_id,
participant_id: profile.user_id,
approved: true
end
end

View File

@ -0,0 +1,5 @@
class AddLanguageToUsers < ActiveRecord::Migration
def change
add_column :users, :language, :string
end
end

8
lib/open_fest/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache

15
lib/open_fest/Gemfile Normal file
View File

@ -0,0 +1,15 @@
source 'https://rubygems.org'
# Declare your gem's dependencies in open_fest.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.
# To use a debugger
# gem 'byebug', group: [:development, :test]

123
lib/open_fest/Gemfile.lock Normal file
View File

@ -0,0 +1,123 @@
PATH
remote: .
specs:
open_fest (0.0.1)
devise
rails (~> 4.2.3)
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.3)
actionpack (= 4.2.3)
actionview (= 4.2.3)
activejob (= 4.2.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.3)
actionview (= 4.2.3)
activesupport (= 4.2.3)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.3)
activesupport (= 4.2.3)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.3)
activesupport (= 4.2.3)
globalid (>= 0.3.0)
activemodel (4.2.3)
activesupport (= 4.2.3)
builder (~> 3.1)
activerecord (4.2.3)
activemodel (= 4.2.3)
activesupport (= 4.2.3)
arel (~> 6.0)
activesupport (4.2.3)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.2)
bcrypt (3.1.10)
builder (3.2.2)
devise (3.5.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
erubis (2.7.0)
globalid (0.3.5)
activesupport (>= 4.1.0)
i18n (0.7.0)
json (1.8.3)
loofah (2.0.2)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.6.1)
mini_portile (0.6.2)
minitest (5.7.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
orm_adapter (0.5.0)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.3)
actionmailer (= 4.2.3)
actionpack (= 4.2.3)
actionview (= 4.2.3)
activejob (= 4.2.3)
activemodel (= 4.2.3)
activerecord (= 4.2.3)
activesupport (= 4.2.3)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.3)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.6)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
railties (4.2.3)
actionpack (= 4.2.3)
activesupport (= 4.2.3)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
responders (2.1.0)
railties (>= 4.2.0, < 5)
sprockets (3.2.0)
rack (~> 1.0)
sprockets-rails (2.3.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
sqlite3 (1.3.10)
thor (0.19.1)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
warden (1.2.3)
rack (>= 1.0)
PLATFORMS
ruby
DEPENDENCIES
open_fest!
sqlite3
BUNDLED WITH
1.10.5

20
lib/open_fest/MIT-LICENSE Normal file
View File

@ -0,0 +1,20 @@
Copyright 2015 Petko Bordjukov
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,3 @@
= OpenFest
This project rocks and uses MIT-LICENSE.

37
lib/open_fest/Rakefile Normal file
View File

@ -0,0 +1,37 @@
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'OpenFest'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
load 'rails/tasks/statistics.rake'
Bundler::GemHelper.install_tasks
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
task default: :test

View File

@ -0,0 +1 @@
../../vendor/initfest/img

View File

@ -0,0 +1,15 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require_tree .

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1 @@
../../vendor/initfest/css

View File

@ -0,0 +1,140 @@
.alert-error {
color: red;
}
.input {
position: relative;
margin: 0 0 1em 0;
border-top: 0.1em dotted #999;
padding: 1em 0;
}
.input label {
font-size: 1em;
display: block;
width: 12em;
float: left;
}
.input {
input.string, input.email, input.password, select.select, input.numeric {
font-size: 1em;
width: 20em;
float: left;
}
textarea {
height: 15em;
width: 45em;
}
img {
padding: 5px;
display: block;
border: 1px solid #CCC;
background-color: #F1F1F1;
}
img+input.image_preview {
margin-left: 12.7em;
}
}
.input label.boolean {
margin-left: 12em;
}
.input .hint, .input .error {
display: block;
clear: both;
font-size: 0.75em;
font-style: italic;
width: 20em;
margin: 0 0 0 16em;
padding: 1em 0 0 0;
}
.input .error {
font-style: normal;
padding: 1em 0 0 0;
color: #F00;
}
.input .error::before {
content: "";
display: inline-block;
font-size: 2em;
margin: 0 0.2em 0 0;
transform: translate(0, 0.1em);
}
.btn {
display: block;
margin: 2em 0 0 13em;
}
/* styling of the button */
.btn {
background: #233e83;
padding: 0.4em 0.8em;
border-radius: 0.2em;
color: #FFF;
border: none;
border-bottom: 0.2em solid #7A95DC;
cursor: pointer;
transition: background 200ms, border 200ms, transform 200ms;
-webkit-transition: background 200ms, border 200ms, transform 200ms;
}
.btn:hover {
background: #152551;
}
.btn:active {
background: #597AD2;
border-bottom: 0.2em solid #000;
transform: translate(0, 0.1em);
-webkit-transform: translate(0, 0.1em);
}
.centered {
text-align: center;
}
.large {
padding: 30px;
}
.btn-link {
background: #233e83;
padding: 0.4em 0.8em;
border-radius: 0.2em;
color: #FFF;
border: none;
border-bottom: 0.2em solid #7A95DC;
cursor: pointer;
transition: background 200ms, border 200ms, transform 200ms;
-webkit-transition: background 200ms, border 200ms, transform 200ms;
}
.btn-link:link, .btn-link:active, .btn-link:visited {
color: #FFF;
text-decoration: none;
}
.btn-link:hover {
background: #152551;
}
.btn-link:active {
background: #597AD2;
border-bottom: 0.2em solid #000;
transform: translate(0, 0.1em);
-webkit-transform: translate(0, 0.1em);
}
.btn-link-large {
font-size: 2em;
}

View File

@ -0,0 +1,5 @@
@import "font-awesome-sprockets";
@import "font-awesome";
@import 'initfest/styles';
@import 'forms';

View File

@ -0,0 +1,12 @@
module OpenFest::Users::DeviseController
extend ActiveSupport::Concern
included do
before_filter :require_current_conference!
layout 'open_fest/application'
end
def signed_in_root_path(user)
root_path
end
end

View File

@ -0,0 +1,18 @@
module OpenFest
class ApplicationController < ActionController::Base
include ::CurrentConferenceAssigning
before_filter :require_current_conference!
before_filter :set_locale
def set_locale
if params[:locale]
I18n.locale = params[:locale]
end
end
def default_url_options(options = {})
options.merge(locale: params[:locale])
end
end
end

View File

@ -0,0 +1,35 @@
require_dependency "open_fest/application_controller"
module OpenFest
class EventsController < ApplicationController
def index
end
def new
@event_type = current_conference.event_types.find(params[:type])
@event = Event.new(event_type: @event_type)
end
def create
@event = Event.new(event_params)
if @event.save
# TODO (2015-08-10) Flash message?
flash[:notice] = 'Event was successfully created.'
redirect_to action: :index
else
render action: :new
end
end
private
def event_params
params.require(:event).permit(
:title, :subtitle, :length, :language,
:abstract, :description, :notes, :agreement,
:event_type_id
)
end
end
end

View File

@ -0,0 +1,42 @@
module OpenFest
class PersonalProfilesController < ApplicationController
def new
@profile = current_user.build_personal_profile(current_conference)
end
def create
@profile = current_user.build_personal_profile(current_conference, profile_params)
if @profile.save
flash[:notice] = t('profile.successfully_created')
redirect_to root_path
else
render action: :new
end
end
def edit
@profile = current_user.personal_profile(current_conference)
end
def update
@profile = current_user.personal_profile(current_conference)
if @profile.update_attributes(profile_params)
flash[:notice] = t('profile.successfully_updated')
redirect_to root_path
else
render action: 'edit'
end
end
private
def profile_params
params.require(:personal_profile).permit(
:picture, :picture_cache, :first_name, :last_name, :public_email,
:organisation, :github, :twitter, :mobile_phone, :biography
)
end
end
end

View File

@ -0,0 +1,3 @@
class OpenFest::Users::ConfirmationsController < Devise::ConfirmationsController
include OpenFest::Users::DeviseController
end

View File

@ -0,0 +1,7 @@
class OpenFest::Users::PasswordsController < Devise::PasswordsController
include OpenFest::Users::DeviseController
def after_sending_reset_password_instructions_path_for(resource_name)
new_user_session_path
end
end

View File

@ -0,0 +1,43 @@
class OpenFest::Users::RegistrationsController < Devise::RegistrationsController
include OpenFest::Users::DeviseController
def edit
@user = resource
end
def update
@user = User.find(current_user.id)
successfully_updated =
if needs_password?(@user, params)
@user.update_with_password(params_for_update)
else
# remove the virtual current_password attribute
# update_without_password doesn't know how to ignore it
params[:user].delete(:current_password)
@user.update_without_password(params_for_update)
end
if successfully_updated
set_flash_message :notice, :updated
# Sign in the user bypassing validation in case their password changed
sign_in @user, :bypass => true
redirect_to after_update_path_for(@user)
else
render "edit"
end
end
private
def params_for_update
params.require(:user).permit(:email, :language, :password, :password_confirmation, :current_password)
end
def needs_password?(user, params)
user.email != params[:user][:email] ||
params[:user][:password].present? ||
params[:user][:password_confirmation].present?
end
end

View File

@ -0,0 +1,3 @@
class OpenFest::Users::SessionsController < Devise::SessionsController
include OpenFest::Users::DeviseController
end

View File

@ -0,0 +1,3 @@
class OpenFest::Users::UnlocksController < Devise::UnlocksController
include OpenFest::Users::DeviseController
end

View File

@ -0,0 +1,4 @@
module OpenFest
module ApplicationHelper
end
end

View File

@ -0,0 +1,4 @@
module OpenFest
module WelcomeHelper
end
end

1
lib/open_fest/app/vendor/initfest vendored Submodule

@ -0,0 +1 @@
Subproject commit 2afb0ce65bf1718252550379c4bd8c742072ebf3

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>
<% if content_for? :title %>
<%= yield :title %> |
<% end %>
<%= current_conference.try :title %>
</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
<%= stylesheet_link_tag "open_fest/application", media: "all" %>
<%= javascript_include_tag "open_fest/application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render 'open_fest/shared/nav' %>
<section class="content">
<%= render 'open_fest/shared/flash_messages' %>
<%= yield %>
</section>
</body>
</html>

View File

@ -0,0 +1 @@
=> link_to t('views.welcome.submit_event', event_type: event_type.name.mb_chars.downcase), new_event_path(type: event_type.id), class: 'btn-link btn-link-large'

View File

@ -0,0 +1,6 @@
li
p
strong
= track.name
span<>
= track.description

View File

@ -0,0 +1,14 @@
h1.entry-title = t :home_title, conference: current_conference.title
= simple_format current_conference.description
p = t :what_we_ask
ul
= render partial: 'track', collection: current_conference.tracks
p = t :license_notice
- if current_conference.call_for_participation.in_progress?
.centered.large
= render partial: 'event_type', collection: current_conference.event_types

View File

@ -0,0 +1,26 @@
= simple_form_for @event, wrapper: :default do |form|
p
= form.error_notification
h2= t('submit_event', event_type: @event_type.name)
.form-inputs
= form.input :event_type_id, as: :hidden
= form.input :title, autofocus: true
= form.input :subtitle
-# TODO tracks -> indirectly through proposition?
-# form.input :track_id, collection: current_conference.tracks.map { |track| [track.name, track.id, {title: track.description}] }, required: true
-# TODO length is different for different types of events (translation problem)
= form.input :length
= form.input :language, collection: I18n.available_locales, include_blank: false, default: I18n.locale
= form.input :abstract
= form.input :description
= form.input :notes
= form.input :agreement, as: :boolean, wrapper: :default
= form.button :submit

View File

@ -0,0 +1,19 @@
= simple_form_for @profile, wrapper: :default, url: personal_profile_path do |f|
= f.error_notification
.form-inputs
= image_tag(@profile.picture.medium.url) if @profile.picture?
= f.input :picture, as: :file, required: true
= f.hidden_field :picture_cache
= f.input :first_name, autofocus: true
= f.input :last_name
= f.input :public_email
= f.input :organisation
= f.input :github
= f.input :twitter
= f.input :mobile_phone
= f.input :biography
.form-actions
= f.button :submit

View File

@ -0,0 +1,5 @@
- content_for(:title) { ":: #{t :personal_profile}" }
h2.entry-title = t :personal_profile
= render 'form'

View File

@ -0,0 +1,5 @@
- content_for(:title) { ":: #{t :personal_profile}" }
h2.entry-title = t :personal_profile
= render 'form'

View File

@ -0,0 +1,3 @@
div#flash_messages
- flash.each do |key, value|
= content_tag :div, value, class: "flash #{key}"

View File

@ -0,0 +1,31 @@
nav
.content.cf
= link_to 'http://www.openfest.org', class: 'logo' do
= image_tag 'img/logo.png', alt: 'OpenFest'
div
ul.menu
li
a href=events_path = t('views.navigation.submit_event')
li
a href="#" = t('views.navigation.become_a_volunteer')
li
a href="#" = t('views.navigation.become_a_sponsor')
- unless user_signed_in?
== content_tag :li, class: [('current_page_item' if controller_name == 'sessions')] do
= link_to t(:login), new_user_session_path
- else
== content_tag :li, class: [('current_page_item' if controller_name == 'registrations')] do
= link_to t(:edit_speaker_profile), edit_user_registration_path
li
= link_to t(:logout), destroy_user_session_path, method: :delete
li
- if I18n.locale == :bg
= link_to url_for(request.query_parameters.merge(locale: 'en')), hreflang: 'en' do
img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHzSURBVHjaYkxOP8IAB//+Mfz7w8Dwi4HhP5CcJb/n/7evb16/APL/gRFQDiAAw3JuAgAIBEDQ/iswEERjGzBQLEru97ll0g0+3HvqMn1SpqlqGsZMsZsIe0SICA5gt5a/AGIEarCPtFh+6N/ffwxA9OvP/7//QYwff/6fZahmePeB4dNHhi+fGb59Y4zyvHHmCEAAAW3YDzQYaJJ93a+vX79aVf58//69fvEPlpIfnz59+vDhw7t37968efP3b/SXL59OnjwIEEAsDP+YgY53b2b89++/awvLn98MDi2cVxl+/vl6mituCtBghi9f/v/48e/XL86krj9XzwEEEENy8g6gu22rfn78+NGs5Ofr16+ZC58+fvyYwX8rxOxXr169fPny+fPn1//93bJlBUAAsQADZMEBxj9/GBxb2P/9+S/R8u3vzxuyaX8ZHv3j8/YGms3w8ycQARmi2eE37t4ACCDGR4/uSkrKAS35B3TT////wADOgLOBIaXIyjBlwxKAAGKRXjCB0SOEaeu+/y9fMnz4AHQxCP348R/o+l+//sMZQBNLEvif3AcIIMZbty7Ly6t9ZmXl+fXj/38GoHH/UcGfP79//BBiYHjy9+8/oUkNAAHEwt1V/vI/KBY/QSISFqM/GBg+MzB8A6PfYC5EFiDAABqgW776MP0rAAAAAElFTkSuQmCC" title="English" alt="English"
- elsif I18n.locale == :en
= link_to url_for(request.query_parameters.merge(locale: 'bg')), hreflang: 'bg' do
img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAALCAIAAAD5gJpuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFgSURBVHjaYvz69SsDEvj37x+ERGbAwZ9//wACiAUoysXFBST///8P0QOm//+HU0jgxYsXAAHEAlP0H5nxHxtgZGQEWgIQQCx3Pt2RYZL5+/8vQobh/z8gBIN/MAhErEwst77dAgggRoZmhjKXskefH/359weIfv/7DUJ/f//6CyR//fr7C8j99QdEyvPKH5x0ECAAhWOQAgAMg7D+/8nWNVMQDwmCvWTessZJ9VWHCIns0yWxc/MF4FgMUgCAYRBmpf9/sDqY2yWEQBbEYcK0ZuKxIY0FGZ98Z/8KFlcAsTAcYZDX/M369tefv3/+/AGSIJf8+fMbxPgDYoC4QOP//JER+XPqIANAALH83M7ALPvn3z2gcSBTQK4AOwRKQhh/fjP8+cuo8reOgQEggFiA0cP0+w+DpCRQDijK8AekE+SuP38YICQQ/f0LQUDFAAHECIznf0iIAZWLJgUEAAEGADzQZYYqa4w6AAAAAElFTkSuQmCC" title="Български" alt="Български"
- else
= I18n.locale.inspect

View File

@ -0,0 +1,15 @@
- content_for(:title) { ":: #{t :resend_instructions_header}" }
h2.entry-title = t :resend_instructions_header
= simple_form_for(resource, wrapper: :default, as: :user, url: user_confirmation_path) do |f|
= f.error_notification
= f.full_error :confirmation_token
.form-inputs
= f.input :email, required: true, autofocus: true, hint: false
.form-actions
= f.button :submit, t(:resend_instructions_btn)
== render 'devise/shared/links'

View File

@ -0,0 +1,18 @@
- content_for(:title) { ":: #{t :change_pass}" }
h2.entry-title = t :change_pass
= simple_form_for(resource, wrapper: :default, as: :user, url: user_password_path, html: { method: :put }) do |f|
= f.error_notification
= f.input :reset_password_token, as: :hidden
= f.full_error :reset_password_token
.form-inputs
= f.input :password, required: true, autofocus: true
= f.input :password_confirmation, required: true
.form-actions
= f.button :submit, t(:change_pass)
= render 'devise/shared/links'

View File

@ -0,0 +1,14 @@
- content_for(:title) { ":: #{t :lostpass}" }
h2.entry-title = t :lostpass
= simple_form_for(resource, wrapper: :default, as: :user, url: user_password_path) do |f|
= f.error_notification
.form-inputs
= f.input :email, required: true, autofocus: true, hint: false
.form-actions
= f.button :submit, t(:send_lostpass_instructions)
== render 'devise/shared/links'

View File

@ -0,0 +1,25 @@
- content_for(:title) { t :edit_speaker_profile }
= simple_form_for(resource, wrapper: :default, as: :user, url: user_registration_path, html: { method: :put, multipart: true }) do |f|
.form_inputs
h2
- if current_user.personal_profile(current_conference).present?
= link_to t(:personal_profile), edit_personal_profile_path
- else
= link_to t(:personal_profile), new_personal_profile_path
.form-inputs
h3.entry-title = t :login_data
= f.input :email, required: true
= f.input :language, collection: I18n.available_locales, required: true
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
p
= t :expected_validation, email: resource.unconfirmed_email
= f.input :password, autocomplete: "off", hint: t(:pass_update_hint1), required: false
= f.input :password_confirmation, required: false
= f.input :current_password, hint: t(:pass_update_hint2), required: true
.form-actions
= f.button :submit, t(:update)

View File

@ -0,0 +1,16 @@
- content_for(:title) { ":: #{t :registration}" }
h2.entry-title = t :registration
= simple_form_for(resource, wrapper: :default, as: :user, url: user_registration_path) do |f|
= f.error_notification
.form-inputs
= f.input :email, required: true, autofocus: true
= f.input :password, required: true
= f.input :password_confirmation, required: true
.form-actions
= f.button :submit
== render 'devise/shared/links'

View File

@ -0,0 +1,14 @@
- content_for(:title) { "#{t :login}" }
h2.entry-title = t :login
= simple_form_for(resource, wrapper: :default, as: :user, url: user_session_path) do |f|
.form-inputs
= f.input :email, required: false, autofocus: true, hint: false
= f.input :password, required: false, hint: false
= f.input :remember_me, as: :boolean, wrapper: :default if devise_mapping.rememberable?
.form-actions
= f.button :submit, t(:login)
== render 'open_fest/users/shared/links'

View File

@ -0,0 +1,15 @@
- if controller_name != 'sessions'
= link_to t(:enter), new_user_session_path
br
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to t(:registration), new_user_registration_path
br
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to t(:lostpass), new_user_password_path
br
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to t(:did_not_get_confirmation), new_user_confirmation_path
br

12
lib/open_fest/bin/rails Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/open_fest/engine', __FILE__)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
require 'rails/all'
require 'rails/engine/commands'

View File

@ -0,0 +1,60 @@
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
en:
devise:
confirmations:
confirmed: "Your email address has been successfully confirmed."
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
failure:
already_authenticated: "You are already signed in."
inactive: "Your account is not activated yet."
invalid: "Invalid %{authentication_keys} or password."
locked: "Your account is locked."
last_attempt: "You have one more attempt before your account is locked."
not_found_in_database: "Invalid %{authentication_keys} or password."
timeout: "Your session expired. Please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your email address before continuing."
mailer:
confirmation_instructions:
subject: "Confirmation instructions"
reset_password_instructions:
subject: "Reset password instructions"
unlock_instructions:
subject: "Unlock instructions"
omniauth_callbacks:
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
success: "Successfully authenticated from %{kind} account."
passwords:
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
updated: "Your password has been changed successfully. You are now signed in."
updated_not_active: "Your password has been changed successfully."
registrations:
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
signed_up: "Welcome! You have signed up successfully."
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
updated: "Your account has been updated successfully."
sessions:
signed_in: "Signed in successfully."
signed_out: "Signed out successfully."
already_signed_out: "Signed out successfully."
unlocks:
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
errors:
messages:
already_confirmed: "was already confirmed, please try signing in"
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
expired: "has expired, please request a new one"
not_found: "not found"
not_locked: "was not locked"
not_saved:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"

View File

@ -0,0 +1,32 @@
bg:
simple_form:
"yes": Да
"no": Не
required:
text: Задължително поле
mark: '*'
error_notification:
default_message: 'Моля, разгледайте посочените грешки във формуляра:'
hints:
user:
email: e-mail адресът Ви. Ще бъде видим само от организаторите
password: Парола с дължина между 8 и 128 символа
password_confirmation: Отново въведената отгоре парола
speaker_profile:
picture: Ваша снимка
organisation: Организацията, която представлявате
public_email: E-mail адрес, който ще бъде видим за посетителите
mobile_phone: Мобилен телефон, който ще бъде видим само за организаторите
biography: Опишете се с няколко изречения, говорейки за себе си в трето лице :)
github: Потребителското Ви име в Github
twitter: Потребителското Ви име в Twitter
event:
title: Заглавието на събитието Ви
subtitle: Подзаглавието на събитието Ви (ако има такова)
track_id: Потокът от лекции, в който искате да попадне събитието Ви
length: Продължителността на събитието може да бъде от 40 до 45 минути
language: Език, на който ще бъде водено събитието
abstract: Резюме на събитието, което да може да бъде прочетено от посетителите (1 абзац)
description: Подробно описание на събитието (няколко абзаца)
notes: Забележки, които искате да споделите с организаторския екип
agreement: Отбележете съгласни ли сте с това събитието Ви да бъде записано и публикувано под лиценз CC-BY-ND (Creative Commons Attribution No Derivatives)

View File

@ -0,0 +1,32 @@
en:
simple_form:
"yes": Yes
"no": No
required:
text: Required field
mark: '*'
error_notification:
default_message: 'Please see the errors below:'
hints:
user:
email: Your e-mail address. Will be visible to the organizers only.
password: Password with length between 8 and 128 symbols
password_confirmation: Repeat the password
speaker_profile:
picture: Your photo
organisation: Your organization
public_email: E-mail address, visible to the visitors
mobile_phone: Mobile phone, visible for the organizers only
biography: Describe yourself in a few sentences in third person :)
github: Your Github username
twitter: Your Twitter username
event:
title: Title of your event
subtitle: Sub-title of your event (if applicable)
track_id: Track for your event
length: The length of your event can be from 40 to 45 minutes
language: Language in which the event will be presented
abstract: Abstract of the event, for the visitors
description: Detailed description of the event, visible to the visitors
notes: Notes on your event, visible only to the organizers
agreement: Indicate if you accept that your event will be recorded and published under the CC-BY-ND (Creative Commons Attribution No Derivatives) license

View File

@ -0,0 +1,76 @@
bg:
views:
welcome:
submit_event: "Предложи %{event_type}"
home_title: "%{conference} - зов за лектори"
what_we_ask: 'Бихме искали да получим предложенията Ви за лекции и уъркшопи, принадлежащи към следните категории до 30 септември 2014г.:'
license_notice: 'Имайте предвид, че презентациите ви впоследствие ще бъдат публикувани с лиценз CC-BY-ND (Creative Commons Attribution No derivatives).'
submit_event: Предложи %{event_type}
resend_instructions_header: Повторно изпращане на инструкции за потвърждаване на акаунт
resend_instructions_btn: Изпрати отново инструкциите
enter: Вход
login: Вход
registration: Регистрация
lostpass: Забравена парола?
did_not_get_confirmation: Не сте получили инструкции за потвърждение?
did_not_get_unlock: Не сте получили инструкции за отключване?
change_pass: Промяна на парола
send_lostpass_instructions: Изпрати ми инструкции за промяна на парола
login_data: Данни за вход в системата
login_with: "Влез с %{with}"
speaker_profile: Лекторски профил
please_fill_in_your_speaker_profile: Моля, попълнете данните в лекторския си профил.
expected_validation: "Очаква се потвърждение на: %{email}"
pass_update_hint1: Не попълвайте, ако не желаете да промените паролата си
pass_update_hint2: Попълнете, ако искате да промените паролата или e-mail адреса си.
update: Обнови
resend_unlock_instructions_title: Изпрати отново инструкции за отключване
edit_speaker_profile: Редакция на профил
edit_workshop: Редакция на уъркшоп
edit_title: "поток: „%{track}“, продължителност: %{len} мин."
abstract: Резюме
description: Описание
edit: Редактирай
new_workshop_title: Предложи нов уъркшоп
my_workshops: Моите предложения за уъркшопи
no_workshops_submitted: Все още не сте предложили уъркшоп
edit_talk: Редакция на лекция
submit_talk_header: Предложи нова лекция
my_talks: Моите предложения за лекции
no_talks_submitted: Все още не сте предложили лекция
hello: "Здравейте, %{name}"
account_locked: Акаунтът Ви беше заключен поради голям брой неуспешни опити за влизане в него.
click_to_unlock: 'Кликнете линкът отдолу, за да го отключите:'
welcome: "Добре дошли, %{name}"
confirm_by_clicking: Можете да потвърдите акаунта си, като кликнете на линка отдолу
someone_requested_passreset: Някой поиска линк за промяна на парола на акаунта Ви. Паролата може да бъде променена от линкът отдолу.
do_not_want_pass_reset1: Ако не желаете да смените паролата си, моля изтрийте това писмо.
do_not_want_pass_reset2: Паролата Ви няма да бъде променена, докато не кликнете горния линк и не въведете нова парола.
home: Начало
talks: Лекции
workshops: Уъркшопи
logout: Изход
of_motto: да споделим свободата
meta_data: "Език: %{language}, поток: „%{track}“, продължителност: %{length} мин."
suggestion_and_speaker_count: "%{suggestions} предложения от %{speakers} лектори"
lecture_was_successfully_confirmed: "Лекцията беше потвърдена успешно"
workshop_was_successfully_confirmed: "Уъркшопът беше потвърден успешно"

View File

@ -0,0 +1,71 @@
en:
home_title: "%{conference} - call for speakers"
what_we_ask: 'Please send us applications for talks and workshops in the following categories until September 30, 2014:'
license_notice: 'Keep in mind that your workshop/presentation will later be published under the CC-BY-ND (Creative Commons Attribution No derivatives) license.'
submit_event: Submit %{event_type}
resend_instructions_header: Re-send the instructions for confirming an account
resend_instructions_btn: Re-send instructions
enter: Login
login: Login
registration: Registration
lostpass: Lost password?
did_not_get_confirmation: Did not get confirmation instructions?
did_not_get_unlock: Did not get unlocking instructions?
change_pass: Change password
send_lostpass_instructions: Send instructions to reset lost password
login_data: Login data
login_with: "Login with %{with}"
speaker_profile: Speaker's profile
please_fill_in_your_speaker_profile: Please fill in your speaker profile.
expected_validation: "Expected confirmation of: %{email}"
pass_update_hint1: Do not fill, if you do not want to change your password
pass_update_hint2: Fill this if you want to change your password or e-mail.
update: Update
resend_unlock_instructions_title: Re-send unlocking instructions
edit_speaker_profile: Edit profile
edit_workshop: Edit workshop
edit_title: "track: „%{track}“, duration: %{len} min."
abstract: Abstract
description: Description
edit: Edit
new_workshop_title: Submit new workshop
my_workshops: My submitted workshops
no_workshops_submitted: You have no submissions for workshops
edit_talk: Edit talk
submit_talk_header: Submit new talk
my_talks: My submitted talks
no_talks_submitted: You have no submissions for talks
hello: "Hello, %{name}"
account_locked: Your account was locked because of too many failed login attempts.
click_to_unlock: 'Click on the link below to unlock it:'
welcome: "Welcome, %{name}"
confirm_by_clicking: 'You can confirm your account by clicking on the link below:'
someone_requested_passreset: Someone has requested a link to reset the password of your account. Your password can be changed through the link below.
do_not_want_pass_reset1: If you don't want to change your password, please delete this message.
do_not_want_pass_reset2: Your password will not be changed unless you click on the link above and enter a new password.
home: Home
talks: Lectures
workshops: Workshops
logout: Logout
of_motto: share the freedom
meta_data: "Language: %{language}, track: \"%{track}\", length: %{length} min."
suggestion_and_speaker_count: "%{suggestions} suggestions by %{speakers} speakers"
lecture_was_successfully_confirmed: "The lecture was successfully confirmed"
workshop_was_successfully_confirmed: "The workshop was successfully confirmed"

View File

@ -0,0 +1,10 @@
OpenFest::Engine.routes.draw do
root to: 'events#index'
scope '(/:locale)' do
devise_for :users, module: 'open_fest/users'
resource :personal_profile, path: 'profile'
resources :events
end
end

View File

@ -0,0 +1,4 @@
require "open_fest/engine"
module OpenFest
end

View File

@ -0,0 +1,5 @@
module OpenFest
class Engine < ::Rails::Engine
isolate_namespace OpenFest
end
end

View File

@ -0,0 +1,3 @@
module OpenFest
VERSION = "0.0.1"
end

View File

@ -0,0 +1,4 @@
# desc "Explaining what the task does"
# task :open_fest do
# # Task goes here
# end

View File

@ -0,0 +1,23 @@
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "open_fest/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "open_fest"
s.version = OpenFest::VERSION
s.authors = ["Petko Bordjukov"]
s.email = ["bordjukov@gmail.com"]
s.summary = "OpenFest CFP User-facing part"
s.license = "MIT"
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["test/**/*"]
s.add_dependency "rails", "~> 4.2.3"
s.add_dependency "devise", ">= 0"
s.add_dependency "font-awesome-sass", ">= 0"
s.add_development_dependency "sqlite3"
end

View File

@ -0,0 +1,15 @@
require 'test_helper'
module OpenFest
class WelcomeControllerTest < ActionController::TestCase
setup do
@routes = Engine.routes
end
test "should get index" do
get :index
assert_response :success
end
end
end

View File

@ -0,0 +1,28 @@
== README
This README would normally document whatever steps are necessary to get the
application up and running.
Things you may want to cover:
* Ruby version
* System dependencies
* Configuration
* Database creation
* Database initialization
* How to run the test suite
* Services (job queues, cache servers, search engines, etc.)
* Deployment instructions
* ...
Please feel free to use a different markup language if you do not plan to run
<tt>rake doc:app</tt>.

View File

@ -0,0 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks

View File

@ -0,0 +1,13 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require_tree .

View File

@ -0,0 +1,15 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/

View File

@ -0,0 +1,5 @@
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end

View File

@ -0,0 +1,2 @@
module ApplicationHelper
end

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Dummy</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>

View File

@ -0,0 +1,3 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')

View File

@ -0,0 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'

View File

@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run

View File

@ -0,0 +1,29 @@
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end
puts "\n== Preparing database =="
system "bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end

View File

@ -0,0 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application

View File

@ -0,0 +1,26 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "open_fest"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
end
end

View File

@ -0,0 +1,5 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)

View File

@ -0,0 +1,25 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3

View File

@ -0,0 +1,5 @@
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!

View File

@ -0,0 +1,41 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
end

View File

@ -0,0 +1,79 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :debug
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end

View File

@ -0,0 +1,42 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure static file server for tests with Cache-Control for performance.
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Randomize the order test cases are executed.
config.active_support.test_order = :random
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
end

View File

@ -0,0 +1,11 @@
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )

Some files were not shown because too many files have changed in this diff Show More