1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-04 15:24:23 +01:00
fab-manager/app/frontend/templates/events/_form.html

281 lines
14 KiB
HTML
Raw Normal View History

2015-05-05 03:10:25 +02:00
<div class="row no-gutter">
<div class=" col-sm-12 col-md-12 col-lg-8 nopadding">
2016-03-23 18:39:41 +01:00
<section class="panel panel-default bg-light m-lg">
2015-05-05 03:10:25 +02:00
<div class="panel-body m-r">
2016-03-23 18:39:41 +01:00
<uib-alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</uib-alert>
2015-05-05 03:10:25 +02:00
<input name="_method" type="hidden" ng-value="method">
<div class="form-group" ng-class="{'has-error': eventForm['event[title]'].$dirty && eventForm['event[title]'].$invalid}">
2019-12-17 18:06:56 +01:00
<label for="event_title" class="col-sm-3 control-label">{{ 'app.shared.event.title' | translate }} *</label>
2015-05-05 03:10:25 +02:00
<div class="col-sm-9">
<input ng-model="event.title" type="text" name="event[title]" class="form-control" id="event_title" placeholder="" required>
2019-12-17 18:06:56 +01:00
<span class="help-block" ng-show="eventForm['event[title]'].$dirty && eventForm['event[title]'].$error.required" translate>{{ 'app.shared.event.title_is_required' }}</span>
2015-05-05 03:10:25 +02:00
</div>
</div>
<div class="form-group">
2019-12-17 18:06:56 +01:00
<label for="event_image" class="col-sm-3 control-label" translate>{{ 'app.shared.event.matching_visual' }}</label>
2015-05-05 03:10:25 +02:00
<div class="col-sm-9">
<div class="fileinput" data-provides="fileinput" ng-class="fileinputClass(event.event_image)">
<div class="fileinput-new thumbnail" style="width: 334px; height: 250px;">
2020-09-29 14:27:49 +02:00
<img src="data:image/png;base64," data-src="holder.js/100%x100%/text:&#xf03e;/font:'Font Awesome 5 Free'/icon" bs-holder ng-if="!event.event_image">
2015-05-05 03:10:25 +02:00
</div>
<div class="fileinput-preview fileinput-exists thumbnail" data-trigger="fileinput" style="max-width: 334px;">
<img ng-src="{{ event.event_image }}" alt="" />
</div>
<div>
2019-12-17 18:06:56 +01:00
<span class="btn btn-default btn-file"><span class="fileinput-new">{{ 'app.shared.event.choose_a_picture' | translate }} <i class="fa fa-upload fa-fw"></i></span><span class="fileinput-exists" translate>{{ 'app.shared.buttons.change' }}</span>
<input type="file" name="event[event_image_attributes][attachment]" accept="image/jpeg,image/gif,image/png"></span>
2015-05-05 03:10:25 +02:00
<a class="btn btn-danger fileinput-exists" data-dismiss="fileinput"><i class="fa fa-trash-o"></i></a>
</div>
</div>
</div>
</div>
<div class="form-group" ng-class="{'has-error': eventForm['event[description]'].$dirty && eventForm['event[description]'].$invalid}">
2019-12-17 18:06:56 +01:00
<label for="description" class="col-sm-3 control-label">{{ 'app.shared.event.description' | translate }} *</label>
2015-05-05 03:10:25 +02:00
<div class="col-sm-9">
2016-10-26 16:33:21 +02:00
<input type="hidden"
name="event[description]"
ng-value="event.description" />
<summernote ng-model="event.description"
id="event_description"
placeholder=""
config="summernoteOpts"
name="event[description]"
required>
</summernote>
2019-12-17 18:06:56 +01:00
<span class="help-block" ng-show="eventForm['event[description]'].$dirty && eventForm['event[description]'].$error.required" translate>{{ 'app.shared.event.description_is_required' }}</span>
2015-05-05 03:10:25 +02:00
</div>
</div>
<div class="form-group">
2019-12-17 18:06:56 +01:00
<label class="col-sm-3 control-label" translate>{{ 'app.shared.event.attachments' }}</label>
2015-05-05 03:10:25 +02:00
<div class="col-sm-9">
<div ng-repeat="file in event.event_files_attributes" ng-show="!file._destroy">
<input type="hidden" name="event[event_files_attributes][][id]" ng-value="file.id" />
<input type="hidden" name="event[event_files_attributes][][_destroy]" ng-value="file._destroy" />
<div class="fileinput input-group" data-provides="fileinput" ng-class="fileinputClass(file.attachment)">
<div class="form-control" data-trigger="fileinput">
<i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename">{{file.attachment}}</span>
</div>
2019-12-17 18:06:56 +01:00
<span class="input-group-addon btn btn-default btn-file"><span class="fileinput-new" translate>{{ 'app.shared.buttons.browse' }}</span>
<span class="fileinput-exists" translate>{{ 'app.shared.buttons.change' }}</span><input type="file" name="event[event_files_attributes][][attachment]" accept="application/pdf"></span>
2015-05-05 03:10:25 +02:00
<a class="input-group-addon btn btn-danger fileinput-exists" data-dismiss="fileinput" ng-click="deleteFile(file)"><i class="fa fa-trash-o"></i></a>
</div>
</div>
2019-12-17 18:06:56 +01:00
<a class="btn btn-default" ng-click="addFile()" role="button">{{ 'app.shared.event.add_a_new_file' | translate }} <i class="fa fa-file-o fa-fw"></i></a>
2015-05-05 03:10:25 +02:00
</div>
</div>
</div> <!-- ./panel-body -->
2020-01-27 18:21:46 +01:00
<input ng-model="editMode" type="hidden" name="edit_mode">
2015-05-05 03:10:25 +02:00
<div class="panel-footer no-padder">
2019-04-18 11:35:09 +02:00
<input type="submit"
2020-01-27 18:21:46 +01:00
ng-value="submitName"
class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c"
ng-disabled="eventForm.$invalid || event.category_id === null"
ng-click="editRecurrent($event)"/>
2015-05-05 03:10:25 +02:00
</div>
</section>
</div>
<div class="col-sm-12 col-md-12 col-lg-4">
<div class="widget panel b-a m m-t-lg">
<div class="panel-heading b-b small">
2019-12-17 18:06:56 +01:00
<h3 translate>{{ 'app.shared.event.event_type' }} *</h3>
2015-05-05 03:10:25 +02:00
</div>
<div class="widget-content no-bg wrapper">
<ui-select ng-model="event.category_id" name="event[category_id][]">
2016-03-23 18:39:41 +01:00
<ui-select-match>
<span ng-bind="$select.selected.name"></span>
<input type="hidden" name="event[category_id]" value="{{$select.selected.id}}" />
2016-03-23 18:39:41 +01:00
</ui-select-match>
<ui-select-choices repeat="c.id as c in (categories | filter: $select.search)">
<span ng-bind-html="c.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
2015-05-05 03:10:25 +02:00
</div>
</div>
<event-themes event="event" on-change="handleEventChange"></event-themes>
<input type="hidden" name="event[event_theme_ids][]" ng-repeat="id in event_themes" value="{{id}}" />
2021-05-12 15:05:16 +02:00
<input type="hidden" name="event[event_theme_ids][]" value="" ng-if="event_themes.length === 0" />
2016-06-29 17:05:42 +02:00
<div class="widget panel b-a m m-t-lg" ng-show="ageRanges.length > 0">
2016-06-29 17:05:42 +02:00
<div class="panel-heading b-b small">
2019-12-17 18:06:56 +01:00
<h3 translate>{{ 'app.shared.event.age_range' }}</h3>
2016-06-29 17:05:42 +02:00
</div>
<div class="widget-content no-bg wrapper">
<ui-select ng-model="event.age_range_id" name="event[age_range_id][]">
<ui-select-match>
<span ng-bind="$select.selected.name"></span>
<input type="hidden" name="event[age_range_id]" value="{{$select.selected.id}}" />
</ui-select-match>
<ui-select-choices repeat="a.id as a in (ageRanges | filter: $select.search)">
<span ng-bind-html="a.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
</div>
</div>
2015-05-05 03:10:25 +02:00
<div class="widget panel b-a m m-t-lg">
<div class="panel-heading b-b small">
2019-12-17 18:06:56 +01:00
<h3 translate>{{ 'app.shared.event.dates_and_opening_hours' }}</h3>
2015-05-05 03:10:25 +02:00
</div>
<div class="widget-content no-bg wrapper">
<div class="m-b">
2019-12-17 18:06:56 +01:00
<label class="v-bottom" translate>{{ 'app.shared.event.all_day' }}</label>
2015-05-05 03:10:25 +02:00
<div class="inline v-top">
<label class="checkbox-inline">
2019-12-17 18:06:56 +01:00
<input type="radio" name="event[all_day]" ng-model="event.all_day" value="true" required/> {{ 'app.shared.buttons.yes' | translate }}
2015-05-05 03:10:25 +02:00
</label>
<label class="checkbox-inline">
2019-12-17 18:06:56 +01:00
<input type="radio" name="event[all_day]" ng-model="event.all_day" value="false"/> {{ 'app.shared.buttons.no' | translate }}
2015-05-05 03:10:25 +02:00
</label>
</div>
</div>
<input type="hidden" name="event[availability_id]" ng-value="event.availability_id" ng-if="event.availability_id">
<div class="m-b">
2019-12-17 18:06:56 +01:00
<label translate>{{ 'app.shared.event.start_date' }}</label>
2015-05-05 03:10:25 +02:00
<div class="input-group">
<input type="hidden" name="event[start_date]" ng-value="event.start_date">
<input type="text"
class="form-control"
ng-model="event.start_date"
2016-03-23 18:39:41 +01:00
uib-datepicker-popup="{{datePicker.format}}"
2015-05-05 03:10:25 +02:00
datepicker-options="datePicker.options"
is-open="datePicker.startOpened"
ng-click="toggleStartDatePicker($event)"
required/>
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="toggleStartDatePicker($event)"><i class="fa fa-calendar"></i></button>
</span>
</div>
</div>
<div class="m-b">
2019-12-17 18:06:56 +01:00
<label translate>{{ 'app.shared.event.end_date' }}</label>
2015-05-05 03:10:25 +02:00
<div class="input-group">
<input type="hidden" name="event[end_date]" ng-value="event.end_date">
<input type="text"
class="form-control"
ng-model="event.end_date"
2016-03-23 18:39:41 +01:00
uib-datepicker-popup="{{datePicker.format}}"
2015-05-05 03:10:25 +02:00
datepicker-options="datePicker.options"
is-open="datePicker.endOpened"
ng-click="toggleEndDatePicker($event)"
required/>
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="toggleEndDatePicker($event)"><i class="fa fa-calendar"></i></button>
</span>
</div>
</div>
<div class="m-b row" ng-if="event.all_day =='false'">
<div class="col-xs-6">
2019-12-17 18:06:56 +01:00
<label translate>{{ 'app.shared.event.start_time' }}</label>
2015-05-05 03:10:25 +02:00
<div>
<input type="hidden" name="event[start_time]" ng-value="event.start_time">
<uib-timepicker ng-model="event.start_time" mousewheel="false" hour-step="1" minute-step="1" show-meridian="ismeridian"></uib-timepicker>
2015-05-05 03:10:25 +02:00
</div>
</div>
<div class="col-xs-6">
2019-12-17 18:06:56 +01:00
<label translate>{{ 'app.shared.event.end_time' }}</label>
2015-05-05 03:10:25 +02:00
<div>
<input type="hidden" name="event[end_time]" ng-value="event.end_time">
<uib-timepicker ng-model="event.end_time" mousewheel="false" hour-step="1" minute-step="1" show-meridian="ismeridian"></uib-timepicker>
2015-05-05 03:10:25 +02:00
</div>
</div>
</div>
<div ng-if="method == 'post'" class="m-b">
2019-12-17 18:06:56 +01:00
<label translate>{{ 'app.shared.event.recurrence' }}</label>
2015-05-05 03:10:25 +02:00
<select ng-model="event.recurrence" class="form-control" name="event[recurrence]">
<option value="{{t.value}}" ng-repeat="t in recurrenceTypes">{{t.label}}</option>
</select>
<div ng-if="event.recurrence != 'none'">
2019-12-17 18:06:56 +01:00
{{ 'app.shared.event._and_ends_on' | translate }}
2015-05-05 03:10:25 +02:00
<div class="input-group">
<input type="hidden" name="event[recurrence_end_at]" ng-value="event.recurrence_end_at">
2016-03-23 18:39:41 +01:00
<input type="text"
class="form-control"
uib-datepicker-popup="{{datePicker.format}}"
datepicker-options="datePicker.options"
ng-model="event.recurrence_end_at"
is-open="datePicker.recurrenceEndOpened"
ng-required="true"/>
2015-05-05 03:10:25 +02:00
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="toggleRecurrenceEnd($event)"><i class="fa fa-calendar"></i></button>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="widget panel b-a m m-t-lg">
<div class="panel-heading b-b small">
2019-12-17 18:06:56 +01:00
<h3 translate>{{ 'app.shared.event.prices_and_availabilities' }}</h3>
2015-05-05 03:10:25 +02:00
</div>
<div class="widget-content no-bg wrapper">
<div class="form-group">
2019-12-17 18:06:56 +01:00
<label for="event_amount" class="col-sm-5 control-label" translate>{{ 'app.shared.event.standard_rate' }}</label>
<div class="col-sm-6 p-h-0">
2015-05-05 03:10:25 +02:00
<div class="input-group">
<input ng-model="event.amount" type="number" name="event[amount]" class="form-control" id="event_amount" required>
2016-03-23 18:39:41 +01:00
<div class="input-group-addon">{{currencySymbol}}</div>
2015-05-05 03:10:25 +02:00
</div>
2019-12-17 18:06:56 +01:00
<span class="help-block" translate>{{ 'app.shared.event.0_equal_free' }}</span>
2015-05-05 03:10:25 +02:00
</div>
</div>
<div class="form-group" ng-repeat="price in event.prices" ng-show="!price._destroy">
<div class="col-sm-5">
2016-08-25 14:13:30 +02:00
<input type="hidden" name="event[event_price_categories_attributes][][id]" ng-value="price.id">
<select class="form-control"
ng-model="price.category"
name="event[event_price_categories_attributes][][price_category_id]"
ng-options="cat as cat.name for cat in priceCategories track by cat.id">
</select>
</div>
<div class="col-sm-6 p-h-0">
2015-05-05 03:10:25 +02:00
<div class="input-group">
<input ng-model="price.amount"
type="number"
name="event[event_price_categories_attributes][][amount]"
class="form-control">
2016-03-23 18:39:41 +01:00
<div class="input-group-addon">{{currencySymbol}}</div>
2015-05-05 03:10:25 +02:00
</div>
</div>
<div class="col-sm-1">
<input type="hidden" name="event[event_price_categories_attributes][][_destroy]" ng-value="price._destroy">
<a class="btn p-h-0" ng-click="removePrice(price, $event)" href="#"><i class="fa fa-times text-danger"></i></a>
</div>
2015-05-05 03:10:25 +02:00
</div>
<div class="link-icon m-b" ng-hide="event.prices.length == priceCategories.length">
<div class="col-sm-offset-5">
<i class="fa fa-plus"></i> <span ng-click="addPrice()" translate>{{ 'app.shared.event.add_price' }}</span>
</div>
</div>
2015-05-05 03:10:25 +02:00
<div class="form-group">
2019-12-17 18:06:56 +01:00
<label for="event_nb_total_places" class="col-sm-5 control-label" translate>{{ 'app.shared.event.tickets_available' }}</label>
<div class="col-sm-6 p-h-0">
2015-05-05 03:10:25 +02:00
<div class="input-group">
<input ng-model="event.nb_total_places" type="number" name="event[nb_total_places]" class="form-control" id="event_nb_total_places">
<div class="input-group-addon"><i class="fa fa-ticket"></i> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>