<commit_before>{% extends "base.html" %}
{% block page_includes -%}
	<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/form.css') }}" />
	<script type="text/javascript" src="{{ url_for('static', filename='js/form.js') }}"></script>
	<script type="text/javascript">
		"use strict";
		var formLevels = [
			{% for level in accesslevels -%}
			'{{ level.name }}',
			{% endfor -%}
		];
		var formLevelIndex = '{{ accesslevel_index }}';
		var formLevel      = formLevels[formLevelIndex];
		var userLevel      = '{{ user_accesslevel_index }}';

		var Config = {
			hideDisabledComponents: true
		};
	</script>
{% endblock -%}
{% macro render_buttonset(component) -%}
{# Renders the reset, add and remove buttons for a block or parameter -#}
<i title="Reset to default value ('{{ component.default }}')" class="reset fa fa-fw fa-undo
	{#-
		Don't allow entire blocks to be reset with a single click.
		This could be supported actually, but I'd rather not implement it
		because one misclick could mean a lot of lost parameters and a lot of
		unhappy researchers.
	-#}
{%-
	if component.type == 'block' or (component.type == 'parameter' and component.datatype == 'file')
		or True
-%}
	{#-
		Actually, we can always start with an invisible reset button; We should
		enable it onChange.
	-#}
	{# (force printing of the space to the left of invisible) #} invisible
{%- endif -%}
"></i>{# -#}
<i class="minus fa fa-fw fa-minus
	{#- -#}
	{#-
		On page load we always generate the minimum amount of objects;
		The user shouldn't be able to remove anything they did not add themselves.
	-#}
	{# (force printing of the space to the left of invisible) #} invisible
	{#- -#}
"></i>{# -#}
<i class="plus fa fa-fw fa-plus
	{#- -#}
	{#- But we do need to check whether the user is allowed to add more stuff -#}
	{%- if not component.repeat or component.repeat_min == component.repeat_max -%}
		{# (force printing of the space to the left of invisible) #} invisible
	{%- endif -%}
	{#- -#}
"></i>{# -#}

{% endmacro -%}
{% block content -%}
<section class="content-form">
	<header>
		<h1>HADDOCK Form</h1>
	</header>

	<noscript>
		<div class="warning">
			<p><i class="fa fa-warning"></i>
				JavaScript appears to be disabled in your browser. <br />
				This web application requires JavaScript to enable multiplication of input fields,
				section folding and form level selection, and will not work correctly without it.
				Please enable JavaScript support or use a different browser.
			</p>
		</div>
	</noscript>

	<ul class="levelchooser">
		{% for level in accesslevels %}
		<li class="level-{{ level.name }}
				{%- if level.name == accesslevels[accesslevel_index].name %} selected{% endif %}
				{%- if loop.index0 > user_accesslevel_index %} too-high{% endif %}"
				style="width: {{ 100 / (accesslevels | length) }}%"
				data-name="{{ level.name }}"
				data-index="{{ loop.index0 }}"
			>
			{{ level.label }}
		</li>
		{% endfor -%}
	</ul>

	<div class="levelwarning warning hidden"></div>

	<form id="haddockform" class="nice div60" method="post">
	{% for component in model recursive -%}
		<div class="row
			{%- for level in component.accesslevels -%}
				{# #} level-{{ level }}<commit_msg>Added support for hidden components<commit_after>{% extends "base.html" %}
{% block page_includes -%}
	<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/form.css') }}" />
	<script type="text/javascript" src="{{ url_for('static', filename='js/form.js') }}"></script>
	<script type="text/javascript">
		"use strict";
		var formLevels = [
			{% for level in accesslevels -%}
			'{{ level.name }}',
			{% endfor -%}
		];
		var formLevelIndex = '{{ accesslevel_index }}';
		var formLevel      = formLevels[formLevelIndex];
		var userLevel      = '{{ user_accesslevel_index }}';

		var Config = {
			hideDisabledComponents: true
		};
	</script>
{% endblock -%}
{% macro render_buttonset(component) -%}
{# Renders the reset, add and remove buttons for a block or parameter -#}
<i title="Reset to default value ('{{ component.default }}')" class="reset fa fa-fw fa-undo
	{#-
		Don't allow entire blocks to be reset with a single click.
		This could be supported actually, but I'd rather not implement it
		because one misclick could mean a lot of lost parameters and a lot of
		unhappy researchers.
	-#}
{%-
	if component.type == 'block' or (component.type == 'parameter' and component.datatype == 'file')
		or True
-%}
	{#-
		Actually, we can always start with an invisible reset button; We should
		enable it onChange.
	-#}
	{# (force printing of the space to the left of invisible) #} invisible
{%- endif -%}
"></i>{# -#}
<i class="minus fa fa-fw fa-minus
	{#- -#}
	{#-
		On page load we always generate the minimum amount of objects;
		The user shouldn't be able to remove anything they did not add themselves.
	-#}
	{# (force printing of the space to the left of invisible) #} invisible
	{#- -#}
"></i>{# -#}
<i class="plus fa fa-fw fa-plus
	{#- -#}
	{#- But we do need to check whether the user is allowed to add more stuff -#}
	{%- if not component.repeat or component.repeat_min == component.repeat_max -%}
		{# (force printing of the space to the left of invisible) #} invisible
	{%- endif -%}
	{#- -#}
"></i>{# -#}

{% endmacro -%}
{% block content -%}
<section class="content-form">
	<header>
		<h1>HADDOCK Form</h1>
	</header>

	<noscript>
		<div class="warning">
			<p><i class="fa fa-warning"></i>
				JavaScript appears to be disabled in your browser. <br />
				This web application requires JavaScript to enable multiplication of input fields,
				section folding and form level selection, and will not work correctly without it.
				Please enable JavaScript support or use a different browser.
			</p>
		</div>
	</noscript>

	<ul class="levelchooser">
		{% for level in accesslevels %}
		<li class="level-{{ level.name }}
				{%- if level.name == accesslevels[accesslevel_index].name %} selected{% endif %}
				{%- if loop.index0 > user_accesslevel_index %} too-high{% endif %}"
				style="width: {{ 100 / (accesslevels | length) }}%"
				data-name="{{ level.name }}"
				data-index="{{ loop.index0 }}"
			>
			{{ level.label }}
		</li>
		{% endfor -%}
	</ul>

	<div class="levelwarning warning hidden"></div>

	<form id="haddockform" class="nice div60" method="post">
	{% for component in model if not component.hidden recursive -%}
		<div class="row
			{%- for level in component.accesslevels -%}
				{# #} level-{{ level }}
{'fraction_non_alphanumeric': 0.1614246068455134, 'fraction_numerical': 0.0027752081406105457, 'mean_word_length': 3.565095003518649, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '625079', 'n_tokens_mistral': 2324, 'n_tokens_neox': 2065, 'n_words': 683}