Sections: prevent parent/child loop & force unqiue name/shortname
This commit is contained in:
parent
360ed9acd4
commit
1cdbc1cbb6
2 changed files with 52 additions and 16 deletions
|
|
@ -68,16 +68,19 @@
|
|||
id="parent_section"
|
||||
class="form-control"
|
||||
name="parent_section"
|
||||
{% if IsParent %}disabled{% endif %}
|
||||
>
|
||||
<option value="0">--- Pas de section parente ---</option>
|
||||
{% for ParentSection in Sections %}
|
||||
<option
|
||||
value="{{ ParentSection.ID }}"
|
||||
{% if Section.ParentSectionID == ParentSection.ID %}selected{% endif %}
|
||||
>
|
||||
{{ ParentSection.Name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% if !IsParent %}
|
||||
{% for ParentSection in Sections %}
|
||||
<option
|
||||
value="{{ ParentSection.ID }}"
|
||||
{% if Section.ParentSectionID == ParentSection.ID %}selected{% endif %}
|
||||
>
|
||||
{{ ParentSection.Name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue