wanglian/workbase-server

View on GitHub
imports/admin/client/settings.html

Summary

Maintainability
Test Coverage
<template name="SettingCompanyModal">
  <div class="modal fade modal-rounded">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>
          <h4 class="modal-title">{{_ 'settings_company'}}</h4>
        </div>
        <div class="modal-body">
          <dl>
            <dt>{{_ "setup_company_name"}}</dt>
            <dd>
              {{#with instance}}
                {{company}}
                <a href="#" id="btn-modify-company">{{_ "app_action_edit"}}</a>
              {{/with}}
            </dd>
          </dl>
          <dl>
            <dt>{{_ "setup_domain"}}</dt>
            <dd>
              {{#with instance}}
                {{domain}}
                <a href="#" id="btn-modify-domain">{{_ "app_action_edit"}}</a>
              {{/with}}
            </dd>
          </dl>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">{{_ "app_action_close"}}</button>
        </div>
      </div>
    </div>
  </div>
</template>

<template name="SettingEmailModal">
  <div class="modal fade modal-rounded">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>
          <h4 class="modal-title">{{_ 'settings_email'}}</h4>
        </div>
        <div class="modal-body">
          <dl>
            <dt>{{_ "settings_email_send"}}</dt>
            <dd>
              {{#with instance.modules.email}}
                Mailgun: {{mailgun.key}}
                <a href="#" id="btn-setup-mailgun">{{_ "app_action_edit"}}</a>
                {{#if mailgun.key_valid}}
                  <span class="pull-right"><i class="fa fa-check text-green"></i></span>
                {{else}}
                  <span class="pull-right"><i class="fa fa-close text-red"></i></span>
                {{/if}}
              {{else}}
                {{_ "setup_email_disabled"}}
                <a href="#" id="btn-setup-mailgun">{{_ "settings_setup_mailgun"}}</a>
              {{/with}}
            </dd>
          </dl>
          <dl>
            <dt>{{_ "settings_email_receive"}}</dt>
            <dd>
              {{mailgunEndpoint}}
              {{#if instance.modules.email.mailgun.domain_valid}}
                <span class="pull-right"><i class="fa fa-check text-green"></i></span>
              {{else}}
                <span class="pull-right"><i class="fa fa-close text-red"></i></span>
              {{/if}}
            </dd>
          </dl>
        </div>
        <div class="modal-footer">
          <!-- {{#with instance.modules.email}}
            {{#unless compare mailgun.key_valid '&&' mailgun.domain_valid}}
              <button type="button" class="btn btn-success pull-left" id="btn-validate">{{_ "Validate"}}</button>
            {{/unless}}
          {{/with}} -->
          <button type="button" class="btn btn-default" data-dismiss="modal">{{_ "app_action_close"}}</button>
        </div>
      </div>
    </div>
  </div>
</template>

<template name="SettingStorageModal">
  <div class="modal fade modal-rounded">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>
          <h4 class="modal-title">{{_ 'settings_storage'}}</h4>
        </div>
        <div class="modal-body">
          {{#with instance.modules.storage.s3}}
            <dl>
              <dt>{{_ "setup_storage_info"}}</dt>
              <dd>Amazon S3 <a href="#" id="btn-setup-s3">{{_ "app_action_edit"}}</a></dd>
            </dl>
            <dl>
              <dt>Key</dt>
              <dd>{{key}}</dd>
            </dl>
            <dl>
              <dt>Secret</dt>
              <dd>{{secret}}</dd>
            </dl>
            <dl>
              <dt>Bucket</dt>
              <dd>{{bucket}}</dd>
            </dl>
            <dl>
              <dt>Region</dt>
              <dd>{{region}}</dd>
            </dl>
            <dl>
              <dt></dt>
              <dd><a href="#" id="btn-setup-gridfs">{{_ "settings_setup_gridfs"}}</a></dd>
            </dl>
          {{else}}
            <dl>
              <dt>{{_ "setup_storage_info"}}</dt>
              <dd>
                {{_ "setup_storage_local"}}
                <span class="pull-right"><i class="fa fa-check text-green"></i></span>
              </dd>
            </dl>
            <dl>
              <dt></dt>
              <dd><a href="#" id="btn-setup-s3">{{_ "settings_setup_s3"}}</a></dd>
            </dl>
          {{/with}}
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">{{_ "app_action_close"}}</button>
        </div>
      </div>
    </div>
  </div>
</template>

<template name="SettingStorageS3Modal">
  <div class="modal fade modal-rounded" id="SettingStorageS3Modal">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>
          <h4 class="modal-title">{{_ 'settings_setup_s3'}}</h4>
        </div>
        {{#autoForm collection=formCollection schema=formSchema id="setup-s3-form" doc=this type="normal"}}
        <div class="modal-body">
          {{> afQuickField name="s3Key"    value=key}}
          {{> afQuickField name="s3Secret" value=secret}}
          {{> afQuickField name="s3Bucket" value=bucket}}
          {{> afQuickField name="s3Region" value=region}}
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">{{_ "app_action_close"}}</button>
          <button type="submit" class="btn btn-primary">{{_ "app_action_confirm"}}</button>
        </div>
        {{/autoForm}}
      </div>
    </div>
  </div>
</template>