Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                 <div class="container main-content-section" ng-app="bmApp" ng-controller="bmLicensesController">
  <!--UNUSED KEYS-->
  <div class="row content-row">
    <div class="col-xs-12" id="availableLicenses">
      <h2>Licenses Not In Use</h2>
      <div class="panel panel-default">
        <div class="panel-heading">There are {{ usedLicenses() }} licenses not in use
          <div class="pull-right col-xs-3 filter">
            Filter:
            <input type="text" placeholder="Filter Fields" ng-model="search_not_in_use">
          </div>
        </div>
        <div class="panel-body" ng-repeat="bmlicense in bmlicenses |filter:{in_use:'1'}|filter:{reserved:0}|filter:search_not_in_use">
          <div class="panel panel-default row" ng-class-even="'even'" ng-class-odd="'odd'">
            <form class="form-horizontal" name="form{{bmlicense.license_key}}">
              <input ng-model="bmlicense.id" type=hidden value="@{{ bmlicense.id }}" name=id />
              <div>
                <div class="row col-xs-6">
                  <h3>@{{ bmlicense.license_key }}</h3>
                </div>
                <div class="col-xs-3">
                  <label for="ats_info">ATS Info</label>
                  <input class="form-control ats_info" ng-model="bmlicense.ats_info" value="@{{ bmlicense.ats_info }}" required  ng-init="editButton=true" ng-disabled="editButton"></input>
                </div>
                <div class="col-xs-3 pull-right text-right controls">
                  <button class="btn-primary btn editLicenseButton" ng-class="{ 'hidden': showDetails }" ng-click="showDetails = !showDetails; editButton=!editButton; editLicenseClick(bmlicense)" ng-disabled="editing"><i class="mdi mdi-lead-pencil mdi-24px"></i></button>
                  <button class="btn-success btn" ng-init="editButton=true" ng-class="{ 'hidden': ! showDetails }" ng-disabled="editButton" ng-click="showDetails = !showDetails; editButton=!editButton; updateLicenseClick(bmlicense)"><i class="mdi mdi-content-save mdi-24px"></i></button>
                  <button class="btn-warning btn" ng-init="editButton=true" ng-class="{ 'hidden': ! showDetails }" ng-disabled="editButton" ng-click="clearClick(bmlicense)"><i class="mdi mdi-format-clear mdi-24px"></i></button>
                  <button class="btn-danger btn" ng-init="editButton=true" ng-class="{ 'hidden': ! showDetails }" ng-disabled="editButton" ng-click="showDetails = !showDetails; editButton=!editButton; cancelClick(bmlicense)"><i class="mdi mdi-close-circle mdi-24px"></i></button>
                  
                </div>
              </div>
              <div>
                <div class="install1 col-xs-12" ng-class="{ 'hidden': ! showDetails }">
                  <div>1st Install</div>
                  <div class="col-xs-2">
                    <label for="staff_member_1">User</label>
                    <input class="form-control staff_member_1" ng-model="bmlicense.staff_member_1" value="@{{ bmlicense.staff_member_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="computer_name_1">Computer</label>
                    <input class="form-control computer_name_1" ng-model="bmlicense.computer_name_1" value="@{{ bmlicense.computer_name_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="install_date_1">Install Date</label>
                    <input class="form-control install_date_1" ng-model="bmlicense.install_date_1" value="@{{ bmlicense.install_date_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-6">
                    <label for="install_notes_1">Notes</label>
                    <input class="form-control install_notes_1" ng-model="bmlicense.install_notes_1" value="@{{ bmlicense.install_notes_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                </div>
              </div>
              <div>
                <div class="install2 col-xs-12" ng-class="{ 'hidden': ! showDetails }">
                  <div>2nd Install</div>
                  <div class="col-xs-2">
                    <label for="staff_member_2">User</label>
                    <input class="form-control staff_member_2" ng-model="bmlicense.staff_member_2" value="@{{ bmlicense.staff_member_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="computer_name_2">Computer</label>
                    <input class="form-control computer_name_2" ng-model="bmlicense.computer_name_2" value="@{{ bmlicense.computer_name_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="install_date_2">Install Date</label>
                    <input class="form-control install_date_2" ng-model="bmlicense.install_date_2" value="@{{ bmlicense.install_date_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-6">
                    <label for="install_notes_2">Notes</label>
                    <input class="form-control install_notes_2" ng-model="bmlicense.install_notes_2" value="@{{ bmlicense.install_notes_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                </div>
              </div>
              <div>
                <div class="additional-information col-xs-12">
                  <div ng-show="hider">Additional Information</div>
                  <div class="col-xs-2" ng-class="{ 'hidden': ! showDetails }">
                    <label for="school">School</label>
                    <input class="form-control school" ng-model="bmlicense.school" value="@{{ bmlicense.school }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-10">
                    <label for="notes">Notes</label>
                    <input class="form-control notes" ng-model="bmlicense.notes" value="@{{ bmlicense.notes }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                </div>
              </div>
              <input type=hidden id=in_use ng-model="bmlicense.in_use" value="@{{ bmlicense.in_use }}" name=in_use />
              <input type=hidden id=reserved ng-model="bmlicense.reserved" value="@{{ bmlicense.reserved }}" name=reserved />
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="row content-row">
    <div class="col-xs-12" id="availableLicenses">
      <h2>Licenses In Use</h2>
      <div class="panel panel-default">
        <div class="panel-heading">
          {{ unusedLicenses() }} licenses in use
          <div class="pull-right col-xs-3 filter">
            Filter:
            <input type="text" placeholder="Filter Fields" ng-model="search_not_in_use">
          </div>
        </div>
        <div class="panel-body" ng-repeat="bmlicense in bmlicenses |filter:{in_use:'0'}|filter:{reserved:0}|filter:search_not_in_use">
          <div class="panel panel-default row" ng-class-even="'even'" ng-class-odd="'odd'">
            <form class="form-horizontal" name="form{{bmlicense.license_key}}">
              <input ng-model="bmlicense.id" type=hidden value="@{{ bmlicense.id }}" name=id />
              <div>
                <div class="row col-xs-6">
                  <h3>@{{ bmlicense.license_key }}</h3>
                </div>
                <div class="col-xs-3">
                  <label for="ats_info">ATS Info</label>
                  <input class="form-control ats_info" ng-model="bmlicense.ats_info" value="@{{ bmlicense.ats_info }}" required  ng-init="editButton=true" ng-disabled="editButton"></input>
                </div>
                <div class="col-xs-3 pull-right text-right controls">
                  <button class="btn-primary btn editLicenseButton" ng-class="{ 'hidden': showDetails }" ng-click="showDetails = !showDetails; editButton=!editButton; editLicenseClick(bmlicense)" ng-disabled="editing"><i class="mdi mdi-lead-pencil mdi-24px"></i></button>
                  <button class="btn-success btn" ng-init="editButton=true" ng-class="{ 'hidden': ! showDetails }" ng-disabled="editButton" ng-click="showDetails = !showDetails; editButton=!editButton; updateLicenseClick(bmlicense)"><i class="mdi mdi-content-save mdi-24px"></i></button>
                  <button class="btn-warning btn" ng-init="editButton=true" ng-class="{ 'hidden': ! showDetails }" ng-disabled="editButton" ng-click="clearClick(bmlicense)"><i class="mdi mdi-format-clear mdi-24px"></i></button>
                  <button class="btn-danger btn" ng-init="editButton=true" ng-class="{ 'hidden': ! showDetails }" ng-disabled="editButton" ng-click="showDetails = !showDetails; editButton=!editButton; cancelClick(bmlicense)"><i class="mdi mdi-close-circle mdi-24px"></i></button>
                  
                </div>
              </div>
              <div>
                <div class="install1 col-xs-12" ng-class="{ 'hidden': ! showDetails }">
                  <div>1st Install</div>
                  <div class="col-xs-2">
                    <label for="staff_member_1">User</label>
                    <input class="form-control staff_member_1" ng-model="bmlicense.staff_member_1" value="@{{ bmlicense.staff_member_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="computer_name_1">Computer</label>
                    <input class="form-control computer_name_1" ng-model="bmlicense.computer_name_1" value="@{{ bmlicense.computer_name_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="install_date_1">Install Date</label>
                    <input class="form-control install_date_1" ng-model="bmlicense.install_date_1" value="@{{ bmlicense.install_date_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-6">
                    <label for="install_notes_1">Notes</label>
                    <input class="form-control install_notes_1" ng-model="bmlicense.install_notes_1" value="@{{ bmlicense.install_notes_1 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                </div>
              </div>
              <div>
                <div class="install2 col-xs-12" ng-class="{ 'hidden': ! showDetails }">
                  <div>2nd Install</div>
                  <div class="col-xs-2">
                    <label for="staff_member_2">User</label>
                    <input class="form-control staff_member_2" ng-model="bmlicense.staff_member_2" value="@{{ bmlicense.staff_member_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="computer_name_2">Computer</label>
                    <input class="form-control computer_name_2" ng-model="bmlicense.computer_name_2" value="@{{ bmlicense.computer_name_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-2">
                    <label for="install_date_2">Install Date</label>
                    <input class="form-control install_date_2" ng-model="bmlicense.install_date_2" value="@{{ bmlicense.install_date_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-6">
                    <label for="install_notes_2">Notes</label>
                    <input class="form-control install_notes_2" ng-model="bmlicense.install_notes_2" value="@{{ bmlicense.install_notes_2 }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                </div>
              </div>
              <div>
                <div class="additional-information col-xs-12">
                  <div ng-show="hider">Additional Information</div>
                  <div class="col-xs-2" ng-class="{ 'hidden': ! showDetails }">
                    <label for="school">School</label>
                    <input class="form-control school" ng-model="bmlicense.school" value="@{{ bmlicense.school }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                  <div class="col-xs-10">
                    <label for="notes">Notes</label>
                    <input class="form-control notes" ng-model="bmlicense.notes" value="@{{ bmlicense.notes }}" ng-init="editButton=true" ng-disabled="editButton"></input>
                  </div>
                </div>
              </div>
              <input type=hidden id=in_use ng-model="bmlicense.in_use" value="@{{ bmlicense.in_use }}" name=in_use />
              <input type=hidden id=reserved ng-model="bmlicense.reserved" value="@{{ bmlicense.reserved }}" name=reserved />
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                #reservedLicenses {
  padding-top:40px;
}
#availableLicenses {
  padding-top:40px;
}
#unavailableLicenses {
  padding-top:40px;
}
body {
  margin-top:70px;
}
.panel-default {
  padding:8px;
}
.controls {
  margin-top:16px;
  margin-right:8px;
}

