APTrust/dart

View on GitHub
ui/templates/bagit_profile/form.html

Summary

Maintainability
Test Coverage
<h2>BagIt Profile</h2>

{{> bannerAlert message = alertMessage }}

{{#if errors}}
<div class="alert alert-danger" role="alert">
  <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
  <p>{{ errMessage }}</p>
  <ul class='text-danger'>
    {{#each errors as |err| }}
    <li>{{ err }}</li>
    {{/each }}
  </ul>
</div>
{{/if}}

<form method="post" action="#" id="{{ id }}">

<nav>
  <div class="nav nav-tabs" id="nav-tab" role="tablist">
    <a class="nav-item nav-link active" id="navAboutTab" data-toggle="tab" href="#profileAbout" role="tab" aria-controls="profileAbout" aria-selected="true">About</a>
    <a class="nav-item nav-link" id="navInfoTab" data-toggle="tab" href="#profileInfo" role="tab" aria-controls="profileInfo" aria-selected="false">Info</a>
    <a class="nav-item nav-link" id="navGeneralTab" data-toggle="tab" href="#profileGeneral" role="tab" aria-controls="profileGeneral" aria-selected="false">General</a>
    <a class="nav-item nav-link" id="navManifestsTab" data-toggle="tab" href="#profileManifests" role="tab" aria-controls="profileManifests" aria-selected="false">Manifests</a>
    <a class="nav-item nav-link" id="navSerializationTab" data-toggle="tab" href="#profileSerialization" role="tab" aria-controls="profileSerialization" aria-selected="false">Serialization</a>

    <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Tag Files</a>
    <div class="dropdown-menu">
      <a class="dropdown-item" id="navTagFilesAllowed" data-toggle="tab" href="#tagFilesAllowed" aria-controls="tagFilesAllowed" aria-selected="false">Show Tag Files Allowed</a>
      <div class="dropdown-divider"></div>
      {{#each tagFileNames as |tagFile| }}
      <a class="dropdown-item" id="navTags-{{ tagFile }}" data-toggle="tab" href="#profileTags-{{ tagFile }}" aria-controls="profileTags-{{ tagFile }}" aria-selected="false">{{ tagFile }}</a>
      {{/each }}
      <div class="dropdown-divider"></div>
      <a class="dropdown-item" href="#BagItProfile/newTagFile?id={{ bagItProfileId }}">Add New Tag File</a>
    </div>

  </div>
</nav>


<div class="tab-content mt-4" id="nav-tabContent">
  <div class="tab-pane fade show active" role="tabpanel" id="profileAbout" aria-labelledby="navAboutTab">
    {{> inputText field = form.fields.name }}
    {{> inputText field = form.fields.description }}
  </div>
  <div class="tab-pane fade" role="tabpanel" id="profileInfo" aria-labelledby="navInfoTab">
    {{> inputText field = form.fields.infoIdentifier }}
    {{> inputText field = form.fields.infoContactEmail }}
    {{> inputText field = form.fields.infoContactName }}
    {{> inputText field = form.fields.infoExternalDescription }}
    {{> inputText field = form.fields.infoSourceOrganization }}
    {{> inputText field = form.fields.infoVersion }}
  </div>
  <div class="tab-pane fade" role="tabpanel" id="profileGeneral" aria-labelledby="navGeneralTab">
    {{> inputSelect field = form.fields.acceptBagItVersion }}
    {{> inputSelect field = form.fields.allowFetchTxt }}
  </div>
  <div class="tab-pane fade" role="tabpanel" id="profileManifests" aria-labelledby="navManifestsTab">
    {{> inputSelect field = form.fields.manifestsAllowed }}
    {{> inputSelect field = form.fields.manifestsRequired }}
    {{> inputSelect field = form.fields.tagManifestsAllowed }}
    {{> inputSelect field = form.fields.tagManifestsRequired }}
  </div>
  <div class="tab-pane fade" role="tabpanel" id="profileSerialization" aria-labelledby="navSerializationTab">
    {{> inputSelect field = form.fields.serialization }}
    {{> inputSelect field = form.fields.acceptSerialization }}
    {{> inputSelect field = form.fields.tarDirMustMatchName }}
  </div>

  {{#each tagFileNames as |tagFile| }}
  <div class="tab-pane fade" role="tabpanel" id="profileTags-{{ tagFile }}" aria-labelledby="navTags-{{ tagFile }}" data-tag-file-name="{{ tagFile }}">
    {{> profileTags tags = (lookup ../tagsByFile tagFile) bagItProfileId = ../bagItProfileId tagFileName = tagFile }}
  </div>
  {{/each }}
  <div class="tab-pane fade" role="tabpanel" id="tagFilesAllowed" aria-labelledby="tagFilesAllowed">
    {{> inputTextArea field = form.fields.tagFilesAllowed }}
  </div>


</div>

{{> inputHidden field = form.fields.id }}
{{> inputHidden field = form.fields.userCanDelete }}
{{> inputHidden field = form.fields.baseProfileId }}

<div class="bottom-buttons">
  <div class="pull-left">
  {{#if (eq form.obj.isBuiltIn false) }}
    <a class="btn btn-danger" href="#{{ form.objType }}/destroy?id={{ form.fields.id.value }}" role="button">Delete Profile</a>
  {{/if}}
    <a class="btn btn-outline-success" href="#{{ form.objType }}/exportProfile?id={{ form.fields.id.value }}" role="button">Export Profile</a>
  </div>

  <div class="pull-right">
    <a class="btn btn-primary" href="#{{ form.objType }}/update?id={{ form.fields.id.value }}" role="button">Save</a>
  </div>
  <div class="pull-right mr-5">
    <a class="btn btn-secondary" href="#{{ form.objType }}/list" role="button">Cancel</a>
  </div>
</div>


</form>