<commit_before>{% set user_group = core.getUser().getGroup() %}

{% if show_more %}
	<script>

		$(document).ready(function() { 

			$('#{{ more_data[0]["filter_option"] }}').parent().removeClass("active");
			$('#{{ more_data[0]["filter_option"] }}').addClass("active");

			var del = $('#delete');
			var merge  = $('#merge_thread');

			var deleteActive = typeof del[0] !== typeof undefined && del[0].hasAttribute('class') && del.attr('class').includes('active');
			var deleteMerge  = merge[0].hasAttribute('class')  && merge.attr('class').includes('active');

			if('{{ more_data[0]["filter_option"] }}' === 'tree' && !deleteActive && !deleteMerge) {
				$('#dropdownLabel').removeClass("active");
			} else {
				$('#dropdownLabel').addClass("active");
			}

		 });

	</script>
{% endif %}

<div id="forum_bar">

	<div class="row">

	<div style="padding:0px;" class="col-7">


		{% if thread_exists %}


			<form id="search_block" method="post" action="{{ core.buildUrl({'component':'forum', 'page':'search_threads'}) }}">
			<div class="row" style="position:relative; top:3px;">
				<div style="padding:0px; margin-right:5px;" class="col-7">
					<input style="width:100%; height:34px; " type="text" placeholder="Search here..." name="search_content" id="search_content"/>
				</div>
				<div style="padding:0px;" class="col-4">
					<button type="submit" name="search" title="Submit search" class="btn btn-primary">
		  				Search
					</button>
					{% for button in forum_bar_buttons_left %}
						{% if user_group <= button.required_rank %}
							{% set link = (button.link[0]) ? 'href=' ~ button.link[1] %}
							{% set onclick = (button.onclick[0]) ? 'onclick=' ~ button.onclick[1] %}
							<a class="btn btn-primary {{ button.optional_class }}" style="{{ button.style }}" {{ link }} title="{{ button.title }}" {{ onclick }} >
								{{ button.display_text|raw }}
							</a>
						{% endif %}
					{% endfor %}
				</div>
			</form>
			</div>
		{% endif %}
		
		</div>
		
	<div style="padding:0px;" class="col-5">

		{% for button in forum_bar_buttons_right %}
			{% if user_group <= button.required_rank %}
				{% set link = (button.link[0]) ? 'href=' ~ button.link[1] %}
				{% set onclick = (button.onclick[0]) ? 'onclick=' ~ button.onclick[1] %}
				<a class="btn btn-primary {{ button.optional_class }}" style="{{ button.style }}" {{ link }} title="{{ button.title }}" {{ onclick }} >
					{{ button.display_text|raw }}
				</a>
			{% endif %}<commit_msg>[Bugfix] Display error on blank search input (#3578)<commit_after>{% set user_group = core.getUser().getGroup() %}

{% if show_more %}
	<script>

		$(document).ready(function() { 

			$('#{{ more_data[0]["filter_option"] }}').parent().removeClass("active");
			$('#{{ more_data[0]["filter_option"] }}').addClass("active");

			var del = $('#delete');
			var merge  = $('#merge_thread');

			var deleteActive = typeof del[0] !== typeof undefined && del[0].hasAttribute('class') && del.attr('class').includes('active');
			var deleteMerge  = merge[0].hasAttribute('class')  && merge.attr('class').includes('active');

			if('{{ more_data[0]["filter_option"] }}' === 'tree' && !deleteActive && !deleteMerge) {
				$('#dropdownLabel').removeClass("active");
			} else {
				$('#dropdownLabel').addClass("active");
			}

		 });

	</script>
{% endif %}

<div id="forum_bar">

	<div class="row">

	<div style="padding:0px;" class="col-7">


		{% if thread_exists %}


			<form id="search_block" method="post" action="{{ core.buildUrl({'component':'forum', 'page':'search_threads'}) }}">
			<div class="row" style="position:relative; top:3px;">
				<div style="padding:0px; margin-right:5px;" class="col-7">
					<input style="width:100%; height:34px; " type="text" placeholder="Search here..." name="search_content" id="search_content" onchange="$(this).val($(this).val().trim())" required />
				</div>
				<div style="padding:0px;" class="col-4">
					<button type="submit" name="search" title="Submit search" class="btn btn-primary">
		  				Search
					</button>
					{% for button in forum_bar_buttons_left %}
						{% if user_group <= button.required_rank %}
							{% set link = (button.link[0]) ? 'href=' ~ button.link[1] %}
							{% set onclick = (button.onclick[0]) ? 'onclick=' ~ button.onclick[1] %}
							<a class="btn btn-primary {{ button.optional_class }}" style="{{ button.style }}" {{ link }} title="{{ button.title }}" {{ onclick }} >
								{{ button.display_text|raw }}
							</a>
						{% endif %}
					{% endfor %}
				</div>
			</form>
			</div>
		{% endif %}
		
		</div>
		
	<div style="padding:0px;" class="col-5">

		{% for button in forum_bar_buttons_right %}
			{% if user_group <= button.required_rank %}
				{% set link = (button.link[0]) ? 'href=' ~ button.link[1] %}
				{% set onclick = (button.onclick[0]) ? 'onclick=' ~ button.onclick[1] %}
				<a class="btn btn-primary {{ button.optional_class }}" style="{{ button.style }}" {{ link }} title="{{ button.title }}" {{ onclick }} >
					{{ button.display_text|raw }}
				</a>
			{% endif %}
{'fraction_non_alphanumeric': 0.22792079207920793, 'fraction_numerical': 0.012277227722772278, 'mean_word_length': 3.8754826254826256, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 47, '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': '6800530', 'n_tokens_mistral': 2012, 'n_tokens_neox': 1624, 'n_words': 315}