diff --git a/CREDITS.md b/CREDITS.md
index a7b2b5568..65017bbc1 100644
--- a/CREDITS.md
+++ b/CREDITS.md
@@ -8,14 +8,9 @@
# Design
-Inspirations from:
+By [Olivier Massain](https://twitter.com/omassain)
- * [Aurélien Salomon](https://dribbble.com/shots/1338727-Youtube-Redesign)
- * [Wojciech Zieliński](https://dribbble.com/shots/3000315-youtube-concept)
-
-Video.js theme:
-
- * [zanechua](https://github.com/zanechua/videojs-sublime-inspired-skin)
+Icons from [Robbie Pearce](https://robbiepearce.com/softies/)
# Fonts
diff --git a/client/.bootstraprc b/client/.bootstraprc
index 6ceef4fe9..cc6768d43 100644
--- a/client/.bootstraprc
+++ b/client/.bootstraprc
@@ -84,19 +84,19 @@ styles:
navs: true
navbar: false
breadcrumbs: false
- pagination: true
+ pagination: false
pager: false
- labels: true
+ labels: false
badges: false
jumbotron: false
- thumbnails: true
+ thumbnails: false
alerts: true
- progress-bars: true
+ progress-bars: false
media: true
list-group: false
panels: true
wells: false
- responsive-embed: true
+ responsive-embed: false
close: true
# Components w/ JavaScript
diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js
index 9cd33d2ed..f387b44f9 100644
--- a/client/config/webpack.common.js
+++ b/client/config/webpack.common.js
@@ -13,6 +13,7 @@ const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin')
const ngcWebpack = require('ngc-webpack')
+const CopyWebpackPlugin = require('copy-webpack-plugin')
const WebpackNotifierPlugin = require('webpack-notifier')
@@ -146,14 +147,15 @@ module.exports = function (options) {
loader: 'sass-resources-loader',
options: {
resources: [
- helpers.root('src/sass/_variables.scss')
+ helpers.root('src/sass/_variables.scss'),
+ helpers.root('src/sass/_mixins.scss')
]
}
}
]
},
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'url-loader?limit=10000&minetype=application/font-woff' },
- { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'file-loader' },
+ { test: /\.(otf|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'url-loader?limit=10000' },
/* Raw loader support for *.html
* Returns file content as string
@@ -266,6 +268,17 @@ module.exports = function (options) {
inject: 'body'
}),
+ new CopyWebpackPlugin([
+ {
+ from: helpers.root('src/assets/images/favicon.png'),
+ to: 'assets/images/favicon.png'
+ },
+ {
+ from: helpers.root('src/assets/images/default-avatar.png'),
+ to: 'assets/images/default-avatar.png'
+ }
+ ]),
+
/*
* Plugin: ScriptExtHtmlWebpackPlugin
* Description: Enhances html-webpack-plugin functionality
@@ -289,6 +302,7 @@ module.exports = function (options) {
*/
new LoaderOptionsPlugin({
options: {
+ context: '',
sassLoader: {
precision: 10,
includePaths: [ helpers.root('src/sass') ]
diff --git a/client/config/webpack.video-embed.js b/client/config/webpack.video-embed.js
index fe40194cf..2b70b6681 100644
--- a/client/config/webpack.video-embed.js
+++ b/client/config/webpack.video-embed.js
@@ -74,7 +74,8 @@ module.exports = function (options) {
loader: 'sass-resources-loader',
options: {
resources: [
- helpers.root('src/sass/_variables.scss')
+ helpers.root('src/sass/_variables.scss'),
+ helpers.root('src/sass/_mixins.scss')
]
}
}
diff --git a/client/package.json b/client/package.json
index 39b3185cc..45f555f29 100644
--- a/client/package.json
+++ b/client/package.json
@@ -43,7 +43,6 @@
"@types/webpack": "^3.0.0",
"@types/webtorrent": "^0.98.4",
"add-asset-html-webpack-plugin": "^2.0.1",
- "angular-pipes": "^6.0.0",
"angular2-notifications": "^0.7.7",
"angular2-template-loader": "^0.6.0",
"assets-webpack-plugin": "^3.4.0",
@@ -70,8 +69,10 @@
"markdown-it": "^8.4.0",
"ng-router-loader": "^2.0.0",
"ngc-webpack": "3.2.2",
- "ngx-bootstrap": "1.9.3",
+ "ngx-bootstrap": "2.0.0-beta.9",
"ngx-chips": "1.5.3",
+ "ngx-infinite-scroll": "^0.7.0",
+ "ngx-pipes": "^2.0.5",
"node-sass": "^4.1.1",
"normalize.css": "^7.0.0",
"optimize-js-plugin": "0.0.4",
@@ -86,6 +87,7 @@
"sass-resources-loader": "^1.2.1",
"script-ext-html-webpack-plugin": "^1.3.2",
"source-map-loader": "^0.2.1",
+ "source-sans-pro": "^2.0.10",
"standard": "^10.0.0",
"string-replace-loader": "^1.0.3",
"style-loader": "^0.19.0",
diff --git a/client/src/app/+admin/admin.component.html b/client/src/app/+admin/admin.component.html
new file mode 100644
index 000000000..0bf4c8aac
--- /dev/null
+++ b/client/src/app/+admin/admin.component.html
@@ -0,0 +1,27 @@
+
diff --git a/client/src/app/+admin/admin.component.scss b/client/src/app/+admin/admin.component.scss
new file mode 100644
index 000000000..e69de29bb
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts
index ecd62ee61..75cd50cc7 100644
--- a/client/src/app/+admin/admin.component.ts
+++ b/client/src/app/+admin/admin.component.ts
@@ -1,7 +1,31 @@
import { Component } from '@angular/core'
+import { UserRight } from '../../../../shared'
+import { AuthService } from '../core/auth/auth.service'
@Component({
- template: ' '
+ templateUrl: './admin.component.html',
+ styleUrls: [ './admin.component.scss' ]
})
export class AdminComponent {
+ constructor (private auth: AuthService) {}
+
+ hasUsersRight () {
+ return this.auth.getUser().hasRight(UserRight.MANAGE_USERS)
+ }
+
+ hasServerFollowRight () {
+ return this.auth.getUser().hasRight(UserRight.MANAGE_SERVER_FOLLOW)
+ }
+
+ hasVideoAbusesRight () {
+ return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
+ }
+
+ hasVideoBlacklistRight () {
+ return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
+ }
+
+ hasJobsRight () {
+ return this.auth.getUser().hasRight(UserRight.MANAGE_JOBS)
+ }
}
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.html b/client/src/app/+admin/follows/followers-list/followers-list.component.html
index 473801822..a24039fc6 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.html
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.html
@@ -1,16 +1,10 @@
-
-
-
Followers list
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.scss b/client/src/app/+admin/follows/followers-list/followers-list.component.scss
index 0a0f621c6..e69de29bb 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.scss
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.scss
@@ -1,3 +0,0 @@
-.btn {
- margin-top: 10px;
-}
diff --git a/client/src/app/+admin/follows/following-add/following-add.component.html b/client/src/app/+admin/follows/following-add/following-add.component.html
index 8e7dddc11..25bab9d0d 100644
--- a/client/src/app/+admin/follows/following-add/following-add.component.html
+++ b/client/src/app/+admin/follows/following-add/following-add.component.html
@@ -1,35 +1,22 @@
-
-
+
{{ error }}
-
Add following
+
+
+
+ It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers.
+
+
+
+
diff --git a/client/src/app/+admin/follows/following-add/following-add.component.scss b/client/src/app/+admin/follows/following-add/following-add.component.scss
index 5fde51636..2cb3efe28 100644
--- a/client/src/app/+admin/follows/following-add/following-add.component.scss
+++ b/client/src/app/+admin/follows/following-add/following-add.component.scss
@@ -1,7 +1,9 @@
-table {
- margin-bottom: 40px;
+textarea {
+ height: 250px;
}
-.input-group-btn button {
- width: 35px;
+input[type=submit] {
+ @include peertube-button;
+ @include orange-button;
}
+
diff --git a/client/src/app/+admin/follows/following-add/following-add.component.ts b/client/src/app/+admin/follows/following-add/following-add.component.ts
index 814c6f1a1..bf842129d 100644
--- a/client/src/app/+admin/follows/following-add/following-add.component.ts
+++ b/client/src/app/+admin/follows/following-add/following-add.component.ts
@@ -1,9 +1,6 @@
-import { Component, OnInit } from '@angular/core'
-import { FormControl, FormGroup } from '@angular/forms'
+import { Component } from '@angular/core'
import { Router } from '@angular/router'
-
import { NotificationsService } from 'angular2-notifications'
-
import { ConfirmService } from '../../../core'
import { validateHost } from '../../../shared'
import { FollowService } from '../shared'
@@ -13,9 +10,9 @@ import { FollowService } from '../shared'
templateUrl: './following-add.component.html',
styleUrls: [ './following-add.component.scss' ]
})
-export class FollowingAddComponent implements OnInit {
- form: FormGroup
- hosts: string[] = [ ]
+export class FollowingAddComponent {
+ hostsString = ''
+ hostsError: string = null
error: string = null
constructor (
@@ -25,76 +22,50 @@ export class FollowingAddComponent implements OnInit {
private followService: FollowService
) {}
- ngOnInit () {
- this.form = new FormGroup({})
- this.addField()
- }
-
- addField () {
- this.form.addControl(`host-${this.hosts.length}`, new FormControl('', [ validateHost ]))
- this.hosts.push('')
- }
-
- canMakeFriends () {
+ httpEnabled () {
return window.location.protocol === 'https:'
}
- customTrackBy (index: number, obj: any): any {
- return index
- }
+ onHostsChanged () {
+ this.hostsError = null
- displayAddField (index: number) {
- return index === (this.hosts.length - 1)
- }
+ const newHostsErrors = []
+ const hosts = this.getNotEmptyHosts()
- displayRemoveField (index: number) {
- return (index !== 0 || this.hosts.length > 1) && index !== (this.hosts.length - 1)
- }
-
- isFormValid () {
- // Do not check the last input
- for (let i = 0; i < this.hosts.length - 1; i++) {
- if (!this.form.controls[`host-${i}`].valid) return false
+ for (const host of hosts) {
+ if (validateHost(host) === false) {
+ newHostsErrors.push(`${host} is not valid`)
+ }
}
- const lastIndex = this.hosts.length - 1
- // If the last input (which is not the first) is empty, it's ok
- if (this.hosts[lastIndex] === '' && lastIndex !== 0) {
- return true
- } else {
- return this.form.controls[`host-${lastIndex}`].valid
+ if (newHostsErrors.length !== 0) {
+ this.hostsError = newHostsErrors.join('. ')
}
}
- removeField (index: number) {
- // Remove the last control
- this.form.removeControl(`host-${this.hosts.length - 1}`)
- this.hosts.splice(index, 1)
- }
-
addFollowing () {
this.error = ''
- const notEmptyHosts = this.getNotEmptyHosts()
- if (notEmptyHosts.length === 0) {
- this.error = 'You need to specify at least 1 host.'
- return
+ const hosts = this.getNotEmptyHosts()
+ if (hosts.length === 0) {
+ this.error = 'You need to specify hosts to follow.'
}
- if (!this.isHostsUnique(notEmptyHosts)) {
+ if (!this.isHostsUnique(hosts)) {
this.error = 'Hosts need to be unique.'
return
}
- const confirmMessage = 'Are you sure to make friends with:
- ' + notEmptyHosts.join('
- ')
+ const confirmMessage = 'If you confirm, you will send a follow request to:
- ' + hosts.join('
- ')
this.confirmService.confirm(confirmMessage, 'Follow new server(s)').subscribe(
res => {
if (res === false) return
- this.followService.follow(notEmptyHosts).subscribe(
+ this.followService.follow(hosts).subscribe(
status => {
this.notificationsService.success('Success', 'Follow request(s) sent!')
- this.router.navigate([ '/admin/follows/following-list' ])
+
+ setTimeout(() => this.router.navigate([ '/admin/follows/following-list' ]), 500)
},
err => this.notificationsService.error('Error', err.message)
@@ -103,18 +74,15 @@ export class FollowingAddComponent implements OnInit {
)
}
- private getNotEmptyHosts () {
- const notEmptyHosts = []
-
- Object.keys(this.form.value).forEach((hostKey) => {
- const host = this.form.value[hostKey]
- if (host !== '') notEmptyHosts.push(host)
- })
-
- return notEmptyHosts
- }
-
private isHostsUnique (hosts: string[]) {
return hosts.every(host => hosts.indexOf(host) === hosts.lastIndexOf(host))
}
+
+ private getNotEmptyHosts () {
+ const hosts = this.hostsString
+ .split('\n')
+ .filter(host => host && host.length !== 0) // Eject empty hosts
+
+ return hosts
+ }
}
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html
index a73084312..2b6cc9113 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.html
+++ b/client/src/app/+admin/follows/following-list/following-list.component.html
@@ -1,20 +1,14 @@
-
-
-
Following list
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/client/src/app/+admin/follows/follows.component.html b/client/src/app/+admin/follows/follows.component.html
index b67bc9736..1baba5a4d 100644
--- a/client/src/app/+admin/follows/follows.component.html
+++ b/client/src/app/+admin/follows/follows.component.html
@@ -1,4 +1,6 @@
-