summaryrefslogblamecommitdiffstats
path: root/modules-available/locations/templates/location-subnets.html
blob: 897f84b0c3df82ae66348edea90ea5d50f0940b4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                      
                                                             
                                                                                   






                                                                                   
                             
                                                      

                                                                                                           
                                                                                                                                                                                            
                                              
                                      


                                                                                                                      
                                                                                                                                             




                                                                                                                                                                                           

                                      








                                                                    
                                                                                                                                          

                                 
                                                      
                                                             

                                                                                                                                                                                                                                              

                                                                                                           
                                                                                                                                                                     


                                                                                         


                                                        
                                                
                                                                                                                                                                                                                               
                                                                                                              

                                                 

                             










                                                                                                               







                                                                                                                            



                                                          
                                                
                                                                                                                               
                                                                                                                                  


                                                                                                                                     

                                                

                                                         

                                                                                                                                                                                                                                                                      
                              
                      
 
                                                                                                                                          
                                                                                       
                                                           


                                                                         

                                                                                                                                       



                                                                                                                                           














                                                                                                                                                                                                                          


                                              
                      
 
               
     
<div class="slx-well">
	<div class="slx-bold">{{lang_locationSettings}}</div>
	<form id="locationForm{{locationid}}" method="post" action="?do=Locations">
		<input type="hidden" name="token" value="{{token}}">
		<input type="hidden" name="action" value="updatelocation">
		<input type="hidden" name="locationid" value="{{locationid}}">
		<div style="display:none">
			<button type="submit" class="btn btn-primary">Save</button>
		</div>
		<div class="row">
			<div>
				<div class="col-sm-6">
					<div class="input-group">
						<span class="input-group-addon slx-ga">{{lang_name}}</span>
						<input {{perms.location.edit.name.disabled}} class="form-control" type="text" name="locationname" value="{{locationname}}" pattern=".*\S.*">
					</div>
				</div>
				<div class="col-sm-6">
					<div class="input-group">
						<span class="input-group-addon slx-ga2">{{lang_parentLocation}}</span>
						<select class="form-control" name="parentlocationid" {{perms.location.edit.parent.disabled}}>
							{{#parents}}
							<option {{disabled}} value="{{locationid}}" {{#selected}}selected="selected"{{/selected}}>{{locationpad}} {{locationname}}</option>
							{{/parents}}
						</select>
					</div>
				</div>
			</div>
		</div>
		<br>
		<div class="slx-bold">{{lang_assignedSubnets}}</div>
		<div><i>{{lang_assignSubnetExplanation}}</i></div>
		<table class="table table-condensed table-striped">
			<tr>
				<th>#</th>
				<th>{{lang_startAddress}}</th>
				<th>{{lang_endAddress}}</th>
				<th title="{{lang_deleteSubnet}}" class="text-center"><span class="glyphicon glyphicon-trash"></span></th>
			</tr>
			{{#list}}
				<tr class="cidrmagic">
					<td>{{subnetid}}</td>
					<td><input {{perms.location.edit.subnets.disabled}} class="form-control cidrstart" type="text" name="startaddr[{{subnetid}}]" value="{{startaddr}}" pattern="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"></td>
					<td><input {{perms.location.edit.subnets.disabled}} class="form-control cidrend" type="text" name="endaddr[{{subnetid}}]" value="{{endaddr}}" pattern="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"></td>
					<td class="danger">
						<div class="checkbox text-center" style="margin-left: 9px">
							<input {{perms.location.edit.subnets.disabled}} type="checkbox" name="deletesubnet[{{subnetid}}]" value="on">
							<label class="text-left"></label>
						</div>
					</td>
				</tr>
			{{/list}}
			<tr id="loc-sub-{{locationid}}">
				<td colspan="4">
					<button {{perms.location.edit.subnets.disabled}} class="btn btn-success btn-sm pull-right" type="button" onclick="slxAddSubnetRow(this, {{locationid}})" title="{{lang_addNewSubnet}}">
						<span class="glyphicon glyphicon-plus"></span> {{lang_subnet}}
					</button>
				</td>
			</tr>
		</table>
		<div class="slx-bold">{{lang_locationInfo}}</div>

		<div class="row">
			<div class="col-md-4">
				{{#haveDozmod}}
				<div>
					<span class="slx-ga2">{{lang_referencingLectures}}:</span> {{lectures}}
				</div>
				{{/haveDozmod}}
				{{#haveStatistics}}
				<div>
					<span class="slx-ga2">{{lang_matchingMachines}}:</span>
					{{#statsLink}}
					<a href="?do=Statistics&amp;show={{statsLink}}&amp;filters=location={{locationid}}">
					{{/statsLink}}
						{{machines}} / {{machines_online}} / {{machines_used}} ({{used_percent}}%)
					{{#statsLink}}
					</a>
					{{/statsLink}}
				</div>
				{{/haveStatistics}}
			</div>
			<div class="col-md-4 text-center">
				{{#roomplanner}}
				<a class="btn btn-default" href="?do=roomplanner&amp;locationid={{locationid}}" target="_blank"
					onclick="window.open(this.href, '_blank', 'toolbar=0,scrollbars,resizable');return false">
					<span class="glyphicon glyphicon-move"></span>
					{{^perms.roomplanner.edit.disabled}}{{lang_editRoomplan}}{{/perms.roomplanner.edit.disabled}}
					{{#perms.roomplanner.edit.disabled}}{{lang_showRoomplan}}{{/perms.roomplanner.edit.disabled}}
				</a>
				{{/roomplanner}}
			</div>
			<div class="col-md-4 text-right">
				<button {{perms.location.delete.disabled}} type="button" class="btn btn-danger"  data-toggle="modal" data-target="#deleteLocationModal{{locationid}}"><span class="glyphicon glyphicon-trash"></span> {{lang_deleteLocation}}</button>
				<button onclick="deleteSubnetWarning('{{locationid}}')" {{perms.save_button.disabled}} type="button" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button>
			</div>
		</div>

		<div class="modal fade" id="deleteLocationModal{{locationid}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
			<div class="modal-dialog" style="width: 400px" role="document">
				<div class="modal-content">
					<div class="modal-body">
						{{lang_areYouSureNoUndo}}
						<div class="checkbox">
							<input type="checkbox" name="recursive" value="on" id="del-rec-{{locationid}}">
							<label for="del-rec-{{locationid}}">{{lang_deleteChildLocations}}</label>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button>
						<button type="submit" class="btn btn-danger" name="deletelocation" value="{{locationid}}"><span class="glyphicon glyphicon-trash"></span> {{lang_deleteLocation}}</button>
					</div>
				</div>
			</div>
		</div>

		<div class="modal fade" id="saveWarningModal{{locationid}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
			<div class="modal-dialog" style="width: 400px" role="document">
				<div class="modal-content">
					<div class="modal-body">
						{{lang_deleteSubnetWarning}}
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button>
						<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button>
					</div>
				</div>
			</div>
		</div>

	</form>
</div>