aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/shared/buttons/action-dropdown.component.html
blob: 99e8b7ec1651482c39dc0c1285777cb83e3f15dc (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                                                           
      
                                                                                                                                                          

                                   


                                                                                                                                     
                                                                  

        
                                             
                                                       
 

                                                                                                     
 









                                                                                                                                                      

                              
 
                       
                     
 
                                                                                      
 

                   
      
<div class="dropdown-root" ngbDropdown [placement]="placement" *ngIf="areActionsDisplayed(actions, entry)">
  <div
    class="action-button" [ngClass]="{ small: buttonSize === 'small', grey: theme === 'grey', orange: theme === 'orange', 'button-styled': buttonStyled }"
    ngbDropdownToggle role="button"
  >
    <my-global-icon *ngIf="!label && buttonDirection === 'horizontal'" class="more-icon" iconName="more-horizontal"></my-global-icon>
    <my-global-icon *ngIf="!label && buttonDirection === 'vertical'" class="more-icon" iconName="more-vertical"></my-global-icon>

    <span *ngIf="label" class="dropdown-toggle">{{ label }}</span>
  </div>

  <div ngbDropdownMenu class="dropdown-menu">
    <ng-container *ngFor="let actions of getActions()">

      <ng-container *ngFor="let action of actions">
        <ng-container *ngIf="action.isDisplayed === undefined || action.isDisplayed(entry) === true">

          <a *ngIf="action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" class="dropdown-item" [routerLink]="action.linkBuilder(entry)">
            <my-global-icon *ngIf="action.iconName" [iconName]="action.iconName" [ngClass]="'icon-' + action.iconName"></my-global-icon>
            {{ action.label }}
          </a>

          <span
            *ngIf="!action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" (click)="action.handler(entry)"
            class="custom-action dropdown-item" role="button"
          >
            <my-global-icon *ngIf="action.iconName" [iconName]="action.iconName" [ngClass]="'icon-' + action.iconName"></my-global-icon>
            {{ action.label }}
          </span>

        </ng-container>
      </ng-container>

      <div *ngIf="areActionsDisplayed(actions, entry)" class="dropdown-divider"></div>

    </ng-container>
  </div>
</div>