.panel .even {
  background-color:#F8F8F8;
}
.install1{
margin-top:5px;
}
.install2{
margin-top:5px;
}
.additional-information{
margin-top:5px;
}
.panel-body h3 {
  margin-left:10px;
}
.filter{
  margin-bottom:10px;
}

              
            
!

JS

              
                var bmStudioApp = angular.module('bmApp',[]);
bmStudioApp.controller('bmLicensesController', function($scope)
{
      $scope.bmlicenses = [{"id":1,"license_key":"LICENS","ats_info":"154455533302266","staff_member_1":"Alasdez, Basdh","computer_name_1":"","install_date_1":null,"install_notes_1":"","staff_member_2":"","computer_name_2":"","install_date_2":null,"install_notes_2":"","school":"","in_use":1,"reserved":0,"notes":"","created_at":null,"updated_at":null,"deleted_at":null},{"id":2,"license_key":"LICNENSDLJCE","ats_info":"101233002281","staff_member_1":"Basder, Denfese","computer_name_1":"","install_date_1":null,"install_notes_1":"","staff_member_2":"","computer_name_2":"","install_date_2":null,"install_notes_2":"","school":"","in_use":1,"reserved":0,"notes":"","created_at":null,"updated_at":null,"deleted_at":null},{"id":3,"license_key":"LICSJDJENCS","ats_info":"10054023443302267","staff_member_1":"Behrefezi, Hoasdes","computer_name_1":"","install_date_1":null,"install_notes_1":"","staff_member_2":"","computer_name_2":"","install_date_2":null,"install_notes_2":"","school":"","in_use":1,"reserved":0,"notes":"","created_at":null,"updated_at":null,"deleted_at":null}];
    /*$scope.bmlicenses = $http.get('licenses')
      .then(function success(response){
        $scope.bmlicenses = response.data;
      })
      .catch(function error(response){
      });
    */
    $scope.disabled = true;
    $scope.hider = false;
    $scope.master = {};
  
    $scope.unusedLicenses = function() {
      var count = 0;
      angular.forEach( $scope.bmlicenses, function(bmlicense){
        count += bmlicense.in_use ? 0 : 1;
        count -= bmlicense.reserved ? 1 : 0;
      });
      return count;
      }

    $scope.usedLicenses = function() {
      var count = 0;
      angular.forEach( $scope.bmlicenses, function(bmlicense){
        count += bmlicense.in_use ? 1 : 0;
      });
      return count;
      }

      $scope.reservedLicenses = function() {
        var count = 0;
        angular.forEach( $scope.bmlicenses, function(bmlicense){
          count += bmlicense.reserved ? 1 : 0;
        });
        return count;
        }
      $scope.editLicenseClick = function(bmlicense) {
        $scope.master = angular.copy(bmlicense);
        $scope.editing = true;
      }
      $scope.cancelClick = function(bmlicense) {
        angular.copy($scope.master, bmlicense);
        $scope.editing = false;
      }
      $scope.clearClick = function(bmlicense) {
        bmlicense.staff_member_1 = '';
        bmlicense.computer_name_1 = '';
        bmlicense.install_date_1 = '';
        bmlicense.install_notes_1 = '';
        bmlicense.staff_member_2 = '';
        bmlicense.computer_name_2 = '';
        bmlicense.install_date_2 = '';
        bmlicense.install_notes_2 = '';
        bmlicense.school = '';
        bmlicense.notes = '';
      }
    $scope.updateLicenseClick = function(bmlicense) {
      if (bmlicense.staff_member_1 != "" && bmlicense.computer_name_1 != "") {
        console.log('this is in use!')
        bmlicense.in_use = 0;
      }
      angular.copy(bmlicense, $scope.bmlicenses[bmlicense]);
      console.log($scope.bmlicenses);
      $scope.editing = false;
      //$http.put('licenses/'+bmlicense.id, $scope.bmlicense);
    }  
});

              
            
!
999px

Console