1{extends 'layout_view.tpl'}
2{block name="title"}
3	{title}{$title|escape}{/title}
4{/block}
5{block name="content"}
6	<form role="form" id="confirm-action" method="post" action="{service controller=managestream action=record}">
7		<div class="form-group row clearfix">
8			<label for="event" class="col-form-label col-md-3">
9				{tr}Event{/tr}
10			</label>
11			<div class="col-md-9">
12				<select name="event" class="form-control">
13					{foreach from=$eventTypes item=eventName}
14						<option value="{$eventName|escape}"{if $rule.eventType eq $eventName} selected{/if}>
15							{$eventName|escape}
16						</option>
17					{/foreach}
18				</select>
19			</div>
20		</div>
21		{if $prefs.activity_notifications eq 'y'}
22			<div class="form-group row clearfix">
23				<div class="offset-md-3 col-md-9">
24					<div class="form-check">
25						<label for="notification_checkbox">
26							<input id="notification_checkbox" name="is_notification" type="checkbox"> {tr}Allow Notifications{/tr}
27						</label>
28					</div>
29				</div>
30			</div>
31			<div class="priority-div hidden clearfix">
32				<div class="form-group row offset-md-4 col-md-8">
33					<label for="priorityinput" class="col-form-label">{tr}Priority{/tr}</label>
34					<select id="priorityinput" name="priority" class="form-control">
35						<option value="low">Low</option>
36						<option value="high">High</option>
37						<option value="critical">Critical</option>
38					</select>
39				</div>
40				<div class="form-group row offset-md-4 col-md-8">
41					<label for="userInput" class="col-form-label">{tr}Recipient{/tr}</label>
42					<input id="userInput" name="user" class="form-control" value="user">
43				</div>
44			</div>
45		{/if}
46		<div class="form-group row clearfix">
47			<label for="notes" class="col-form-label col-md-3">
48				{tr}Description{/tr}
49			</label>
50			<div class="col-md-9">
51				<textarea name="notes" class="form-control">{$rule.notes|escape}</textarea>
52			</div>
53		</div>
54		<div class="form-group row clearfix">
55			<label for="rule" class="col-form-label col-md-3">
56				{tr}Rule{/tr}
57			</label>
58			<div class="col-md-9">
59				<textarea name="rule" class="form-control" rows="3" readonly>{$rule.rule|escape}</textarea>
60			</div>
61		</div>
62		<div class="submit">
63			{ticket mode='confirm'}
64			<input type="hidden" name="ruleId" value="{$rule.ruleId|escape}"/>
65			<input type="submit" class="btn btn-primary" value="{tr}Save{/tr}"/>
66		</div>
67	</form>
68	{jq}
69		$("#notification_checkbox").change(function(){
70		if (this.checked){
71		$(".priority-div").removeClass("hidden");
72		}else{
73		$(".priority-div").addClass("hidden");
74		}
75		});
76	{/jq}
77{/block}
78