Revert "form: add number to section headers"
This reverts commit f42977e40a
.
This commit is contained in:
parent
3e1ba4eebc
commit
e3ba2ed96c
3 changed files with 0 additions and 37 deletions
|
@ -2,11 +2,4 @@ class Champs::HeaderSectionChamp < Champ
|
|||
def search_terms
|
||||
# The user cannot enter any information here so it doesn’t make much sense to search
|
||||
end
|
||||
|
||||
def section_index
|
||||
dossier
|
||||
.champs
|
||||
.filter { |c| c.type_champ == TypeDeChamp.type_champs.fetch(:header_section) }
|
||||
.index(self) + 1
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
- section_index = champ.section_index
|
||||
|
||||
%h2.header-section
|
||||
- if section_index
|
||||
= "#{section_index}."
|
||||
= champ.libelle
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Champs::CheckboxChamp do
|
||||
let(:types_de_champ) do
|
||||
[
|
||||
create(:type_de_champ_header_section, order_place: 1),
|
||||
create(:type_de_champ_civilite, order_place: 2),
|
||||
create(:type_de_champ_text, order_place: 3),
|
||||
create(:type_de_champ_header_section, order_place: 4),
|
||||
create(:type_de_champ_email, order_place: 5)
|
||||
]
|
||||
end
|
||||
|
||||
let(:procedure) { create(:procedure, types_de_champ: types_de_champ) }
|
||||
let(:dossier) { create(:dossier, procedure: procedure) }
|
||||
|
||||
describe '#section_index' do
|
||||
let(:first_header) { dossier.champs[0] }
|
||||
let(:second_header) { dossier.champs[3] }
|
||||
|
||||
it 'returns the index of the section (starting from 1)' do
|
||||
expect(first_header.section_index).to eq 1
|
||||
expect(second_header.section_index).to eq 2
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue