Skip to content
Snippets Groups Projects
database_edit.html 3.39 KiB
Newer Older
  • Learn to ignore specific revisions
  • Kyle Doherty's avatar
    Kyle Doherty committed
    <div class="wrapper">
        <section class="Breadcrumbs">
            <a class="Breadcrumb Breadcrumb--path" cv-org-href="/admin/databases/">Databases</a>
            <cv-chevron-right-icon class="Breadcrumb-divider" width="12px" height="12px"></cv-chevron-right-icon>
            <h2 class="Breadcrumb Breadcrumb--page" ng-if="!database.id">Add Database</h2>
            <h2 class="Breadcrumb Breadcrumb--page" ng-if="database.id">{{database.name}}</h2>
        </section>
    
        <section class="Grid Grid--gutters Grid--full">
    
    Kyle Doherty's avatar
    Kyle Doherty committed
            <div class="Grid-cell Cell--2of3">
    
                <form class="Form-new bordered rounded shadowed" name="form" novalidate>
    
                    <div class="Form-field" mb-form-field="engine">
                        <mb-form-label display-name="Database type" field-name="engine"></mb-form-label>
    
                        <label class="Select Form-offset">
    
                            <select name="engine" ng-model="database.engine" ng-options="type as properties.name for (type, properties) in form_input.engines"></select>
                        </label>
    
                    <div class="Form-field" mb-form-field="engine">
                        <mb-form-label display-name="Name" field-name="name"></mb-form-label>
    
    Allen Gilliland's avatar
    Allen Gilliland committed
                        <input class="Form-input Form-offset full" name="name" placeholder="How would you like to refer to this database?" ng-model="database.name" required autofocus />
    
                        <span class="Form-charm"></span>
    
                    <!-- Database Input Fields - show a form for each field in DatabaseEdit.DATABASE_FIELDS[database.engine] -->
                    <div class="FormInputGroup">
                        <div class="Form-field" ng-repeat="field in ENGINES[database.engine].fields" mb-form-field="{{field.fieldName}}">
                            <mb-form-label display-name="{{field.displayName}}" field-name="{{field.fieldName}}"></mb-form-label>
                            <input class="Form-input Form-offset full" name="{{field.fieldName}}" placeholder="{{field.placeholder}}"
                                   ng-model="details[field.fieldName]" ng-required="field.required" />
    
                            <span class="Form-charm"></span>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                        </div>
    
                    <div class="Form-actions">
    
                        <button class="Button" ng-class="{'Button--primary': form.$valid}" ng-click="save(database, details)" ng-disabled="!form.$valid">
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                </form>
            </div>
    
            <!-- actions -->
    
            <div class="Grid-cell Cell--1of3" ng-if="database.id">
    
                <div class="Actions">
                    <h3>Actions</h3>
                    <div class="Actions-group">
    
                        <button class="Button" mb-action-button="sync" success-text="Sync triggered!" failed-text="Failed to sync" active-text="Starting ...">Sync</button>
    
                    </div>
    
                    <div class="Actions-group Actions--dangerZone">
                        <label class="Actions-groupLabel block">Danger Zone:</label>
    
                        <!-- TODO: this doesn't do anything because its unclear if its really safe to delete dbs -->
    
                        <button class="Button Button--danger">Remove this database</button>
    
                    </div>
                </div>
            </div>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
        </section>
    
    </div><!-- wrapper -->