<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/bootstrap-switch/css/bootstrap-switch.min.css') }}">
<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/validationengine/css/validationEngine.jquery.css') }}">
<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/summernote/css/summernote.css') }}">
<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/multi-select/css/multi-select.css') }}">
<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/tagsinput/css/jquery.tagsinput.css') }}">

<!--BEGIN INPUT TEXT FIELDS-->
<div class="row">
	<div class="col-lg-12">
		<form class="form-horizontal" id="group-edit" enctype="multipart/form-data" method="post">
			<div class="box dark">
				<header>
					<div class="icons">
						<i class="fa fa-edit"></i>
					</div>
					<h5>
						<check if="{{ @res_group->title==''}}">
							<true>
								{{ @lang_create_a_new_ad_group }}
							</true>
							<false>
								{{ @lang_edit }} - {{ @res_group->title }} <small>| {{ @lang_last_updated }} {{ @time_last_updated }} {{ @lang_by }} {{ @res_group->user_id->username }}</small>
							</false>
						</check>

					</h5>
				</header>

				<!-- form section -->
				<div class="row">
					<div class="col-lg-1">
						&nbsp;
					</div>
					<div class="col-lg-10">

						<div class="box dark">
							<header>
								<h5>
									{{ @lang_about_the_ad_group }} <small>| {{ @lang_group_settings_and_description }}</small>
								</h5>
								<!-- .toolbar -->
								<div class="toolbar">
									<ul class="nav">
										<li>
											<a class="minimize-box" data-toggle="collapse" href="#div-1">
												<i class="fa fa-chevron-up"></i>
											</a>
										</li>
									</ul>
								</div><!-- /.toolbar -->
							</header>

							<div id="div-1" class="accordion-body collapse in body">
								<div class="form-group">
									<label for="title" class="tips control-label col-lg-3" title="{{ @lang_enter_in_a_title_for_the_group }}.">* {{ @lang_group_title }}</label>
									<div class="col-lg-8">
										<input class="form-control" type="text" id="title" name="title" value="{{ @res_group->title }}" maxlength="256" />
									</div>
								</div><!-- /.form-group -->
								<div class="form-group">
									<label for="notes" class="tips control-label col-lg-3" title="{{ @lang_enter_in_any_notes_for_the_group }}.">{{ @lang_group_notes }}</label>
									<div class="col-lg-8">
										<textarea id="notes" name="notes" class="form-control">{{ @res_group->notes }}</textarea>
									</div>
								</div><!-- /.form-group -->
							</div>
						</div>
					</div>
				</div>
				<!-- /form section -->

				<!-- form section -->
				<div class="row">
					<div class="col-lg-1">
						&nbsp;
					</div>
					<div class="col-lg-10">
						<div class="box dark">
							<header>
								<h5>
									{{ @lang_ad_group_members }} <small>| {{ @lang_ads_and_keywords_assigned_to_the_group }}</small>
								</h5>
								<!-- .toolbar -->
								<div class="toolbar">
									<ul class="nav">
										<li>
											<a class="minimize-box" data-toggle="collapse" href="#div-2">
												<i class="fa fa-chevron-up"></i>
											</a>
										</li>
									</ul>
								</div><!-- /.toolbar -->
							</header>

							<div id="div-2" class="accordion-body collapse in body">

								<div class="form-group">
									<label for="ad_break_horizontally" class="tips control-label col-lg-3" title="{{ @lang_select_weighted_random__to_randomly_sort_the_ads_for_display__select_as_ordered_to_display_in_the_order_you_set_in_the_ads_assigned_box_ }}">{{ @lang_ordering }}</label>
									<div class="col-lg-3">
										<input class="uniform" type="radio" id="ad_ordering_random" name="ad_order_type" value="1" <check if="{{ empty(@res_group->ad_order) }}">checked</check>/> {{ @lang_weighted_random }}<br/>

										<input class="uniform" type="radio" id="ad_ordering_ordered" name="ad_order_type" value="2" <check if="{{ !empty(@res_group->ad_order) }}">checked</check>/> {{ @lang_as_ordered }}<br/>

										<input class="uniform" type="radio" id="ad_ordering_performance" name="ad_order_type" value="3" <check if="{{ (@res_group->ad_order_type == 3) }}">checked</check>/> {{ @lang_by_clicks }}

									</div>
								</div><!-- /.form-group -->

								<div class="form-group">
									<label for="ads" class="tips control-label col-lg-3"
									       title="{{@lang_select_any_ads}}. {{ @lang_all_ads_in_the_same_group_will_be_cycled_together }}. {{ @lang_click_on_ads_from_available_ads_to_assign_ads__click_on_selected_ads_to_remove_ads_ }}">{{ @lang_ads_assigned }}</label>
									<div class="col-lg-8">
										<select id="ads" name="ads[]" data-placeholder="{{ @lang_select_any_ads }}" class="form-control" multiple>
											<repeat group="{{ @unselected_ads }}" value="{{ @unselected_ad }}">
												<option value="{{ @unselected_ad._id }}">{{ @unselected_ad.title }}</option>
											</repeat>
											<repeat group="{{ @selected_ads }}" value="{{ @selected_ad }}">
												<option value="{{ @selected_ad._id }}" selected>{{ @selected_ad.title }}</option>
											</repeat>
										</select>
									</div>
								</div><!-- /.form-group -->
								<div class="form-group">
									<label for="keywords" class="tips control-label col-lg-3" title="{{ @lang_comma_separated_list_of_keywords_to_target_this_group }}.">{{ @lang_group_keywords }}</label>
									<div class="col-lg-8">
										<input class="form-control" type="text" id="keywords" name="keywords" data-placement="top" value="{{ @res_group->keywords }}" maxlength="256" />
									</div>
								</div><!-- /.form-group -->

							</div>
						</div>
					</div>
				</div>
				<!-- /form section -->

				<!-- form section -->
				<div class="row">
					<div class="col-lg-1">
						&nbsp;
					</div>
					<div class="col-lg-10">

						<div class="box dark">
							<header>
								<h5>
									{{ @lang_ad_group_layout }} <small>| {{ @lang_group_layout_settings }}</small>
								</h5>
								<!-- .toolbar -->
								<div class="toolbar">
									<ul class="nav">
										<li>
											<a class="minimize-box" data-toggle="collapse" href="#div-3">
												<i class="fa fa-chevron-up"></i>
											</a>
										</li>
									</ul>
								</div><!-- /.toolbar -->
							</header>

							<div id="div-3" class="accordion-body collapse in body">
								<div class="form-group">
									<label for="num_display" class="tips control-label col-lg-3" title="{{ @lang_the_number_of_ads_to_display_in_a_row }}.">{{ @lang_number_of_ads_to_display }}</label>
									<div class="col-lg-2">
										<input class="form-control" type="text" id="num_display" name="num_display" value="{{ @res_group->num_display }}" />
									</div>
								</div><!-- /.form-group -->
								<div class="form-group">
									<label for="ad_break_horizontally" class="tips control-label col-lg-3" title="{{ @lang_if_displaying_more_than_one_ad__how_do_you_want_them_separated }}.">{{ @lang_ad_layout }} {{@res_group->ad_break}}</label>
									<div class="col-lg-3">
										<input class="uniform" type="radio" id="ad_break_horizontally" name="ad_break" value="&amp;nbsp;" <check if="{{ @res_group->ad_break == '&nbsp;'}}">checked</check>/> {{ @lang_horizontally }}<br/>

										<input class="uniform" type="radio" id="ad_break_vertically" name="ad_break" value="&lt;br /&gt;&amp;nbsp;&lt;br /&gt;" <check if="{{ @res_group->ad_break == '<br />&nbsp;<br />'}}">checked</check>/> {{ @lang_vertically }}
										<br/>

										<input class="uniform" type="radio" id="ad_break_custom" name="ad_break" value="0" <check if="{{ ((@res_group->ad_break != '&nbsp;') && (@res_group->ad_break != '<br />&nbsp;<br />'))}}">checked</check>/> {{ @lang_custom }}<br />
										<input type="text" id="ad_break_custom_text" name="ad_break_custom_text" value="<check if="{{ ((@res_group->ad_break != '&nbsp;') && (@res_group->ad_break != '<br />&nbsp;<br />'))}}">{{ @res_group->ad_break }}</check>" maxlength="256"/>

									</div>
								</div><!-- /.form-group -->
							</div>
						</div>
					</div>
				</div>
				<!-- /form section -->

				<div class="row">
					<div class="col-lg-1">
						&nbsp;
					</div>
					<div class="col-lg-10">
						<br />
						<button type="submit" class="btn btn-success" id="save" name="save">{{ @lang_save }}</button>&nbsp;
						<a href="index.php?groups&list " class="btn btn-sm btn-metis-5">{{ @lang_cancel }}</a>
						<div><br /></div>
					</div>
				</div>

			</div>
		</form>
	</div>
</div>
