<div class="panel panel-default m-t-lg">
  <div class="panel-heading">
    <span class="font-sbold" translate>{{ 'app.admin.projects.settings.comments' }}</span>
  </div>
  <div class="panel-body">
    <div class="row">
      <h3 class="m-l" translate>{{ 'app.admin.projects.settings.disqus' }}</h3>
      <p class="alert alert-warning m-h-md" translate>{{ 'app.admin.projects.settings.disqus_info' }}</p>
      <div class="col-md-4">
        <text-setting name="disqus_shortname"
                      settings="allSettings"
                      label="app.admin.projects.settings.shortname"
                      fa-icon="fa-comments"
                      placeholder="my-forum">
        </text-setting>
      </div>
    </div>
  </div>
</div>

<div class="panel panel-default m-t-lg">
  <div class="panel-heading">
    <span class="font-sbold" translate>{{ 'app.admin.projects.settings.cad_files' }}</span>
  </div>
  <div class="panel-body">
    <div class="row">
      <h3 class="m-l" translate>{{ 'app.admin.projects.settings.validation' }}</h3>
      <p class="alert alert-warning m-h-md" translate>{{ 'app.admin.projects.settings.validation_info' }}</p>
      <div class="col-md-5">
        <select-multiple-setting name="allowed_cad_extensions"
                                 settings="allSettings"
                                 label="app.admin.projects.settings.extensions"
                                 title-new="app.admin.projects.settings.new_extension"
                                 description-new="app.admin.projects.settings.new_ext_info_html"
                                 before-add="removeInitialDot">
        </select-multiple-setting>
      </div>
      <div class="col-md-5 col-md-offset-2">
        <select-multiple-setting name="allowed_cad_mime_types"
                                 settings="allSettings"
                                 label="app.admin.projects.settings.mime_types"
                                 title-new="app.admin.projects.settings.new_mime_type"
                                 description-new="app.admin.projects.settings.new_type_info_html"
                                 before-add="lower">
        </select-multiple-setting>
      </div>
      <form name="mimeTestForm" class="col-md-6 m-t-lg" ng-upload="onTestFileComplete(content)" upload-options-enable-rails-csrf="true" action="/api/files/mime_type">
          <label for="testFile" class="control-label" translate>{{ 'app.admin.projects.settings.test_file' }}</label>
        <div class="fileinput input-group" data-provides="fileinput" ng-class="fileinputClass()">
          <div class="form-control" data-trigger="fileinput">
            <i class="glyphicon glyphicon-file fileinput-exists"></i> <span class="fileinput-filename">{{file.attachment}}</span>
          </div>
          <span class="input-group-addon btn btn-default btn-file">
            <span class="fileinput-new" translate>{{ 'app.admin.projects.settings.set_a_file' }}</span>
            <span class="fileinput-exists" translate>{{ 'app.shared.buttons.change' }}</span>
            <input type="file" id="testFile" name="attachment" accept="*/*" required>
          </span>
        </div>
        <input type="submit" class="btn btn-warning" ng-disabled="mimeTestForm.$invalid || $isUploading">
      </form>
    </div>
  </div>
</div>

<div class="panel panel-default m-t-lg">
  <div class="panel-heading">
    <span class="font-sbold" translate>{{ 'app.admin.projects.settings.projects_sharing' }}</span>
  </div>
  <div class="panel-body">
    <div class="row">
      <h3 class="m-l" translate>{{ 'app.admin.projects.settings.open_lab_projects' }}</h3>
      <p class="alert alert-warning m-h-md" ng-bind-html="'app.admin.projects.settings.open_lab_info_html' | translate"></p>
      <div class="col-md-4">
        <text-setting name="openlab_app_id"
                      settings="allSettings"
                      label="app.admin.projects.settings.open_lab_app_id"
                      fa-icon="fa-info">
        </text-setting>
      </div>
      <div class="col-md-4 col-md-offset-2">
        <text-setting name="openlab_app_secret"
                      settings="allSettings"
                      label="app.admin.projects.settings.open_lab_app_secret"
                      fa-icon="fa-key">
        </text-setting>
      </div>
    </div>
    <div class="row m-t" ng-show="allSettings.openlab_app_secret">
      <p class="alert alert-warning m-h-md" ng-bind-html="'app.admin.projects.settings.openlab_default_info_html' | translate"></p>
      <boolean-setting name="openlab_default"
                       settings="allSettings"
                       label="app.admin.projects.settings.default_to_openlab"
                       classes="m-l"></boolean-setting>
    </div>
  </div>
</div>
