Skip to content

Commit

Permalink
Better use of space and icons in plugins administration interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rigelk committed Mar 10, 2020
1 parent 9b30785 commit 03efb14
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 31 deletions.
1 change: 1 addition & 0 deletions CREDITS.md
Expand Up @@ -336,3 +336,4 @@
* [Fork-Awesome](https://github.com/ForkAwesome/Fork-Awesome)
* `playlist add` by Material UI
* `language` by Aaron Jin
* `npm` by Boboss74
Expand Up @@ -10,22 +10,19 @@
<div class="card plugin" *ngFor="let plugin of plugins">
<div class="card-body">
<div class="first-row">
<a class="plugin-name" [routerLink]="getShowRouterLink(plugin)" i18n-title title="Show plugin settings">{{ plugin.name }}</a>
<span class="plugin-name">{{ plugin.name }}</span>

<span class="plugin-version">{{ plugin.version }}</span>
</div>

<div class="second-row">
<div class="description">{{ plugin.description }}</div>
<a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="plugin.homepage" i18n-title title="Go to the plugin homepage">
<my-global-icon iconName="home"></my-global-icon>
</a>

<div class="buttons">
<a class="action-button action-button-edit grey-button" target="_blank" rel="noopener noreferrer"
[href]="plugin.homepage" i18n-title title="Go to the plugin homepage"
>
<my-global-icon iconName="go"></my-global-icon>
<span i18n class="button-label">Homepage</span>
</a>
<a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="'https://www.npmjs.com/package/peertube-plugin-' + plugin.name" i18n-title title="Go to the plugin homepage">
<my-global-icon iconName="npm"></my-global-icon>
</a>

<div class="buttons">
<my-edit-button *ngIf="pluginType !== PluginType.THEME" [routerLink]="getShowRouterLink(plugin)" label="Settings" i18n-label></my-edit-button>

<my-button class="update-button" *ngIf="isUpdateAvailable(plugin)" (click)="update(plugin)" [loading]="isUpdating(plugin)"
Expand All @@ -35,6 +32,10 @@
<my-delete-button (click)="uninstall(plugin)" label="Uninstall" i18n-label></my-delete-button>
</div>
</div>

<div class="second-row">
<div class="description">{{ plugin.description }}</div>
</div>
</div>
</div>
</div>
Expand Up @@ -37,25 +37,26 @@

<span class="plugin-version">{{ plugin.latestVersion }}</span>

<span *ngIf="plugin.installed" class="badge badge-success">Installed</span>
</div>
<a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="plugin.homepage" i18n-title title="Go to the plugin homepage">
<my-global-icon iconName="home"></my-global-icon>
</a>

<div class="second-row">
<div class="description">{{ plugin.description }}</div>
<a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="'https://www.npmjs.com/package/peertube-plugin-' + plugin.name" i18n-title title="Go to the plugin homepage">
<my-global-icon iconName="npm"></my-global-icon>
</a>

<div class="buttons">
<a class="action-button action-button-edit grey-button" target="_blank" rel="noopener noreferrer"
[href]="plugin.homepage" i18n-title title="Go to the plugin homepage"
>
<my-global-icon iconName="go"></my-global-icon>
<span i18n class="button-label">Homepage</span>
</a>
<span *ngIf="plugin.installed" class="badge badge-success">Installed</span>

<div class="buttons">
<my-button class="update-button" *ngIf="plugin.installed === false" (click)="install(plugin)" [loading]="isInstalling(plugin)"
label="Install" icon="cloud-download" [attr.disabled]="isInstalling(plugin)"
></my-button>
</div>
</div>

<div class="second-row">
<div class="description">{{ plugin.description }}</div>
</div>
</div>
</div>
</div>
Expand Up @@ -25,5 +25,5 @@
.badge {
font-size: 13px;
font-weight: $font-semibold;
margin-left: 5px;
margin-left: 15px;
}
29 changes: 22 additions & 7 deletions client/src/app/+admin/plugins/shared/plugin-list.component.scss
Expand Up @@ -7,6 +7,8 @@
}

.first-row {
display: flex;
align-items: center;
margin-bottom: 10px;

.plugin-name {
Expand All @@ -18,6 +20,26 @@
.plugin-version {
opacity: 0.6;
}

.plugin-icon {
margin-left: 10px;

my-global-icon {
@include apply-svg-color($grey-foreground-color);

&[iconName="npm"] {
@include fill-svg-color($grey-foreground-color);
}
}
}

.buttons {
margin-left: auto;
width: max-content;
> *:not(:last-child) {
margin-right: 10px;
}
}
}

.second-row {
Expand All @@ -29,13 +51,6 @@
.description {
opacity: 0.8
}

.buttons {
margin-left: 10px;
> *:not(:last-child) {
margin-right: 10px;
}
}
}

.action-button {
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/shared/images/global-icon.component.ts
Expand Up @@ -53,7 +53,8 @@ const icons = {
'p2p': require('!!raw-loader?!../../../assets/images/menu/p2p.svg'),
'users': require('!!raw-loader?!../../../assets/images/global/users.svg'),
'search': require('!!raw-loader?!../../../assets/images/global/search.svg'),
'refresh': require('!!raw-loader?!../../../assets/images/global/refresh.svg')
'refresh': require('!!raw-loader?!../../../assets/images/global/refresh.svg'),
'npm': require('!!raw-loader?!../../../assets/images/global/npm.svg')
}

export type GlobalIconName = keyof typeof icons
Expand Down
6 changes: 6 additions & 0 deletions client/src/assets/images/global/npm.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 03efb14

Please sign in to comment.