]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Better use of space and icons in plugins administration interface
authorRigel Kent <sendmemail@rigelk.eu>
Tue, 10 Mar 2020 22:42:52 +0000 (23:42 +0100)
committerRigel Kent <sendmemail@rigelk.eu>
Tue, 10 Mar 2020 22:48:12 +0000 (23:48 +0100)
CREDITS.md
client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html
client/src/app/+admin/plugins/plugin-search/plugin-search.component.html
client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss
client/src/app/+admin/plugins/shared/plugin-list.component.scss
client/src/app/shared/images/global-icon.component.ts
client/src/assets/images/global/npm.svg [new file with mode: 0644]

index 1d1f12cb29e3a960e9510a171e1e22cd52aa9b44..910c673682850e34336dd7efb09abf196d77d2dd 100644 (file)
  * [Fork-Awesome](https://github.com/ForkAwesome/Fork-Awesome)
  * `playlist add` by Material UI
  * `language` by Aaron Jin
+ * `npm` by Boboss74
index 1a177de72d9b085b70a23e41cfbcc9afc3e17832..a2d0fde08a5518713437a5235d554f4cebb29b4d 100644 (file)
   <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)"
           <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>
index 5f18028c967d642eb85929478328404f11b28cc4..fac81bd26b6d7a40d7512ded4833efafa8207522 100644 (file)
 
         <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>
index ed06825c8dec3097041d746f30051427e721329e..20f169e13e241e33787059dbf47af61cd3f0f91b 100644 (file)
@@ -25,5 +25,5 @@
 .badge {
   font-size: 13px;
   font-weight: $font-semibold;
-  margin-left: 5px;
+  margin-left: 15px;
 }
index 87a709b00b6911a75fa5ba984ab2363d3f8a28d7..3f4fad7b93ca30ba51ffa5c57555eceb989ab4d2 100644 (file)
@@ -7,6 +7,8 @@
 }
 
 .first-row {
+  display: flex;
+  align-items: center;
   margin-bottom: 10px;
 
   .plugin-name {
   .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 {
   .description {
     opacity: 0.8
   }
-
-  .buttons {
-    margin-left: 10px;
-    > *:not(:last-child) {
-      margin-right: 10px;
-    }
-  }
 }
 
 .action-button {
index e83daf077cf72ad4dac93bf1de74ea8060fef1ce..a2e2b719d0ad081e1945d8fd038de9dfc65f990b 100644 (file)
@@ -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
diff --git a/client/src/assets/images/global/npm.svg b/client/src/assets/images/global/npm.svg
new file mode 100644 (file)
index 0000000..ec8f412
--- /dev/null
@@ -0,0 +1,6 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 18 7" style="transform: scale(1.3) translateY(1px);">\r
+  <path fill="#00000" d="M0,0h18v6H9v1H5V6H0V0z M1,5h2V2h1v3h1V1H1V5z M6,1v5h2V5h2V1H6z M8,2h1v2H8V2z M11,1v4h2V2h1v3h1V2h1v3h1V1H11z"/>\r
+  <polygon fill="#FFFFFF" points="1,5 3,5 3,2 4,2 4,5 5,5 5,1 1,1 "/>\r
+  <polygon fill="#FFFFFF" d="M6,1v5h2V5h2V1H6z M9,4H8V2h1V4z"/>\r
+  <polygon fill="#FFFFFF" points="11,1 11,5 13,5 13,2 14,2 14,5 15,5 15,2 16,2 16,5 17,5 17,1 "/>\r
+</svg>\r