<!-- header start -->
<include file="Public/Header" />
<!-- header end -->

<!-- right content start  -->
<div class="content-right">
	<div class="content">
        <!-- form start -->
        <form class="am-form form-validation view-save" action="{{:U('Admin/Power/RoleSave')}}" method="POST" request-type="ajax-url" request-value="{{:U('Admin/Power/Role')}}">
        	<legend>
				<span class="fs-16">
					<if condition="empty($data['id'])">
						{{:L('role_add_name')}}
					<else />
						{{:L('role_edit_name')}}
					</if>
				</span>
				<a href="{{:U('Admin/Power/Role')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
			</legend>
        	<div class="am-form-group">
				<label>{{:L('role_view_role_text')}}</label>
				<input type="text" placeholder="{{:L('role_view_role_text')}}" name="name" minlength="2" maxlength="16" data-validation-message="{{:L('role_name_format')}}" class="am-radius" <present name="data"> value="{{$data.name}}"</present> required />
			</div>
			<include file="Lib/Enable" />
			<div class="am-form-group">
				<label>{{:L('power_view_have_title')}}</label>
				<ul class="tree-list p-0">
					<foreach name="power" item="v">
						<li <if condition="$v['is_show'] eq 0">class="bk-cr-ffd"</if>>
							<if condition="!empty($v['item'])">
								<i class="am-icon-minus-square c-p m-r-5"></i>
								<label class="c-p">
							<else />
								<label class="c-p m-l-20">
							</if>
								<input type="checkbox" name="power_id" value="{{$v.id}}" class="node-choice" <if condition="$v['is_power'] eq 'ok'">checked</if> />
								<span>{{$v.name}}</span>
							</label>
						</li>
						<if condition="!empty($v['item'])">
							<ul class="list-find p-0 m-t-5">
								<foreach name="v.item" item="vs">
									<li <if condition="$vs['is_show'] eq 0">class="bk-cr-ffd"</if>>
										<label class="c-p">
											<input type="checkbox" name="power_id" value="{{$vs.id}}" <if condition="$vs['is_power'] eq 'ok'">checked</if> />
											<span>{{$vs.name}}</span>
										</label>
									</li>
								</foreach>
							</ul>
						</if>
					</foreach>
				</ul>
			</div>
			<div class="am-form-group">
				<input type="hidden" name="id" <present name="data"> value="{{$data.id}}"</present>" />
				<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_save')}}</button>
			</div>
		</form>
		<!-- right form end  -->
	</div>
</div>
<!-- right content end  -->
		
<!-- footer start -->
<include file="Public/Footer" />
<!-- footer end -->