This commit is contained in:
Nicolas Bally 2012-02-09 19:43:30 +01:00
parent bec8016ece
commit 5e008f138c
12 changed files with 2630 additions and 54 deletions

12
.gitignore vendored
View File

@ -1,10 +1,8 @@
.bundle .bundle
db/*.sqlite3 db/*.sqlite3
db/schema.rb
log/*.log log/*.log
tmp/**/* tmp/
.sass-cache/
public/assets/stylesheets/* .DS_Store
private_medias/
.sass-cache/** public/public_medias

View File

@ -1,57 +1,68 @@
set :user, 'web' set :application, 'accescible_app'
set :domain, 'www.accescible-solutions.com'
set :application, 'www.accescible-solutions.com' # use your folder app name
set :deploy_to, "/home/#{user}/apps/#{application}/" # the live app will be in the "current" subdir
set :deploy_via, :remote_cache
#set :keep_releases, 1
#use trunk to deploy to production $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
set :branch, "master"
set :rails_env, "production"
#production require "rvm/capistrano"
set :domain, 'www.accescible-solutions.com' # your http://publicdomain.com
role :app, domain set :rvm_ruby_string, 'ruby-1.9.3-p0'
role :web, domain set :rvm_type, :user
role :db, domain, :primary => true
set :user, 'web'
set :scm, :git set :deploy_to, "/home/#{user}/#{application}/"
set :repository, "git@box1.quartz-agence.com:accescible.git" set :deploy_via, :remote_cache
set :use_sudo, false set :normalize_asset_timestamps, false
set :ssh_options, {:forward_agent => true}
after "deploy", "deploy:bundle_gems"
after "deploy:bundle_gems", "deploy:make_simlinks"
after "deploy:make_simlinks", "deploy:restart"
after "deploy:restart", "deploy:cleanup"
# if you're still using the script/reaper helper you will need set :rails_env, "production"
# these http://github.com/rails/irs_process_scripts
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :bundle_gems do role :app, domain
run "cd #{deploy_to}current && bundle install" role :web, domain
end role :db, domain, :primary => true
task :make_simlinks do set :scm, :git
run "rm -rf #{deploy_to}current/db/production.sqlite3" set :repository, "git@box1.quartz-agence.com:#{application}.git"
run "ln -s #{deploy_to}shared/sqlite3_databases/production.sqlite3 #{deploy_to}current/db/production.sqlite3" set :branch, "master"
run "rm -rf #{deploy_to}current/private_medias" default_run_options[:pty] = true
run "ln -s #{deploy_to}shared/medias/private #{deploy_to}current/private_medias"
run "rm -rf #{deploy_to}current/public/public_medias" after "deploy", "deploy:bundle_gems"
run "ln -s #{deploy_to}shared/medias/public #{deploy_to}current/public/public_medias" after "deploy:bundle_gems", "deploy:make_simlinks"
end after "deploy:make_simlinks", "deploy:restart"
task :start do ; end after "deploy:restart", "deploy:cleanup"
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path,'tmp','restart.txt')}" namespace :deploy do
end task :bundle_gems do
end run "cd #{deploy_to}current && bundle install"
end
task :make_simlinks do
run "rm -rf #{deploy_to}current/private_medias"
run "ln -s #{deploy_to}shared/storage/private #{deploy_to}current/private_medias"
run "rm -rf #{deploy_to}current/public/public_medias"
run "ln -s #{deploy_to}shared/storage/public #{deploy_to}current/public/public_medias"
end
task :start do
sudo "service #{application} start"
end
task :stop do
run "service #{application} stop"
end
task :restart, :roles => :app, :except => { :no_release => true } do
sudo "service #{application} restart"
end
task :migrate do
run "cd #{deploy_to}current && rake db:migrate RAILS_ENV=#{rails_env}"
end
end

21
config/nginx.conf Normal file
View File

@ -0,0 +1,21 @@
upstream accescible_app_unicorn {
server unix:/home/web/accescible_app/shared/tmp/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.accescible-solutions.com;
root /home/web/accescible_app/current/public;
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://accescible_app_unicorn;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}

10
config/unicorn.rb Normal file
View File

@ -0,0 +1,10 @@
@rails_app = "accescible_app"
working_directory "/home/web/#{@rails_app}/current"
pid "/home/web/#{@rails_app}/shared/unicorn.pid"
stderr_path "/home/web/#{@rails_app}/shared/log/unicorn.log"
stdout_path "/home/web/#{@rails_app}/shared/log/unicorn.log"
listen "/home/web/#{@rails_app}/shared/tmp/unicorn.sock"
worker_processes 2
timeout 30

328
db/schema.rb Normal file
View File

@ -0,0 +1,328 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110427164514) do
create_table "admins", :force => true do |t|
t.string "email", :default => "", :null => false
t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "reset_password_token"
t.string "remember_token"
t.datetime "remember_created_at"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "username"
t.string "surname"
t.string "firstname"
t.integer "roles_mask"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "albums", :force => true do |t|
t.string "name"
t.boolean "super_admin"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "allowed_block_contents", :force => true do |t|
t.integer "block_id"
t.integer "content_type_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "block_contents", :force => true do |t|
t.integer "style"
t.integer "nbr_columns"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "blocks", :force => true do |t|
t.string "block_name"
t.string "blockable_type"
t.integer "blockable_id"
t.text "content"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "break_contents", :force => true do |t|
t.boolean "line"
t.integer "height"
t.string "style"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "cel_tables", :force => true do |t|
t.integer "position"
t.integer "style"
t.integer "table_row_id"
t.integer "table_content_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "cible_aliases", :force => true do |t|
t.integer "menu_item_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "cible_types", :force => true do |t|
t.string "slug"
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "cible_urls", :force => true do |t|
t.string "url"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "content_types", :force => true do |t|
t.string "slug"
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "data_files", :force => true do |t|
t.string "file"
t.string "name"
t.string "slug"
t.string "description"
t.integer "file_folder_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "download_contents", :force => true do |t|
t.string "title"
t.string "style"
t.text "description"
t.integer "data_file_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "dynamic_contents", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "file_folders", :force => true do |t|
t.string "name"
t.boolean "super_admin"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "gallery_contents", :force => true do |t|
t.string "name"
t.text "description"
t.integer "style"
t.integer "nbr_img"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "gallery_images", :force => true do |t|
t.string "title"
t.text "description"
t.integer "position"
t.integer "image_file_id"
t.integer "gallery_content_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "html_contents", :force => true do |t|
t.text "content"
t.string "style"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "image_contents", :force => true do |t|
t.integer "image_file_id"
t.integer "width"
t.integer "height"
t.string "alignement"
t.boolean "expandable"
t.string "style"
t.string "alt"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "image_files", :force => true do |t|
t.string "file"
t.string "name"
t.string "slug"
t.text "description"
t.string "tags"
t.integer "album_id"
t.boolean "home"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "link_contents", :force => true do |t|
t.integer "type"
t.string "name"
t.string "title"
t.boolean "popup"
t.string "url"
t.string "style"
t.integer "cible_id"
t.string "cible_type"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "map_contents", :force => true do |t|
t.string "address"
t.string "name"
t.integer "view"
t.boolean "info_bule"
t.integer "zoom"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "menu_aliases", :force => true do |t|
t.integer "menu_item_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "menu_item_content_types", :force => true do |t|
t.string "name"
t.string "slug"
t.boolean "super_admin"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "menu_items", :force => true do |t|
t.string "name"
t.string "slug"
t.string "permalink"
t.integer "parent_id"
t.integer "position"
t.boolean "super_admin"
t.boolean "enabled"
t.boolean "visible"
t.boolean "deleted"
t.integer "menu_id"
t.integer "menu_content_id"
t.string "menu_content_type"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "menu_urls", :force => true do |t|
t.string "url"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "menus", :force => true do |t|
t.string "name"
t.string "max_levels"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "pages", :force => true do |t|
t.text "title"
t.text "description"
t.text "keywords"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "portlets", :force => true do |t|
t.integer "block_id"
t.integer "content_id"
t.string "content_type"
t.integer "position"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "sessions", :force => true do |t|
t.string "session_id", :null => false
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
create_table "table_contents", :force => true do |t|
t.integer "style"
t.integer "nbr_rows"
t.integer "nbr_cols"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "table_rows", :force => true do |t|
t.integer "position"
t.integer "style"
t.integer "table_content_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "tags", :force => true do |t|
t.string "name"
t.string "slug"
t.integer "parent_id"
t.boolean "public"
t.string "taggable_type"
t.integer "taggable_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "text_contents", :force => true do |t|
t.string "style"
t.text "content"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "title_contents", :force => true do |t|
t.text "content"
t.integer "level"
t.string "style"
t.datetime "created_at"
t.datetime "updated_at"
end
end

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
/*
*=require admin/core/reset
*= require_self
*= require admin/core/forms
*= require admin/core/elements
*= require admin/core/general
*/
body {
background: #3f94eb;
font-family: verdana;
padding: 0px;
margin: 0px;
-webkit-font-smoothing: antialiased;
font-size: 13px;
font-family: "Lucida Grande", arial, helvetica, sans-serif; }
body #title {
width: 520px;
margin: auto;
margin-top: 10%;
color: #9fc9f5;
text-shadow: 0 1px 1px #3f94eb;
padding: 0px;
text-transform: uppercase; }
body #main {
background: white;
width: 500px;
padding: 10px;
margin: auto;
-webkit-box-shadow: #666666 0px 0px 20px;
-moz-box-shadow: #666666 0px 0px 20px;
box-shadow: #666666 0px 0px 20px; }

