-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from zettajs/multiple-inputs
Multiple inputs
- Loading branch information
Showing
22 changed files
with
801 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="pure-u-1-6 pure-u-md-1-12"></div> | ||
<h2 class="name pure-u-5-6 pure-u-md-11-12">Muted<span>:group</span></h2> | ||
<section class="devices pure-u-1"> | ||
<div ng-class="{ open: !!characteristic.muteOpen, closed: !characteristic.muteOpen }" class="device row action pure-g animate-size closed" ng-repeat="characteristic in muted"> | ||
<div class="switches pure-u-1-6 pure-u-md-1-12"> | ||
<b class="mute"ng-click="unmute(characteristic)">eye</b> <b class="pin" ng-click="pin(characteristic)">pushpin</b> | ||
</div> | ||
<div class="name pure-u-5-6 pure-u-md-1-4"> | ||
<a class="server-name" ng-click="loadServer(characteristic.device.server)">{{ characteristic.device.server.name }} > </a> | ||
<br/> | ||
<a ng-click="resolve(characteristic.device.href)" class="device-name"> | ||
{{ characteristic.device.properties.name || characteristic.device.properties.type }}</a> | ||
<span class="stream-name"> {{ characteristic.name }}</span> | ||
</div> | ||
<div class="vis pure-u-5-6 pure-u-md-5-12"> | ||
- | ||
</div> | ||
<div class="value before-md pure-u-md-1-4"> -</div> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,97 @@ | ||
<div class="action-content" ng-if="action.renderOptionsAsButtons"> | ||
<div class="vis pure-u-1 pure-u-md-5-8"></div> | ||
<div class="value pure-u-1 pure-u-md-1-4"> | ||
<form ng-repeat="val in action.radioField.value" class="pure-form overview-action-form"> | ||
|
||
<!-- Handle single button --> | ||
<div ng-if="action.renderOptionsAsButton"> | ||
|
||
<form class="pure-form action-content"> | ||
<div class="name pure-u-1-2 pure-u-md-1-4"> | ||
# {{ action.name }} | ||
</div> | ||
|
||
<div class="vis pure-u-1 pure-u-md-5-12" ng-repeat="field in action.inputFields" ng-if="field.type!='hidden'"> | ||
|
||
<!-- Handle dropdowns --> | ||
<select ng-if="field.type=='radio'" ng-options="option.value as (option.text || option.value) for option in field.options"> | ||
<option value="">-- choose {{field.name}} --</option> | ||
</select> | ||
|
||
<!-- Handle range --> | ||
<div ng-if="field.type=='range'"> | ||
{{ field.min }} | ||
<input ng-model="field.value" id="{{ action.name + field.name }}" min="{{ field.min }}" max="{{ field.max }}" step="{{ field.step }}" type="{{ field.type }}" name="{{ field.name }}" value="{{ field.value }}" /> | ||
{{ field.max }} | ||
<input ng-model="field.value" type="number" min="{{ field.min }}" max="{{ field.max }}" step="{{ field.step }}" value="{{ field.value }}" placeholder="{{ field.value }}" /> | ||
</div> | ||
|
||
<!-- Handle other input types --> | ||
<input ng-if="field.type!='range'&&field.type!='radio'" class="pure-u-1" id="{{ action.name + field.name }}" placeholder="{{ field.name }}" ng-type="{{ field.type }}" name="{{ field.name }}" value="{{ field.value }}" /> | ||
</div> | ||
<div class="vis before-md pure-u-1 pure-u-md-5-12" ng-if="action.inputFields.length<2"></div> | ||
<div class="value pure-u-1-2 pure-u-md-1-3" ng-if="action.inputFields.length<2"> | ||
<button class="pure-button {{ action.name + '-button' }}" ng-disabled="!action.available" ng-click="execute()">{{ action.name }}</button> | ||
</div> | ||
<div class="value pure-u-1 pure-u-md-1-3" ng-if="action.inputFields.length>=2"> | ||
<button class="pure-button {{ action.name + '-button' }}" ng-disabled="!action.available" ng-click="execute()">{{ action.name }}</button> | ||
</div> | ||
</form> | ||
</div> | ||
<!-- Handle double radio inputs as two buttons --> | ||
<div ng-if="action.renderOptionsAsRadioButtons"> | ||
<div class="name pure-u-1-2 pure-u-md-1-4"> | ||
# {{ action.name }} | ||
</div> | ||
|
||
<div class="vis before-md pure-u-1 pure-u-md-5-12"></div> | ||
<div class="value pure-u-1-2 pure-u-md-1-3"> | ||
<form ng-repeat="val in action.radioField.value" class="pure-form"> | ||
<button class="pure-button {{ action.name + '-button' }}" ng-click="val.execute()">{{ val.title || val.value}}</button> | ||
</form> | ||
</div> | ||
|
||
</div> | ||
|
||
<form class="pure-form action-content" ng-if="!action.renderOptionsAsButtons"> | ||
<div class="vis pure-u-1 pure-u-md-5-8"> | ||
<div class="fields"> | ||
<input ng-repeat="field in action.fields" placeholder="{{ field.name }}" step="{{field.step}}" min="{{field.min}}" max="{{field.max}}" type="{{ field.type }}" class="pure-u-1" name="{{ field.name }}" value="{{ field.value }}" | ||
id="{{ action.name + field.name }}" ng-model="field.value"/> | ||
|
||
<!-- Handle multiple inputs --> | ||
<div ng-if="action.renderOptionsAsMultipleInputs"> | ||
<form class="pure-form action-content"> | ||
|
||
<div class="name pure-u-1-4"> | ||
# {{ action.name }} | ||
</div> | ||
</div> | ||
<div class="value pure-u-1 pure-u-md-1-4" ng-if="!action.renderOptionsAsButtons"> | ||
<button class="pure-button {{ action.name + '-button' }}" ng-disabled="!action.available" ng-click="execute()">{{ action.name }}</button> | ||
</div> | ||
</form> | ||
<div class="vis before-md pure-u-1 pure-u-md-5-12"></div> | ||
<div class="value before-md pure-u-1 pure-u-md-1-3"> | ||
<button class="pure-button {{ action.name + '-button' }}" ng-disabled="!action.available" ng-click="execute()">{{ action.name }}</button> | ||
</div> | ||
|
||
|
||
|
||
<div ng-repeat="field in action.inputFields"> | ||
<div class="name pure-u-1-4"> | ||
<label ng-if="!field.isHidden" for="{{field.name}}">{{field.name}}</label> | ||
</div> | ||
|
||
<div class="vis pure-u-1 pure-u-md-5-12"> | ||
<div class="fields" ng-switch="field.type"> | ||
|
||
<!-- Handle dropdowns --> | ||
<select ng-switch-when="radio" ng-model="field.value" ng-options="option.value as (option.text || option.value) for option in field.options"> | ||
<option value="">-- choose {{field.name}} --</option> | ||
</select> | ||
|
||
<!-- Handle range --> | ||
<div ng-switch-when="range"> | ||
{{ field.min }} | ||
<input ng-model="field.value" id="{{ action.name + field.name }}" min="{{ field.min }}" max="{{ field.max }}" step="{{ field.step }}" type="{{ field.type }}" name="{{ field.name }}" value="{{ field.value }}" /> | ||
{{ field.max }} | ||
<input ng-model="field.value" type="number" min="{{ field.min }}" max="{{ field.max }}" step="{{ field.step }}" value="{{ field.value }}" placeholder="{{ field.value }}" /> | ||
</div> | ||
|
||
<!-- Handle other input types --> | ||
<input ng-switch-default ng-model="field.value" class="pure-u-1" id="{{ action.name + field.name }}" placeholder="{{ field.name }}" type="{{ field.type }}" name="{{ field.name }}" value="{{ field.value }}" /> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
<div class="value hide-md pure-u-1 pure-u-md-1-3"> | ||
<button class="pure-button {{ action.name + '-button' }}" ng-disabled="!action.available" ng-click="execute()">{{ action.name }}</button> | ||
</div> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.