diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/assets/stylesheets/application.css.scss.erb | 2 | ||||
| -rw-r--r-- | app/assets/stylesheets/main/layout.css.scss | 71 | ||||
| -rw-r--r-- | app/assets/stylesheets/modules/devise.css.scss | 75 | ||||
| -rw-r--r-- | app/assets/stylesheets/partials/header.css.scss | 27 | ||||
| -rw-r--r-- | app/assets/stylesheets/vendor/simple_form.css.scss | 6 | ||||
| -rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/registrations_controller.rb | 1 | ||||
| -rw-r--r-- | app/models/organisation.rb | 3 | ||||
| -rw-r--r-- | app/models/user.rb | 10 | ||||
| -rw-r--r-- | app/views/devise/passwords/new.html.erb | 20 | ||||
| -rw-r--r-- | app/views/devise/registrations/new.html.erb | 40 | ||||
| -rw-r--r-- | app/views/devise/sessions/new.html.erb | 78 | ||||
| -rw-r--r-- | app/views/layouts/devise.html.erb (renamed from app/views/layouts/without_sidebar.html.erb) | 18 | ||||
| -rw-r--r-- | app/views/shared/_header.erb | 4 |
14 files changed, 212 insertions, 145 deletions
diff --git a/app/assets/stylesheets/application.css.scss.erb b/app/assets/stylesheets/application.css.scss.erb index 3ea2b36ed..b510fc524 100644 --- a/app/assets/stylesheets/application.css.scss.erb +++ b/app/assets/stylesheets/application.css.scss.erb @@ -12,6 +12,7 @@ $body-bg: #eee; @import "modules/search"; @import "modules/index_item"; @import "modules/icons"; +@import "modules/devise"; // Partials @import "partials/header"; @@ -36,6 +37,7 @@ $body-bg: #eee; @import "vendor/token-input"; @import "vendor/typeahead"; @import "vendor/bootstrap_changes"; +@import "vendor/simple_form"; // Main css @import "main/*"; diff --git a/app/assets/stylesheets/main/layout.css.scss b/app/assets/stylesheets/main/layout.css.scss index 90da0cc6d..0a9ade3a8 100644 --- a/app/assets/stylesheets/main/layout.css.scss +++ b/app/assets/stylesheets/main/layout.css.scss @@ -1,5 +1,5 @@ body { - padding-top: 55px; + padding-top: 50px; } h1{ color: white;} @@ -17,75 +17,6 @@ ol.breadcrumb{ margin-top: 10px; } -#header { - - .navbar-brand{ - padding-top: 5px; - padding-bottom: 5px; - line-height: 40px; - - img { - height: 40px; - } - - .brand_name{ - margin-left: 3px; - margin-right: 3px; - font-size: 20px; - font-family: monospace; - font-weight: bold; - } - - .version - { - vertical-align: text-top; - color: white; - font-size: 12px; - } - } - - background: $brand_primary url(image-path('header.png')) no-repeat; - - .gravatar { - margin-right: 5px; - img{ - width: 25px; - height: 25px; - } - } - - .dropdown.languages{ - .dropdown-menu{ - min-width: 56px; - } - } - - .dropdown.datas{ - .dropdown-menu{ - - .badge{ - background-color: #DADADA - } - } - } -} - -#footer{ - padding: 20px; - background-color: $gray-darker; - color: $gray-light; - font-size: 12px; - min-height: 200px; - - a { color: $gray-light; } - - h4 { color: $gray-lighter; } - - .logo > img { - margin-left: 20px; - } -} - #middle{ min-height: 500px; -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, .2); diff --git a/app/assets/stylesheets/modules/devise.css.scss b/app/assets/stylesheets/modules/devise.css.scss new file mode 100644 index 000000000..83b2b3fec --- /dev/null +++ b/app/assets/stylesheets/modules/devise.css.scss @@ -0,0 +1,75 @@ +#devise{ + background-color: $gray-light; + + .front_bg{ + //background: url(image-path('intro.jpg')) no-repeat center center; + //background-size: cover; + + #devise_middle{ + min-height: 620px; + padding: 30px 20px 0px 20px; + + #registrations_new{ + + .form-group{ + margin-bottom: 5px; + } + + } + + #sessions_new{ + + .btn{ + font-weight: bold; + } + + .product_summary{ + padding: 30px 60px 0 60px; + + color: white; + text-shadow: 0 0 1px rgba(0,0,0,.6); + + p{ + font-size: 21px; + } + + ul > li{ font-size: 21px; } + } + + .login{ + padding-top: 30px; + + .form-group{ + margin-bottom: 5px; + } + + .options{ + .new_password{ + padding-top: 7px; + } + + .checkbox{ + font-weight: normal; + + input[type="checkbox"]{ + margin-left: 0px !important; + position: relative; + margin: 0px 4px 0px 0px; + } + } + + .form-group{ + margin-bottom: 0px; + } + + font-size: 12px; + } + } + } + } + + #footer{ + background-color: rgba(0, 0, 0, 0.8); + } + } +}
\ No newline at end of file diff --git a/app/assets/stylesheets/partials/header.css.scss b/app/assets/stylesheets/partials/header.css.scss index cc0e4a711..6f7b777f1 100644 --- a/app/assets/stylesheets/partials/header.css.scss +++ b/app/assets/stylesheets/partials/header.css.scss @@ -7,14 +7,25 @@ img { height: 40px; - } + } + } + .navbar-text{ + margin-top: 10px; + margin-bottom: 10px; + margin-left: 0px; + + .brand_name{ + color: white; + font-weight: bold; + font-size: 20px; + } + .version { - margin-left: 3px; - vertical-align: text-top; + margin-left: 5px; color: white; - font-size: 13px; + font-size: 12px; } } @@ -34,12 +45,4 @@ } } - .dropdown.datas{ - .dropdown-menu{ - - .badge{ - background-color: #333 - } - } - } }
\ No newline at end of file diff --git a/app/assets/stylesheets/vendor/simple_form.css.scss b/app/assets/stylesheets/vendor/simple_form.css.scss new file mode 100644 index 000000000..ea5e4d528 --- /dev/null +++ b/app/assets/stylesheets/vendor/simple_form.css.scss @@ -0,0 +1,6 @@ +.simple_form{ + + .help-inline{ + color:#cc0000; + } +}
\ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 64a706557..04dd281d5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -21,6 +21,6 @@ class ApplicationController < ActionController::Base # Overwriting the sign_out redirect path method def after_sign_out_path_for(resource_or_scope) new_user_session_path - end + end end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index f0ac420ce..b02d3217a 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -5,7 +5,6 @@ private def accept_user_creation - puts "J'y passe" if !Rails.application.config.accept_user_creation redirect_to root_path return false diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 17cf9a8f2..f4b2e35f8 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -3,6 +3,5 @@ class Organisation < ActiveRecord::Base has_many :users, :dependent => :destroy has_many :referentials, :dependent => :destroy - validates_presence_of :name - validates_uniqueness_of :name + validates :name, :presence => true, :uniqueness => true end diff --git a/app/models/user.rb b/app/models/user.rb index 1889a3bf0..6c14b93fb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,11 +11,11 @@ class User < ActiveRecord::Base belongs_to :organisation accepts_nested_attributes_for :organisation - - validates_presence_of :email - validates_presence_of :name - validates_presence_of :password - validates_presence_of :password_confirmation + + validates :organisation, :presence => true + validates :email, :presence => true, :uniqueness => true + validates :name, :presence => true + validates :password, :presence => true, :confirmation => true before_validation(:on => :create) do self.password ||= Devise.friendly_token.first(6) diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index f285a0f6d..68fd8c22a 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,13 +1,13 @@ -<%= title_tag t('.title') %> +<div class="panel panel-default"> + <div class="panel-heading"><%= t('.title') %></div> + <div class="panel-body"> + <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |form| %> + <%= form.input :email %> -<%= semantic_form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |form| %> - <%= form.inputs :email %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button, :label => t('.commit') %> - <%= form.action :cancel, :as => :link %> - <% end %> + <%= link_to t("cancel"), root_path, :class => "btn btn-default" %> + <%= form.button :submit, :value => t("devise.passwords.new.commit") %> + <% end %> + </div> +</div> -<% end %> -<%= render "links" %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 79edcb53b..9c780cba3 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,22 +1,26 @@ -<%= title_tag t('.title') %> +<div id="registrations_new" class="col-lg-offset-4 col-lg-4"> -<%= semantic_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |form| %> - <%= form.inputs do %> - <%= form.semantic_fields_for :organisation, Organisation.new do |organisation| %> - <%= organisation.input :name, :label => t("helpers.label.user.organisation_name") %> + <% if Rails.application.config.accept_user_creation %> + <div class="panel panel-default"> + <div class="panel-heading"><%= t("devise.registrations.new.title") %></div> + <div class="panel-body"> + <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label" ) do |form| %> + <%= form.simple_fields_for :organisation, Organisation.new do |organisation| %> + <%= organisation.input :name, :label => false, :placeholder => t("helpers.label.user.organisation_name"), input_html: { :class => "form-control" } %> + <% end %> + <% if resource.respond_to?( :name) %> + <%= form.input :name, :label => false, :placeholder => t("helpers.label.user.name"), input_html: { :class => "form-control" } %> + <% end %> + <%= form.input :email, :label => false, :placeholder => t("helpers.label.user.email"), input_html: { :class => "form-control" } %> + <%= form.input :password, :as => :password, :label => false, :placeholder => t("helpers.label.user.password"), input_html: { :class => "form-control" } %> + <%= form.input :password_confirmation, :as => :password, :label => false, :placeholder => t("helpers.label.user.password_confirmation"), input_html: { :class => "form-control" } %> + + <%= form.button :submit, :class => "btn-primary" %> + <% end %> + </div> + </div> <% end %> - <% if resource.respond_to?( :name) %> - <%= form.input :name %> - <% end %> - <%= form.input :email %> - <%= form.input :password, :as => :password %> - <%= form.input :password_confirmation, :as => :password %> - <% end %> + +</div> - <%= form.actions do %> - <%= form.action :submit, :as => :button, :label => t('.commit') %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> -<%= render "links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index a6c13df5d..768efdd9f 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,19 +1,65 @@ -<%= title_tag t('.title') %> +<div id="sessions_new" class="row"> + <div class="col-md-8 product_summary"> + <h2>Bienvenue sur Chouette</h2> + <p> + Chouette est un logiciel Open Source de saisie, de visualisation et d'échange d'offre de transport public planifiée. + </p> + <p> + Ce logiciel est déployé en mode Saas et se veut ouvert : + </p> + <ul> + <li>- choix de plusieurs fonds cartographiques</li> + <li>- échange de données en différents normes (Neptune, ...) et standard (GTFS, ...)</li> + </ul> + </div> + <div class="col-md-4 login"> + <div class="panel panel-default"> + <div class="panel-body"> + <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label" ) do |form| %> + <%= form.input :email, :label => false, :placeholder => t("helpers.label.user.email"), input_html: { :class => "form-control" } %> + <div class="row"> + <div class="col-md-6"> + <%= form.input :password, :as => :password, :label => false, :placeholder => t("helpers.label.user.password"), input_html: { :class => "form-control" } %> + </div> + <div class="col-md-6"> + <%= form.button :submit, t("devise.sessions.new.commit"), :class => "btn-primary" %> + </div> + </div> + <div class="row options"> + <div class="col-md-6"> + <% if devise_mapping.rememberable? %> + <%= form.input :remember_me, :as => :boolean, :label => false, :inline_label => t("helpers.label.user.remember_me") if devise_mapping.rememberable? %> + <% end %> + </div> + <div class="col-md-6 new_password"> + <%= link_to t("devise.links.new_password"), new_password_path(resource_name) %> + </div> + </div> + <% end %> + </div> + </div> -<%= semantic_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |form| %> - <%= form.inputs do %> - <%= form.input :email %> - <%= form.input :password, :as => :password %> - - <% if devise_mapping.rememberable? -%> - <%= form.input :remember_me, :as => :boolean %> + <% if Rails.application.config.accept_user_creation %> + <div class="panel panel-default"> + <div class="panel-heading"><%= t("devise.registrations.new.title") %></div> + <div class="panel-body"> + <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label" ) do |form| %> + <%= form.simple_fields_for :organisation, Organisation.new do |organisation| %> + <%= organisation.input :name, :label => false, :placeholder => t("helpers.label.user.organisation_name"), input_html: { :class => "form-control" } %> + <% end %> + <% if resource.respond_to?( :name) %> + <%= form.input :name, :label => false, :placeholder => t("helpers.label.user.name"), input_html: { :class => "form-control" } %> + <% end %> + <%= form.input :email, :label => false, :placeholder => t("helpers.label.user.email"), input_html: { :class => "form-control" } %> + <%= form.input :password, :as => :password, :label => false, :placeholder => t("helpers.label.user.password"), input_html: { :class => "form-control" } %> + <%= form.input :password_confirmation, :as => :password, :label => false, :placeholder => t("helpers.label.user.password_confirmation"), input_html: { :class => "form-control" } %> + + <%= form.button :submit, :class => "btn-default" %> + <% end %> + </div> + </div> <% end %> - <% end %> - - - <%= form.actions do %> - <%= form.action :submit, :as => :button, :label => t('.commit') %> - <% end %> -<% end %> + + </div> +</div> -<%= render "links" %> diff --git a/app/views/layouts/without_sidebar.html.erb b/app/views/layouts/devise.html.erb index c61dc6b25..60c531780 100644 --- a/app/views/layouts/without_sidebar.html.erb +++ b/app/views/layouts/devise.html.erb @@ -16,23 +16,25 @@ <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> </head> - <body> + <body id="devise"> <div id="header"> <%= render partial: "shared/header" %> </div> - <div id="middle" class="container"> - <div class="row"> - <div class="col-md-12"> + <div class="front_bg"> + <div id="devise_middle" class="container"> + <div class="row"> + <div class="<%= content_for?(:sidebar) ? 'col-md-9' : 'col-md-12' %>"> <div id="workspace" class="<%= controller_name %> <%= action_name %>"> <%= render partial: "shared/flash_messages", flash: flash %> <%= render partial: "shared/breadcrumb" %> <%= yield %> </div> </div> + </div> </div> - </div> - <div id="footer"> - <%= render partial: "shared/footer" %> - </div> + <div id="footer"> + <%= render partial: "shared/footer" %> + </div> + </div> </body> </html> diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb index 3b7c90926..380f5b520 100644 --- a/app/views/shared/_header.erb +++ b/app/views/shared/_header.erb @@ -10,10 +10,10 @@ <span class="icon-bar version"><%= APP_VERSION %></span> </button> <%= link_to referentials_path, :class =>"navbar-brand" do %> - <%= image_tag("logo_chouette.png") %><span class="brand_name">CHOUETTE</span></i><span class="version"><%= APP_VERSION %></span> + <%= image_tag("logo_chouette.png") %> <% end %> + <p class="navbar-text"><span class="brand_name">CHOUETTE</span></i><span class="version"><%= APP_VERSION %></span></p> </div> - <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> |