View File

@ -0,0 +1,162 @@
/*
* FIXME: Introduce SCSS & Sprockets
*= require_self
*= require prettyPhoto
*= require formtastic
*= require_tree .
*/
body {
padding: 0px;
margin: 0px;
font-size: 14px;
font-family: "Verdana";
color: #1d1d1d; }
a {
color: #001c6d;
text-decoration: none; }
a img {
border: 0px; }
a:hover {
text-decoration: underline;
color: #68c545; }
#breadcrumb {
color: #848484; }
#breadcrumb * {
color: #848484; }
#public_core {
margin: auto;
width: 960px;
margin-top: 20px;
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.4);
-o-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.4);
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.4);
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.4);
border: 1px solid #87c51c;
background: white; }
#public_core #header {
padding: 1px; }
#public_core #header table {
width: 100%; }
#public_core #header #logo {
width: 160px;
text-align: center; }
#public_core #header h1 {
margin-top: 0px;
text-align: center; }
#public_core #menu_top {
background: #87c51c;
text-align: center; }
#public_core #menu_top a {
display: inline-block;
padding: 5px 10px 5px 10px;
text-transform: uppercase;
color: white;
text-decoration: none;
min-width: 100px;
text-align: center;
border-bottom: 2px solid transparent; }
#public_core #menu_top a:hover {
border-color: #001871;
color: white; }
#public_core #page_main #sidebar {
float: left;
width: 240px;
position: relative;
min-height: 400px;
background: #eaeaea; }
#menu_left ul {
list-style: none;
padding-left: 0px; }
#menu_left ul li a {
display: block;
padding: 5px;
color: #3f3f3f;
border-bottom: 1px solid white; }
#menu_left ul li a:hover {
background: #f8f8f8; }
#menu_left ul ul {
padding-bottom: 10px; }
#menu_left ul ul li a {
color: #5b5b5b;
padding-left: 20px;
border-bottom: 1px dotted white; }
#public #header {
width: 960px;
margin: auto; }
body .clear {
clear: both; }
body #page_main {
width: 960px;
margin: auto; }
body #page_main #content {
float: left;
width: 700px;
padding: 10px; }
body #menu_bottom {
margin: auto;
width: 960px;
margin-top: 20px;
margin-bottom: 20px; }
body #menu_bottom #left_bottom {
float: left; }
body #menu_bottom #right_bottom {
float: right; }
body .article {
border: 1px solid RGB(129, 178, 11);
padding: 10px;
margin-bottom: 10px; }
body .article h3 {
color: RGB(129, 178, 11); }
body .article .image_file {
float: left;
margin-right: 10px; }
body .article .title, body .article .description {
margin-left: 130px; }
body .article .title a, body .article .description a {
color: #604435;
text-decoration: none; }
#flash_notice {
border: 3px solid #6bb800;
padding: 10px; }
.portlet.table_content table {
width: 100%;
border-collapse: collapse; }
.portlet.table_content table td {
border: 1px solid black; }
.portlet.block_content .two_column .column {
float: left;
width: 50%; }
.portlet.block_content .two_column .column .block {
padding: 10px; }
.portlet.link_content {
padding: 5px; }
.portlet.download_content {
padding: 5px;
padding-left: 20px;
border: 1px solid #6bb800; }

View File

@ -0,0 +1,96 @@
/* tutorial */
input[type=text], input[type=password], textarea {
padding: 5px;
border: solid 1px #C9C9C9;
outline: 0;
font: normal 13px/100% Verdana, Tahoma, sans-serif;
width: 200px;
background: -webkit-gradient(linear, left top, left 25, from(white), color-stop(4%, #f7f7f7), to(white));
background: -moz-linear-gradient(top, white, #f7f7f7 1px, white 25px); }
textarea {
width: 400px;
max-width: 400px;
height: 150px;
line-height: 150%; }
input:hover, textarea:hover,
input:focus, textarea:focus {
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px; }
label {
cursor: pointer; }
.button {
display: inline-block;
background: #3c74a8;
background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#eff2f2), to(white));
background: -moz-linear-gradient(bottom, #eff2f2, white);
box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 3px;
-moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 3px;
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 3px;
border: none;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
color: RGB(46, 46, 46);
padding: 5px 15px;
margin: 0px 5px 0px 5px;
font-weight: normal; }
.button:hover {
box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 5px;
-moz-box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 5px;
-webkit-box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 5px;
color: RGB(46, 46, 46);
cursor: pointer; }
.actions {
text-align: right; }
button, input[type=submit] {
display: inline-block;
background: #3c74a8;
background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#3c74a8), to(#6792bb));
background: -moz-linear-gradient(bottom, #3c74a8, #6792bb);
box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 3px;
-moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 3px;
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 3px;
border: none;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
color: white;
margin: 0px 5px 0px 5px;
padding: 5px 15px;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
font-weight: normal;
font-size: 13px; }
button:hover, input[type=submit]:hover {
box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 5px;
-moz-box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 5px;
-webkit-box-shadow: rgba(0, 0, 0, 0.6) 0px 0px 5px;
cursor: pointer; }
.field_with_errors {
display: inline;
color: red; }
.field_with_errors input {
display: inline;
border-color: red; }
.errorExplanation {
border-top: 1px solid black;
border-bottom: 1px solid black;
padding: 5px;
border-color: #F2EDA1;
background: #FEFCDB; }
.errorExplanation h2 {
font-size: 13px;
margin: 0px;
padding: 0px; }

View File

@ -0,0 +1,39 @@
.message {
border: 4px solid black;
border-radius: 10px;
padding: 5px;
margin: 20px;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 1px 1px 40px;
-moz-box-shadow: rgba(0, 0, 0, 0.5) 1px 1px 40px;
box-shadow: rgba(0, 0, 0, 0.5) 1px 1px 40px; }
.alert {
border-color: #f2eda1;
background: rgba(254, 252, 219, 0.8); }
.notice {
border-color: #cde6f5;
background: rgba(236, 248, 254, 0.8); }
#flash {
position: fixed;
bottom: 0px;
width: 100%; }
a img {
border: 0px; }
table {
border-collapse: collapse;
width: 100%; }
h1, h2, h3, h4, h5, h6 {
margin: 0px;
padding: 0px; }
a {
color: #3C74A8;
text-decoration: none; }
a:hover {
color: #3F94EB; }

View File

@ -0,0 +1,45 @@
.QI_background_middle {
background-color: #e2eef7; }
.QI_background_middle_alt1 {
background-color: #a9d64b; }
.QI_padding_small {
padding: 5px; }
.QI_padding {
padding: 10px; }
.QI_table_alternate_alt1 tr:nth-child(odd) {
background-color: #ebf4fa; }
.QI_background_resize {
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
-moz-background-size: contain;
-webkit-background-size: contain; }
.QI_box_shadow {
-webkit-box-shadow: #AFAFAF 0px 0px 5px;
-moz-box-shadow: #AFAFAF 0px 0px 5px;
box-shadow: #AFAFAF 0px 0px 5px; }
.QI_font_alt1 {
font-family: Georgia; }
.QI_font {
font-family: Lucida grande; }
.QI_color_white {
color: white; }
.bar_transparent_dark {
background: rgba(0, 0, 0, 0.8);
height: 34px; }
.position_absolute_bottom {
position: absolute;
bottom: 0px;
right: 0px;
left: 0px; }

View File

@ -0,0 +1,45 @@
.QI_background_middle {
background-color: #e2eef7; }
.QI_background_middle_alt1 {
background-color: #a9d64b; }
.QI_padding_small {
padding: 5px; }
.QI_padding {
padding: 10px; }
.QI_table_alternate_alt1 tr:nth-child(odd) {
background-color: #ebf4fa; }
.QI_background_resize {
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
-moz-background-size: contain;
-webkit-background-size: contain; }
.QI_box_shadow {
-webkit-box-shadow: #AFAFAF 0px 0px 5px;
-moz-box-shadow: #AFAFAF 0px 0px 5px;
box-shadow: #AFAFAF 0px 0px 5px; }
.QI_font_alt1 {
font-family: Georgia; }
.QI_font {
font-family: Lucida grande; }
.QI_color_white {
color: white; }
.bar_transparent_dark {
background: rgba(0, 0, 0, 0.8);
height: 34px; }
.position_absolute_bottom {
position: absolute;
bottom: 0px;
right: 0px;
left: 0px; }