add euro flag to procedure object
This commit is contained in:
parent
f42f3820e9
commit
8755ce2ab1
11 changed files with 78 additions and 10 deletions
BIN
app/assets/images/drapeau_europe.png
Normal file
BIN
app/assets/images/drapeau_europe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -14,7 +14,6 @@
|
|||
//= require jquery_ujs
|
||||
//= require turbolinks
|
||||
//= require_tree .
|
||||
//= require jquery
|
||||
//= require bootstrap-sprockets
|
||||
//= require bootstrap-datepicker/core
|
||||
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js
|
||||
|
|
|
@ -32,6 +32,13 @@ body {
|
|||
max-height: 100%;
|
||||
}
|
||||
|
||||
.logo_navbar {
|
||||
margin-left: 10px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
#beta {
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
|
|
|
@ -7,10 +7,23 @@ h5 span {
|
|||
}
|
||||
|
||||
#insee_infogreffe {
|
||||
font-size:17px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
#recap_dossier{
|
||||
.flag {
|
||||
display: inline;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-right: 20px;
|
||||
padding-left: 20px;
|
||||
|
||||
img {
|
||||
max-width: 150px;
|
||||
max-height: 70px;
|
||||
}
|
||||
}
|
||||
|
||||
#recap_dossier {
|
||||
#validate_button {
|
||||
float: right;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ class Admin::ProceduresController < AdminController
|
|||
private
|
||||
|
||||
def create_procedure_params
|
||||
params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, module_api_carto_attributes: [:id, :use_api_carto, :quartiers_prioritaires, :cadastre]).merge(administrateur_id: current_administrateur.id)
|
||||
params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, :euro_flag, module_api_carto_attributes: [:id, :use_api_carto, :quartiers_prioritaires, :cadastre]).merge(administrateur_id: current_administrateur.id)
|
||||
end
|
||||
|
||||
def create_module_api_carto_params
|
||||
|
|
|
@ -7,6 +7,12 @@
|
|||
=value
|
||||
=f.text_field key, class: 'form-control', placeholder: value
|
||||
|
||||
%h4 Drapeau européen
|
||||
%label
|
||||
=f.check_box :euro_flag
|
||||
Afficher le drapeau européen
|
||||
|
||||
%br
|
||||
%br
|
||||
|
||||
%h4 Cartographie
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
%div
|
||||
%div.navbar
|
||||
= image_tag('marianne_small.png', class: 'logo')
|
||||
%a{href: '/', class:'btn btn-lg'}
|
||||
='TPS'
|
||||
%a{href: '/'}
|
||||
= image_tag('logo-tps.png', class: 'logo')
|
||||
|
||||
#sign_out
|
||||
-if gestionnaire_signed_in?
|
||||
|
|
|
@ -2,14 +2,20 @@
|
|||
.row
|
||||
%p.lead{id: 'pro_section'}
|
||||
%br
|
||||
= image_tag('logo-tps.png')
|
||||
%br
|
||||
|
||||
- if @dossier.procedure.euro_flag
|
||||
#euro_flag.flag
|
||||
=image_tag('drapeau_europe.png')
|
||||
|
||||
#logo_procedure.flag
|
||||
=image_tag('logo-tps.png')
|
||||
|
||||
|
||||
%h2#titre_procedure.text-info
|
||||
= @dossier.procedure.libelle
|
||||
|
||||
%p
|
||||
= @dossier.procedure.description
|
||||
|
||||
%br
|
||||
|
||||
= form_for @dossier, url: {controller: 'users/dossiers', action: :create}, method: :post do |f|
|
||||
|
|
5
db/migrate/20151210134135_add_euro_flag_to_procedure.rb
Normal file
5
db/migrate/20151210134135_add_euro_flag_to_procedure.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddEuroFlagToProcedure < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :procedures, :euro_flag, :boolean, default: false
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20151207140202) do
|
||||
ActiveRecord::Schema.define(version: 20151210134135) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -160,6 +160,7 @@ ActiveRecord::Schema.define(version: 20151207140202) do
|
|||
t.boolean "test"
|
||||
t.integer "administrateur_id"
|
||||
t.boolean "archived", default: false
|
||||
t.boolean "euro_flag", default: false
|
||||
end
|
||||
|
||||
create_table "quartier_prioritaires", force: :cascade do |t|
|
||||
|
|
31
spec/views/users/dossiers/new_html.haml_spec.rb
Normal file
31
spec/views/users/dossiers/new_html.haml_spec.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'users/dossiers/new.html.haml', type: :view do
|
||||
let(:user) { create(:user) }
|
||||
let(:euro_flag) { false }
|
||||
let(:procedure) { create(:procedure, euro_flag: euro_flag) }
|
||||
let!(:dossier) { create(:dossier, procedure: procedure, user: user,).decorate }
|
||||
|
||||
describe 'euro flag' do
|
||||
before do
|
||||
sign_in user
|
||||
|
||||
assign(:dossier, dossier.decorate)
|
||||
render
|
||||
end
|
||||
|
||||
subject { rendered }
|
||||
|
||||
it { is_expected.to have_css('#users_siret_index') }
|
||||
|
||||
context 'euro flag is not present' do
|
||||
it { is_expected.not_to have_css('#euro_flag.flag') }
|
||||
end
|
||||
|
||||
context 'euro flag is present' do
|
||||
let(:euro_flag) { true }
|
||||
|
||||
it { is_expected.to have_css('#euro_flag.flag') }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue