<clr-datagrid (clrDgRefresh)="refresh($event)">
    <clr-dg-column>{{'PROJECT.NAME' | translate}}</clr-dg-column>
    <clr-dg-column>{{'PROJECT.ACCESS_LEVEL' | translate}}</clr-dg-column>
    <clr-dg-column *ngIf="showRoleInfo">{{'PROJECT.ROLE' | translate}}</clr-dg-column>
    <clr-dg-column>{{'PROJECT.REPO_COUNT'| translate}}</clr-dg-column>
    <clr-dg-column>{{'PROJECT.CREATION_TIME' | translate}}</clr-dg-column>
    <clr-dg-row *clrDgItems="let p of projects">
        <clr-dg-action-overflow [hidden]="!(p.current_user_role_id === 1 || isSystemAdmin)">
            <button class="action-item" (click)="newReplicationRule(p)" [hidden]="!isSystemAdmin">{{'PROJECT.REPLICATION_RULE' | translate}}</button>
            <button class="action-item" (click)="toggleProject(p)">{{'PROJECT.MAKE' | translate}} {{(p.public === 0 ? 'PROJECT.PUBLIC' : 'PROJECT.PRIVATE') | translate}} </button>
            <button class="action-item" (click)="deleteProject(p)">{{'PROJECT.DELETE' | translate}}</button>
        </clr-dg-action-overflow>
        <clr-dg-cell><a href="javascript:void(0)" (click)="goToLink(p.project_id)">{{p.name}}</a></clr-dg-cell>
        <clr-dg-cell>{{ (p.public === 1 ? 'PROJECT.PUBLIC' : 'PROJECT.PRIVATE') | translate}}</clr-dg-cell>
        <clr-dg-cell *ngIf="showRoleInfo">{{roleInfo[p.current_user_role_id] | translate}}</clr-dg-cell>
        <clr-dg-cell>{{p.repo_count}}</clr-dg-cell>
        <clr-dg-cell>{{p.creation_time | date: 'short'}}</clr-dg-cell>
    </clr-dg-row>
    <clr-dg-footer>
        {{(projects ? projects.length : 0)}} {{'PROJECT.ITEMS' | translate}}
        <clr-dg-pagination [clrDgPageSize]="15"></clr-dg-pagination>
    </clr-dg-footer>
</clr-datagrid>