<project-header class="top-header"></project-header>
<project-page>

  <!-- Middle section -->
  <div class="middle-section">
    <div id="scrollable-content" class="middle-container has-scroll">
      <div class="middle-header">
        <div class="container-fluid">
          <breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>
          <alerts alerts="alerts"></alerts>
          <div ng-if="!loaded">Loading...</div>
          <div class="deployment" ng-if="deployment">
            <h1>
              {{deployment.metadata.name}}
              <small class="meta">created <relative-timestamp timestamp="deployment.metadata.creationTimestamp"></relative-timestamp></small>
              <div class="pull-right dropdown">
                <button type="button" class="dropdown-toggle actions-dropdown-btn btn btn-default hidden-xs" data-toggle="dropdown">
                  Actions
                  <span class="caret"></span>
                </button>
                <a href=""
                   class="dropdown-toggle actions-dropdown-kebab visible-xs-inline"
                   data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i><span class="sr-only">Actions</span></a>
                <ul class="dropdown-menu actions action-button">
                  <li>
                    <a ng-href="project/{{project.metadata.name}}/attach-pvc?deployment={{deployment.metadata.name}}"
                       role="botton">Attach Storage</a>
                  </li>
                  <li>
                    <a href="project/{{projectName}}/set-limits?rcName={{deployment.metadata.name}}"
                       role="button">Set Resource Limits</a>
                  </li>
                  <li>
                    <edit-link
                      resource="deployment"
                      kind="ReplicationController"
                      alerts="alerts">
                    </edit-link>
                  </li>
                  <li ng-class="{disabled: deployment.status.replicas}">
                    <delete-link
                      kind="ReplicationController"
                      resource-name="{{deployment.metadata.name}}"
                      project-name="{{deployment.metadata.namespace}}"
                      alerts="alerts"
                      disable-delete="!!deployment.status.replicas">
                    </delete-link>
                  </li>
                </ul>
              </div>
            </h1>
            <labels labels="deployment.metadata.labels" clickable="true" kind="deployments" project-name="{{deployment.metadata.namespace}}" limit="3"></labels>
          </div><!-- /deployment -->          
        </div>
      </div><!-- /middle-header-->
      <div class="middle-content">
        <div class="container-fluid">
          <div class="row" ng-if="deployment" >
            <div class="col-md-12">
              <uib-tabset>
                <uib-tab active="selectedTab.details">
                  <uib-tab-heading>Details</uib-tab-heading>
                  <div class="resource-details">
                    <ng-include src=" 'views/browse/_deployment-details.html' "></ng-include>
                  </div>
                </uib-tab>
                <uib-tab active="selectedTab.events">
                  <uib-tab-heading>Events</uib-tab-heading>
                  <events resource-kind="ReplicationController" resource-name="{{deployment.metadata.name}}" project-context="projectContext" ng-if="selectedTab.events"></events>
                </uib-tab>
              </uib-tabset>
            </div><!-- /col-* -->
          </div>
        </div>
      </div><!-- /middle-content -->
    </div><!-- /middle-container -->
  </div><!-- /middle-section -->
</project-page>
