remove useless view
This commit is contained in:
parent
37b4823e9a
commit
90c7e85980
5 changed files with 0 additions and 162 deletions
|
@ -1 +0,0 @@
|
|||
$("#champs").html("<%= escape_javascript(render partial: 'types_de_champ/liste', locals: { types_de_champ: @types_de_champ } ) %>");
|
|
@ -4,5 +4,3 @@
|
|||
= form_for @procedure, url: {controller: 'admin/procedures', action: :create} do |f|
|
||||
=render partial: 'informations', locals: {f: f}
|
||||
=f.submit 'Valider', class: 'btn btn-info', style: 'float:right'
|
||||
%br
|
||||
%br
|
|
@ -1,76 +0,0 @@
|
|||
/ - types_de_champ.each do |type_de_champ|
|
||||
= f.fields_for :types_de_champ, types_de_champ, remote: true do |ff|
|
||||
.form-inline
|
||||
.form-group
|
||||
%h4 Libellé
|
||||
= ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé'
|
||||
.form-group
|
||||
%h4 Type
|
||||
= ff.select :type_champ, TypeDeChamp.type_champ, {}, {class: 'form-control type_champ'}
|
||||
.form-group
|
||||
%h4 Description
|
||||
= ff.text_area :description, class: 'form-control description', placeholder: 'Description'
|
||||
.form-group
|
||||
= ff.hidden_field :order_place
|
||||
= ff.hidden_field :id
|
||||
|
||||
/ .form-group.order_type_de_champ_button{id: "order_type_de_champ_#{type_de_champ.id || index}_button", style: ("display:none" if type_de_champ.id.nil?)}
|
||||
.form-group
|
||||
%br
|
||||
%button.form-control.btn.btn-default.button_up.fa.fa-chevron-up{type: 'button'}
|
||||
/ , id: "order_type_de_champ_#{type_de_champ.id || index}_up_procedure"}
|
||||
%button.form-control.btn.btn-default.button_down.fa.fa-chevron-down{type: 'button'}
|
||||
/ , id: "order_type_de_champ_#{type_de_champ.id || index}_down_procedure"}
|
||||
|
||||
/ .form-group{ id: "delete_type_de_champ_#{type_de_champ.id || index}_button", style: ("display:none" if type_de_champ.id.nil?)}
|
||||
- unless ff.object.id.nil?
|
||||
.form-group
|
||||
%br
|
||||
= link_to("Delete", admin_procedure_type_de_champ_path(@procedure, ff.object.id), method: :delete, remote: true)
|
||||
/ %button.form-control.btn.btn-danger.fa.fa-trash-o{type: 'button'}
|
||||
/ , id: "delete_type_de_champ_#{type_de_champ.id || index}_procedure"}
|
||||
|
||||
-if ff.object.id.nil?
|
||||
.form-group#add_type_de_champ_button
|
||||
%br
|
||||
= ff.submit('Ajouter', :'data-remote' => true)
|
||||
%button.form-control.btn.btn-success#add_type_de_champ_procedure{type: 'button'} Ajouter
|
||||
|
||||
|
||||
/ - types_de_champ.each do |type_de_champ|
|
||||
/ - type_de_champ.id.nil? ? object_for = "new_type_de_champ[#{index}]" : object_for = 'types_de_champ[]'
|
||||
|
||||
/ = f.fields_for object_for, type_de_champ do |ff|
|
||||
/ .form-inline{id:"type_de_champ_#{type_de_champ.id || index}", class: 'type_de_champ', style: 'padding-bottom:8px'}
|
||||
/ .form-group{ style: 'padding-right: 2%' }
|
||||
/ %h4 Libellé
|
||||
/ =ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé'
|
||||
|
||||
/ .form-group{ style: 'padding-right: 2%' }
|
||||
/ %h4 Type
|
||||
/ =ff.select :type_champ, TypeDeChamp.type_champ, {}, {class: 'form-control type_champ'}
|
||||
|
||||
/ .form-group{ style: 'padding-right: 2%' }
|
||||
/ %h4 Description
|
||||
/ =ff.text_area :description, class: 'form-control description', placeholder: 'Description'
|
||||
|
||||
/ -if order_place.nil?
|
||||
/ =ff.hidden_field :order_place, class: 'order_place'
|
||||
/ -else
|
||||
/ =ff.hidden_field :order_place, value: order_place, class: 'order_place'
|
||||
/ =ff.hidden_field '_destroy', value: 'false', class: 'destroy'
|
||||
|
||||
/ .form-group.order_type_de_champ_button{id: "order_type_de_champ_#{type_de_champ.id || index}_button", style: ("display:none" if type_de_champ.id.nil?)}
|
||||
/ %br
|
||||
/ %button.form-control.btn.btn-default.button_up.fa.fa-chevron-up{type: 'button', id: "order_type_de_champ_#{type_de_champ.id || index}_up_procedure"}
|
||||
/ %button.form-control.btn.btn-default.button_down.fa.fa-chevron-down{type: 'button', id: "order_type_de_champ_#{type_de_champ.id || index}_down_procedure"}
|
||||
|
||||
/ .form-group{ id: "delete_type_de_champ_#{type_de_champ.id || index}_button", style: ("display:none" if type_de_champ.id.nil?)}
|
||||
/ %br
|
||||
/ %button.form-control.btn.btn-danger.fa.fa-trash-o{type: 'button', id: "delete_type_de_champ_#{type_de_champ.id || index}_procedure"}
|
||||
|
||||
/ -if type_de_champ.id.nil?
|
||||
/ .form-group#add_type_de_champ_button
|
||||
/ %br
|
||||
/ %button.form-control.btn.btn-success#add_type_de_champ_procedure{type: 'button'} Ajouter
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
#liste_champ
|
||||
-unless @types_de_champ.nil?
|
||||
=render partial: 'admin/procedures/types_de_champ/form', locals:{ types_de_champ: @types_de_champ, order_place: nil, f: f, procedure: procedure }
|
||||
|
||||
#liste_delete_champ
|
||||
|
||||
#new_type_de_champ
|
||||
=render partial: 'admin/procedures/types_de_champ/form', locals:{ types_de_champ: [TypeDeChamp.new], index: (@types_de_champ.nil? || @types_de_champ.last.nil? ? 0 : @procedure.types_de_champ.last.id+1), order_place: (@types_de_champ.nil? ? 1 : @types_de_champ.size+1), f: f, procedure: procedure }
|
||||
|
||||
%script{ type:'text/javascript' }
|
||||
="var types_de_champ_index = #{(@types_de_champ.nil? || @types_de_champ.last.nil? ? 0 : @procedure.types_de_champ.last.id+1)}"
|
|
@ -1,72 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
# feature 'move up and down button type de champs', js: true do
|
||||
# let(:administrateur) { create(:administrateur) }
|
||||
|
||||
# before do
|
||||
# login_as administrateur, scope: :administrateur
|
||||
# end
|
||||
|
||||
# context 'when click on move up and down type de champs button' do
|
||||
# let!(:procedure) { create(:procedure, :with_type_de_champ) }
|
||||
# let!(:type_de_champ) { create(:type_de_champ, procedure: procedure, order_place: 2) }
|
||||
|
||||
# before do
|
||||
# visit admin_procedure_path id: procedure.id
|
||||
# end
|
||||
|
||||
# context 'when procedure have two type de champs in database and 3 type de champs add on the page' do
|
||||
# before do
|
||||
# page.click_on 'add_type_de_champ_procedure'
|
||||
# page.click_on 'add_type_de_champ_procedure'
|
||||
# page.click_on 'add_type_de_champ_procedure'
|
||||
# end
|
||||
# #
|
||||
# context 'when to click on up_button type_de_champ_2 and down_button type_de_champ_1' do
|
||||
# before do
|
||||
# page.click_on 'order_type_de_champ_2_up_procedure'
|
||||
# page.click_on 'order_type_de_champ_1_down_procedure'
|
||||
# end
|
||||
|
||||
# scenario 'type_de_champ_1 is at order place 3 and type_de_champ_2 is at order place 1 ' do
|
||||
# expect(page.find_by_id('type_de_champ_2').find('input[class="order_place"]', visible: false).value).to eq('1');
|
||||
# expect(page.find_by_id('type_de_champ_3').find('input[class="order_place"]', visible: false).value).to eq('2');
|
||||
# expect(page.find_by_id('type_de_champ_1').find('input[class="order_place"]', visible: false).value).to eq('3');
|
||||
# expect(page.find_by_id('type_de_champ_4').find('input[class="order_place"]', visible: false).value).to eq('4');
|
||||
# expect(page.find_by_id('type_de_champ_5').find('input[class="order_place"]', visible: false).value).to eq('5');
|
||||
# end
|
||||
|
||||
# context 'when to click on down_button type_de_champ_4 and up_button type_de_champ_5' do
|
||||
# before do
|
||||
# page.click_on 'order_type_de_champ_4_down_procedure'
|
||||
# page.click_on 'order_type_de_champ_5_up_procedure'
|
||||
# end
|
||||
|
||||
# scenario 'type_de_champ_2 and type_de_champ_3 is reversed' do
|
||||
# expect(page.find_by_id('type_de_champ_2').find('input[class="order_place"]', visible: false).value).to eq('1');
|
||||
# expect(page.find_by_id('type_de_champ_3').find('input[class="order_place"]', visible: false).value).to eq('2');
|
||||
# expect(page.find_by_id('type_de_champ_5').find('input[class="order_place"]', visible: false).value).to eq('3');
|
||||
# expect(page.find_by_id('type_de_champ_1').find('input[class="order_place"]', visible: false).value).to eq('4');
|
||||
# expect(page.find_by_id('type_de_champ_4').find('input[class="order_place"]', visible: false).value).to eq('5');
|
||||
# end
|
||||
|
||||
# context 'when to click on up_button type_de_champ_3 and down_button type_de_champ_1 and up_button type_de_champ_5' do
|
||||
# before do
|
||||
# page.click_on 'order_type_de_champ_3_up_procedure'
|
||||
# page.click_on 'order_type_de_champ_1_down_procedure'
|
||||
# page.click_on 'order_type_de_champ_5_up_procedure'
|
||||
# end
|
||||
|
||||
# scenario 'type_de_champ_2 and type_de_champ_4 is reversed' do
|
||||
# expect(page.find_by_id('type_de_champ_3').find('input[class="order_place"]', visible: false).value).to eq('1');
|
||||
# expect(page.find_by_id('type_de_champ_5').find('input[class="order_place"]', visible: false).value).to eq('2');
|
||||
# expect(page.find_by_id('type_de_champ_2').find('input[class="order_place"]', visible: false).value).to eq('3');
|
||||
# expect(page.find_by_id('type_de_champ_4').find('input[class="order_place"]', visible: false).value).to eq('4');
|
||||
# expect(page.find_by_id('type_de_champ_1').find('input[class="order_place"]', visible: false).value).to eq('5');
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
Loading…
Reference in a new issue