/templates/app_settings.html
https://gitlab.com/lileeyao/airnotifier · HTML · 269 lines · 237 code · 32 blank · 0 comment · 0 complexity · da9a4104883d22fc99a036072912c309 MD5 · raw file
- {% extends "base.html" %}
- {% block navbar %}
- {{ modules.NavBar('applications') }}
- {% end %}
- {% block tabbaritems %}
- {{ modules.TabBar(app, 'settings') }}
- {% end %}
- {% block sidebaritems %}
- {{ modules.AppSideBar(app, 'settings') }}
- {% end %}
- {% block body %}
- {% if 'error' in globals() %}
- <div class="alert">
- <strong>{{ error }}</strong>
- </div>
- {% end %}
- <form class="form-horizontal" id="form-app-settings" method="post">
- <input type="hidden" name="appname" value="{{app['shortname']}}" />
- <fieldset>
- <legend>{{ _('General') }}</legend>
- <div class="control-group">
- <label class="control-label" for="shortname"> {{ _('Short name') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="shortname" readonly="readonly" value="{{app['shortname']}}">
- <p class="help-block">Unique identifier for your app.</p>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="appfullname">{{ _('Full name') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="appfullname" name="appfullname" value="{{ app.get('fullname', '') }}">
- </div>
- </div>
- {% if app['enableapns'] != 1 %}
- <div class="control-group">
- <label class="control-label" for="connections">Connections</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="connections" pattern="[0-9]+" name="connections" value="{{app['connections']}}">
- <p class="help-block ">This will restart APNs</p>
- </div>
- </div>
- {% end %}
- <div class="control-group">
- <label class="control-label" for="keydesc">{{ _('Blocked IP list') }}</label>
- <div class="controls">
- <textarea rows="10" class="input-xlarge" id="ipaddr" name="blockediplist">{{ app.get('blockediplist', '') }}</textarea>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="appdescription">Description</label>
- <div class="controls">
- <textarea class="input-xlarge" id="appdescription" rows="6" name="appdescription">{{app.get('description', '')}}</textarea>
- </div>
- </div>
- <div class="form-actions">
- <button type="submit" class="btn btn-primary">{{ _('Apply') }}</button>
- </div>
- </fieldset>
- </form>
- <form class="form-horizontal" id="form-ios-settings" method="post">
- <fieldset>
- <legend>{{ _('Apple push notification settings') }}</legend>
- <div class="control-group">
- <label class="control-label"> {{ _('APNs service') }}</label>
- <div class="controls">
- <input type="hidden" name="appname" value="{{app['shortname']}}" />
- {% if app.get('enableapns', False) %}
- <input type="hidden" name="stopapns" value="true" />
- <button type="submit" class="btn btn-danger">{{ _('Stop') }}</button>
- {% else %}
- <input type="hidden" name="launchapns" value="true" />
- <button type="submit" class="btn btn-primary">{{ _('Launch') }}</button>
- {% end %}
- <p class="help-block">You have to stop the service to see more options</p>
- </div>
- </div>
- </form>
- {% if app['enableapns'] != 1 %}
- <form class="form-horizontal" method="post">
- <div class="control-group">
- <label class="control-label"> {{ _('Set mode') }}</label>
- <div class="controls">
- <input type="hidden" name="appname" value="{{app['shortname']}}" />
- {% if not app.has_key('environment') or (app.has_key('environment') and app['environment'] == 'sandbox') %}
- <input type="hidden" name="turnonproduction" value="true">
- <button type="submit" class="btn btn-info">{{ _('Enter production mode') }}</button>
- {% else %}
- <input type="hidden" name="turnonsandbox" value="true">
- <button type="submit" class="btn btn-info">{{ _('Enter sandbox mode') }}</button>
- {% end %}
- </div>
- </div>
- </form>
- {% end %}
- <form class="form-horizontal" method="post">
- <input type="hidden" name="appname" value="{{app['shortname']}}" />
- <label class="control-label"> {{ _('Feedback service') }}</label>
- <div class="control-group">
- <div class="controls">
- <input type="hidden" name="performfeedbacktask" value="true" />
- <button type="submit" class="btn btn-primary">{{ _('Clean up') }}</button>
- <p class="help-block">Clean up unused device tokens</p>
- </div>
- </div>
- </form>
- {% if app['enableapns'] != 1 %}
- <form class="form-horizontal" method="post" enctype="multipart/form-data">
- <input type="hidden" name="appname" value="{{app['shortname']}}" />
- <div class="control-group">
- <label class="control-label" for="certfileinput">{{ _('Certification') }}</label>
- <div class="controls">
- {% if app.get('certfile', False) %}
- <div class="alert alert-success">
- {{ _('Already uploaded') }}
- {% else %}
- <div class="alert alert-error">
- {{ _('Certificate not set') }}
- {% end %}
- <input class="input-file" id="certfileinput" type="file" name="appcertfile">
- </div>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="keyfileinput">{{ _('Key') }}</label>
- <div class="controls">
- {% if app.get('keyfile', False) %}
- <div class="alert alert-success">
- {{ _('Already uploaded') }}
- {% else %}
- <div class="alert alert-error">
- {{ _('Key not set') }}
- {% end %}
- <input class="input-file" id="keyfileinput" type="file" name="appkeyfile">
- </div>
- </div>
- </div>
- <div class="form-actions">
- <button type="submit" class="btn btn-primary">{{ _('Upload') }}</button>
- </div>
- {% end %}
- </fieldset>
- </form>
- <form class="form-horizontal" id="form-gcm-settings" method="post">
- <input type="hidden" name="appname" value="{{app['shortname']}}" />
- <fieldset>
- <legend>{{ _('Google cloud messaging settings') }}</legend>
- <div class="control-group">
- <label class="control-label" for="form-element-gcmprojectnumber"> {{ _('Project number') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="form-element-gcmprojectnumber" name="gcmprojectnumber" value="{{app['gcmprojectnumber']}}">
- <p class="help-block">Android app project number</p>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="form-element-gcmapikey">{{ _('API key') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="form-element-gcmapikey" name="gcmapikey" value="{{app.get('gcmapikey', '')}}">
- </div>
- </div>
- <div class="form-actions">
- <button type="submit" class="btn btn-primary">{{ _('Save') }}</button>
- </div>
- </fieldset>
- </form>
- <form class="form-horizontal" id="form-wns-settings" method="post">
- <fieldset>
- <legend>{{ _('WNS settings') }}</legend>
- <div class="control-group">
- <label class="control-label" for="form-element-wnsclientid"> {{ _('Client ID') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="form-element-wnsclientid" name="wnsclientid" value="{{app.get('wnsclientid', '')}}">
- <p class="help-block">Client ID</p>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="form-element-wnsclientsecret">{{ _('Client secret') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="form-element-wnsclientsecret" name="wnsclientsecret" value="{{app.get('wnsclientsecret', '')}}">
- </div>
- </div>
- <div class="form-actions">
- <button type="submit" class="btn btn-primary">{{ _('Save') }}</button>
- </div>
- </fieldset>
- </form>
- <form class="form-horizontal" method="post" enctype="multipart/form-data">
- <fieldset>
- <legend>{{ _('MPNS settings') }}</legend>
- <div class="control-group">
- <label class="control-label" for="id-mpnscertificatefile">{{ _('Certificate (this is optional)') }}</label>
- <div class="controls">
- {% if app.get('mpnscertificatefile', False) %}
- <div class="alert alert-success">
- {{ _('Already uploaded') }}
- {% else %}
- <div class="alert alert-warning">
- {{ _('MPNS certificate not set') }}
- {% end %}
- <input class="input-file" id="id-mpnscertificatefile" type="file" name="mpnscertificatefile">
- </div>
- </div>
- </div>
- <div class="form-actions">
- <button type="submit" class="btn btn-primary">{{ _('Upload') }}</button>
- </div>
- </fieldset>
- </form>
- <form class="form-horizontal" method="post" enctype="multipart/form-data">
- <fieldset>
- <legend>{{ _('Clickatell(SMS) settings') }}</legend>
- <div class="control-group">
- <label class="control-label" for="form-element-clickatellusername"> {{ _('Username') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="form-element-clickatellusername" name="clickatellusername" value="{{app.get('clickatellusername', '')}}">
- <p class="help-block"></p>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="form-element-clickatellpassword"> {{ _('Password') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="form-element-clickatellpassword" name="clickatellpassword" value="{{app.get('clickatellpassword', '')}}">
- <p class="help-block"></p>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="form-element-clickatellappid"> {{ _('App ID') }}</label>
- <div class="controls">
- <input type="text" class="input-xlarge" id="form-element-clickatellappid" name="clickatellappid" value="{{app.get('clickatellappid', '')}}">
- <p class="help-block"></p>
- </div>
- </div>
- <div class="form-actions">
- <button type="submit" class="btn btn-primary">{{ _('Save') }}</button>
- </div>
- </fieldset>
- </form>
- {% end %}