aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-07 11:33:59 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-07 11:33:59 +0100
commitb9a3e09ad5a7673f64556d1dba122ed4c4fac980 (patch)
tree66d4928b82af19a2372a2505822233884f3fd471
parentb2ff5e3e686eb552c5ccd64ce67b0455972ceef0 (diff)
downloadPeerTube-b9a3e09ad5a7673f64556d1dba122ed4c4fac980.tar.gz
PeerTube-b9a3e09ad5a7673f64556d1dba122ed4c4fac980.tar.zst
PeerTube-b9a3e09ad5a7673f64556d1dba122ed4c4fac980.zip
Prepare folders structure for angular app
-rw-r--r--Gruntfile.js4
-rw-r--r--client/app/images/favicon.png (renamed from public/images/favicon.png)bin2335 -> 2335 bytes
-rw-r--r--client/app/images/loading.gif (renamed from public/images/loading.gif)bin673 -> 673 bytes
-rw-r--r--client/app/javascripts/index.js (renamed from public/javascripts/index.js)0
-rw-r--r--client/app/stylesheets/application.scss (renamed from public/stylesheets/application.scss)0
-rw-r--r--client/app/stylesheets/base.scss (renamed from public/stylesheets/base.scss)0
-rw-r--r--client/app/stylesheets/bootstrap-variables.scss (renamed from public/stylesheets/bootstrap-variables.scss)0
-rw-r--r--client/app/stylesheets/index.scss (renamed from public/stylesheets/index.scss)0
-rw-r--r--server.js28
-rw-r--r--server/controllers/api/v1/index.js (renamed from controllers/api/v1/index.js)0
-rw-r--r--server/controllers/api/v1/pods.js (renamed from controllers/api/v1/pods.js)0
-rw-r--r--server/controllers/api/v1/remoteVideos.js (renamed from controllers/api/v1/remoteVideos.js)0
-rw-r--r--server/controllers/api/v1/videos.js (renamed from controllers/api/v1/videos.js)0
-rw-r--r--server/controllers/index.js (renamed from controllers/index.js)0
-rw-r--r--server/controllers/views.js (renamed from controllers/views.js)0
-rw-r--r--server/helpers/customValidators.js (renamed from helpers/customValidators.js)0
-rw-r--r--server/helpers/logger.js (renamed from helpers/logger.js)0
-rw-r--r--server/helpers/peertubeCrypto.js (renamed from helpers/peertubeCrypto.js)0
-rw-r--r--server/helpers/requests.js (renamed from helpers/requests.js)0
-rw-r--r--server/helpers/utils.js (renamed from helpers/utils.js)0
-rw-r--r--server/initializers/checker.js (renamed from initializers/checker.js)0
-rw-r--r--server/initializers/constants.js (renamed from initializers/constants.js)0
-rw-r--r--server/initializers/database.js (renamed from initializers/database.js)0
-rw-r--r--server/lib/friends.js (renamed from lib/friends.js)0
-rw-r--r--server/lib/poolRequests.js (renamed from lib/poolRequests.js)0
-rw-r--r--server/lib/videos.js (renamed from lib/videos.js)0
-rw-r--r--server/lib/webtorrent.js (renamed from lib/webtorrent.js)0
-rw-r--r--server/lib/webtorrentProcess.js (renamed from lib/webtorrentProcess.js)0
-rw-r--r--server/middlewares/cache.js (renamed from middlewares/cache.js)0
-rw-r--r--server/middlewares/index.js (renamed from middlewares/index.js)0
-rw-r--r--server/middlewares/reqValidators/index.js (renamed from middlewares/reqValidators/index.js)0
-rw-r--r--server/middlewares/reqValidators/pods.js (renamed from middlewares/reqValidators/pods.js)0
-rw-r--r--server/middlewares/reqValidators/remote.js (renamed from middlewares/reqValidators/remote.js)0
-rw-r--r--server/middlewares/reqValidators/utils.js (renamed from middlewares/reqValidators/utils.js)0
-rw-r--r--server/middlewares/reqValidators/videos.js (renamed from middlewares/reqValidators/videos.js)0
-rw-r--r--server/middlewares/secure.js (renamed from middlewares/secure.js)0
-rw-r--r--server/models/pods.js (renamed from models/pods.js)0
-rw-r--r--server/models/poolRequests.js (renamed from models/poolRequests.js)0
-rw-r--r--server/models/videos.js (renamed from models/videos.js)0
-rw-r--r--server/tests/api/checkParams.js (renamed from tests/api/checkParams.js)0
-rw-r--r--server/tests/api/fixtures/video_short.mp4 (renamed from tests/api/fixtures/video_short.mp4)bin38783 -> 38783 bytes
-rw-r--r--server/tests/api/fixtures/video_short.ogv (renamed from tests/api/fixtures/video_short.ogv)bin140849 -> 140849 bytes
-rw-r--r--server/tests/api/fixtures/video_short.webm (renamed from tests/api/fixtures/video_short.webm)bin218910 -> 218910 bytes
-rw-r--r--server/tests/api/fixtures/video_short1.webm (renamed from tests/api/fixtures/video_short1.webm)bin572456 -> 572456 bytes
-rw-r--r--server/tests/api/fixtures/video_short2.webm (renamed from tests/api/fixtures/video_short2.webm)bin942961 -> 942961 bytes
-rw-r--r--server/tests/api/fixtures/video_short3.webm (renamed from tests/api/fixtures/video_short3.webm)bin292677 -> 292677 bytes
-rw-r--r--server/tests/api/fixtures/video_short_fake.webm (renamed from tests/api/fixtures/video_short_fake.webm)0
-rw-r--r--server/tests/api/friendsAdvanced.js (renamed from tests/api/friendsAdvanced.js)0
-rw-r--r--server/tests/api/friendsBasic.js (renamed from tests/api/friendsBasic.js)0
-rw-r--r--server/tests/api/index.js (renamed from tests/api/index.js)0
-rw-r--r--server/tests/api/multiplePods.js (renamed from tests/api/multiplePods.js)0
-rw-r--r--server/tests/api/singlePod.js (renamed from tests/api/singlePod.js)0
-rw-r--r--server/tests/api/utils.js (renamed from tests/api/utils.js)0
-rw-r--r--server/tests/index.js (renamed from tests/index.js)0
-rw-r--r--views/error.jade8
-rw-r--r--views/footer.jade3
-rw-r--r--views/header.jade9
-rw-r--r--views/index.jade15
-rw-r--r--views/layout.jade15
-rw-r--r--views/panel.jade17
60 files changed, 13 insertions, 86 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 6df0c023a..5aaa13dff 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,13 +2,11 @@
2 2
3module.exports = function (grunt) { 3module.exports = function (grunt) {
4 var paths = { 4 var paths = {
5 dist: 'dist',
6 jade: 'views/**/**/*.jade',
7 css: 'public/stylesheets/*.css', 5 css: 'public/stylesheets/*.css',
8 scss: 'public/stylesheets/application.scss', 6 scss: 'public/stylesheets/application.scss',
9 vendor: 'public/stylesheets/vendor', 7 vendor: 'public/stylesheets/vendor',
10 js: 'public/javascripts/*.js', 8 js: 'public/javascripts/*.js',
11 routes: 'controllers/**/*.js', 9 routes: './server/controllers/**/*.js',
12 main: './server.js', 10 main: './server.js',
13 browserified: 'public/javascripts/bundle.js', 11 browserified: 'public/javascripts/bundle.js',
14 img: 'public/images/*.{png,jpg,jpeg,gif,webp,svg}', 12 img: 'public/images/*.{png,jpg,jpeg,gif,webp,svg}',
diff --git a/public/images/favicon.png b/client/app/images/favicon.png
index bb57ee6b0..bb57ee6b0 100644
--- a/public/images/favicon.png
+++ b/client/app/images/favicon.png
Binary files differ
diff --git a/public/images/loading.gif b/client/app/images/loading.gif
index f2a1bc0c6..f2a1bc0c6 100644
--- a/public/images/loading.gif
+++ b/client/app/images/loading.gif
Binary files differ
diff --git a/public/javascripts/index.js b/client/app/javascripts/index.js
index 4910e4540..4910e4540 100644
--- a/public/javascripts/index.js
+++ b/client/app/javascripts/index.js
diff --git a/public/stylesheets/application.scss b/client/app/stylesheets/application.scss
index bf9ec90ab..bf9ec90ab 100644
--- a/public/stylesheets/application.scss
+++ b/client/app/stylesheets/application.scss
diff --git a/public/stylesheets/base.scss b/client/app/stylesheets/base.scss
index 37bdade1e..37bdade1e 100644
--- a/public/stylesheets/base.scss
+++ b/client/app/stylesheets/base.scss
diff --git a/public/stylesheets/bootstrap-variables.scss b/client/app/stylesheets/bootstrap-variables.scss
index 5a49649f9..5a49649f9 100644
--- a/public/stylesheets/bootstrap-variables.scss
+++ b/client/app/stylesheets/bootstrap-variables.scss
diff --git a/public/stylesheets/index.scss b/client/app/stylesheets/index.scss
index d13dcfa90..d13dcfa90 100644
--- a/public/stylesheets/index.scss
+++ b/client/app/stylesheets/index.scss
diff --git a/server.js b/server.js
index c971982b3..5f474a196 100644
--- a/server.js
+++ b/server.js
@@ -14,7 +14,7 @@ var WebSocketServer = require('ws').Server
14var app = express() 14var app = express()
15 15
16// ----------- Checker ----------- 16// ----------- Checker -----------
17var checker = require('./initializers/checker') 17var checker = require('./server/initializers/checker')
18 18
19var miss = checker.checkConfig() 19var miss = checker.checkConfig()
20if (miss.length !== 0) { 20if (miss.length !== 0) {
@@ -25,16 +25,16 @@ checker.createDirectoriesIfNotExist()
25 25
26// ----------- PeerTube modules ----------- 26// ----------- PeerTube modules -----------
27var config = require('config') 27var config = require('config')
28var constants = require('./initializers/constants') 28var constants = require('./server/initializers/constants')
29var customValidators = require('./helpers/customValidators') 29var customValidators = require('./server/helpers/customValidators')
30var database = require('./initializers/database') 30var database = require('./server/initializers/database')
31var logger = require('./helpers/logger') 31var logger = require('./server/helpers/logger')
32var peertubeCrypto = require('./helpers/peertubeCrypto') 32var peertubeCrypto = require('./server/helpers/peertubeCrypto')
33var poolRequests = require('./lib/poolRequests') 33var poolRequests = require('./server/lib/poolRequests')
34var routes = require('./controllers') 34var routes = require('./server/controllers')
35var utils = require('./helpers/utils') 35var utils = require('./server/helpers/utils')
36var videos = require('./lib/videos') 36var videos = require('./server/lib/videos')
37var webtorrent = require('./lib/webtorrent') 37var webtorrent = require('./server/lib/webtorrent')
38 38
39// Get configurations 39// Get configurations
40var port = config.get('listen.port') 40var port = config.get('listen.port')
@@ -67,11 +67,7 @@ app.use(require('connect-livereload')({
67require('segfault-handler').registerHandler() 67require('segfault-handler').registerHandler()
68 68
69// Static files 69// Static files
70app.use(express.static(path.join(__dirname, '/public'), { maxAge: 0 })) 70app.use(express.static(path.join(__dirname, '/app'), { maxAge: 0 }))
71
72// Jade template from ./views directory
73app.set('views', path.join(__dirname, '/views'))
74app.set('view engine', 'jade')
75 71
76// API routes 72// API routes
77var api_route = '/api/' + constants.API_VERSION 73var api_route = '/api/' + constants.API_VERSION
diff --git a/controllers/api/v1/index.js b/server/controllers/api/v1/index.js
index 07a68ed9d..07a68ed9d 100644
--- a/controllers/api/v1/index.js
+++ b/server/controllers/api/v1/index.js
diff --git a/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js
index c93a86ee8..c93a86ee8 100644
--- a/controllers/api/v1/pods.js
+++ b/server/controllers/api/v1/pods.js
diff --git a/controllers/api/v1/remoteVideos.js b/server/controllers/api/v1/remoteVideos.js
index 475a874cf..475a874cf 100644
--- a/controllers/api/v1/remoteVideos.js
+++ b/server/controllers/api/v1/remoteVideos.js
diff --git a/controllers/api/v1/videos.js b/server/controllers/api/v1/videos.js
index 620711925..620711925 100644
--- a/controllers/api/v1/videos.js
+++ b/server/controllers/api/v1/videos.js
diff --git a/controllers/index.js b/server/controllers/index.js
index 858f493da..858f493da 100644
--- a/controllers/index.js
+++ b/server/controllers/index.js
diff --git a/controllers/views.js b/server/controllers/views.js
index aa9718079..aa9718079 100644
--- a/controllers/views.js
+++ b/server/controllers/views.js
diff --git a/helpers/customValidators.js b/server/helpers/customValidators.js
index 20c41f5da..20c41f5da 100644
--- a/helpers/customValidators.js
+++ b/server/helpers/customValidators.js
diff --git a/helpers/logger.js b/server/helpers/logger.js
index 67f69a875..67f69a875 100644
--- a/helpers/logger.js
+++ b/server/helpers/logger.js
diff --git a/helpers/peertubeCrypto.js b/server/helpers/peertubeCrypto.js
index 29b9d79c9..29b9d79c9 100644
--- a/helpers/peertubeCrypto.js
+++ b/server/helpers/peertubeCrypto.js
diff --git a/helpers/requests.js b/server/helpers/requests.js
index e19afa5ca..e19afa5ca 100644
--- a/helpers/requests.js
+++ b/server/helpers/requests.js
diff --git a/helpers/utils.js b/server/helpers/utils.js
index d2c9ad8b2..d2c9ad8b2 100644
--- a/helpers/utils.js
+++ b/server/helpers/utils.js
diff --git a/initializers/checker.js b/server/initializers/checker.js
index ec7bc0ad2..ec7bc0ad2 100644
--- a/initializers/checker.js
+++ b/server/initializers/checker.js
diff --git a/initializers/constants.js b/server/initializers/constants.js
index 16e50443b..16e50443b 100644
--- a/initializers/constants.js
+++ b/server/initializers/constants.js
diff --git a/initializers/database.js b/server/initializers/database.js
index a917442ec..a917442ec 100644
--- a/initializers/database.js
+++ b/server/initializers/database.js
diff --git a/lib/friends.js b/server/lib/friends.js
index 006a64404..006a64404 100644
--- a/lib/friends.js
+++ b/server/lib/friends.js
diff --git a/lib/poolRequests.js b/server/lib/poolRequests.js
index f786c3c7a..f786c3c7a 100644
--- a/lib/poolRequests.js
+++ b/server/lib/poolRequests.js
diff --git a/lib/videos.js b/server/lib/videos.js
index 2d7d9500d..2d7d9500d 100644
--- a/lib/videos.js
+++ b/server/lib/videos.js
diff --git a/lib/webtorrent.js b/server/lib/webtorrent.js
index cb641fead..cb641fead 100644
--- a/lib/webtorrent.js
+++ b/server/lib/webtorrent.js
diff --git a/lib/webtorrentProcess.js b/server/lib/webtorrentProcess.js
index 7da52523a..7da52523a 100644
--- a/lib/webtorrentProcess.js
+++ b/server/lib/webtorrentProcess.js
diff --git a/middlewares/cache.js b/server/middlewares/cache.js
index 0d3da0075..0d3da0075 100644
--- a/middlewares/cache.js
+++ b/server/middlewares/cache.js
diff --git a/middlewares/index.js b/server/middlewares/index.js
index c85899b0c..c85899b0c 100644
--- a/middlewares/index.js
+++ b/server/middlewares/index.js
diff --git a/middlewares/reqValidators/index.js b/server/middlewares/reqValidators/index.js
index 345dbd0e2..345dbd0e2 100644
--- a/middlewares/reqValidators/index.js
+++ b/server/middlewares/reqValidators/index.js
diff --git a/middlewares/reqValidators/pods.js b/server/middlewares/reqValidators/pods.js
index ef09d51cf..ef09d51cf 100644
--- a/middlewares/reqValidators/pods.js
+++ b/server/middlewares/reqValidators/pods.js
diff --git a/middlewares/reqValidators/remote.js b/server/middlewares/reqValidators/remote.js
index 88de16b49..88de16b49 100644
--- a/middlewares/reqValidators/remote.js
+++ b/server/middlewares/reqValidators/remote.js
diff --git a/middlewares/reqValidators/utils.js b/server/middlewares/reqValidators/utils.js
index 46c982571..46c982571 100644
--- a/middlewares/reqValidators/utils.js
+++ b/server/middlewares/reqValidators/utils.js
diff --git a/middlewares/reqValidators/videos.js b/server/middlewares/reqValidators/videos.js
index 4e5f4391f..4e5f4391f 100644
--- a/middlewares/reqValidators/videos.js
+++ b/server/middlewares/reqValidators/videos.js
diff --git a/middlewares/secure.js b/server/middlewares/secure.js
index bfd28316a..bfd28316a 100644
--- a/middlewares/secure.js
+++ b/server/middlewares/secure.js
diff --git a/models/pods.js b/server/models/pods.js
index 57ed20292..57ed20292 100644
--- a/models/pods.js
+++ b/server/models/pods.js
diff --git a/models/poolRequests.js b/server/models/poolRequests.js
index 970315597..970315597 100644
--- a/models/poolRequests.js
+++ b/server/models/poolRequests.js
diff --git a/models/videos.js b/server/models/videos.js
index 5e2eeae07..5e2eeae07 100644
--- a/models/videos.js
+++ b/server/models/videos.js
diff --git a/tests/api/checkParams.js b/server/tests/api/checkParams.js
index 1c1ec71b3..1c1ec71b3 100644
--- a/tests/api/checkParams.js
+++ b/server/tests/api/checkParams.js
diff --git a/tests/api/fixtures/video_short.mp4 b/server/tests/api/fixtures/video_short.mp4
index 35678362b..35678362b 100644
--- a/tests/api/fixtures/video_short.mp4
+++ b/server/tests/api/fixtures/video_short.mp4
Binary files differ
diff --git a/tests/api/fixtures/video_short.ogv b/server/tests/api/fixtures/video_short.ogv
index 9e253da82..9e253da82 100644
--- a/tests/api/fixtures/video_short.ogv
+++ b/server/tests/api/fixtures/video_short.ogv
Binary files differ
diff --git a/tests/api/fixtures/video_short.webm b/server/tests/api/fixtures/video_short.webm
index bf4b0ab6c..bf4b0ab6c 100644
--- a/tests/api/fixtures/video_short.webm
+++ b/server/tests/api/fixtures/video_short.webm
Binary files differ
diff --git a/tests/api/fixtures/video_short1.webm b/server/tests/api/fixtures/video_short1.webm
index 70ac0c644..70ac0c644 100644
--- a/tests/api/fixtures/video_short1.webm
+++ b/server/tests/api/fixtures/video_short1.webm
Binary files differ
diff --git a/tests/api/fixtures/video_short2.webm b/server/tests/api/fixtures/video_short2.webm
index 13d72dff7..13d72dff7 100644
--- a/tests/api/fixtures/video_short2.webm
+++ b/server/tests/api/fixtures/video_short2.webm
Binary files differ
diff --git a/tests/api/fixtures/video_short3.webm b/server/tests/api/fixtures/video_short3.webm
index cde5dcd58..cde5dcd58 100644
--- a/tests/api/fixtures/video_short3.webm
+++ b/server/tests/api/fixtures/video_short3.webm
Binary files differ
diff --git a/tests/api/fixtures/video_short_fake.webm b/server/tests/api/fixtures/video_short_fake.webm
index d85290ae5..d85290ae5 100644
--- a/tests/api/fixtures/video_short_fake.webm
+++ b/server/tests/api/fixtures/video_short_fake.webm
diff --git a/tests/api/friendsAdvanced.js b/server/tests/api/friendsAdvanced.js
index 9838d890f..9838d890f 100644
--- a/tests/api/friendsAdvanced.js
+++ b/server/tests/api/friendsAdvanced.js
diff --git a/tests/api/friendsBasic.js b/server/tests/api/friendsBasic.js
index 328724936..328724936 100644
--- a/tests/api/friendsBasic.js
+++ b/server/tests/api/friendsBasic.js
diff --git a/tests/api/index.js b/server/tests/api/index.js
index 9c4fdd48a..9c4fdd48a 100644
--- a/tests/api/index.js
+++ b/server/tests/api/index.js
diff --git a/tests/api/multiplePods.js b/server/tests/api/multiplePods.js
index 9fdd0f308..9fdd0f308 100644
--- a/tests/api/multiplePods.js
+++ b/server/tests/api/multiplePods.js
diff --git a/tests/api/singlePod.js b/server/tests/api/singlePod.js
index 3dd72c01b..3dd72c01b 100644
--- a/tests/api/singlePod.js
+++ b/server/tests/api/singlePod.js
diff --git a/tests/api/utils.js b/server/tests/api/utils.js
index 47b706294..47b706294 100644
--- a/tests/api/utils.js
+++ b/server/tests/api/utils.js
diff --git a/tests/index.js b/server/tests/index.js
index ccebbfe51..ccebbfe51 100644
--- a/tests/index.js
+++ b/server/tests/index.js
diff --git a/views/error.jade b/views/error.jade
deleted file mode 100644
index d9e8a7893..000000000
--- a/views/error.jade
+++ /dev/null
@@ -1,8 +0,0 @@
1extends layout
2
3block content
4 h1= message
5 if error
6 h2= error.status
7 pre #{error.stack}
8
diff --git a/views/footer.jade b/views/footer.jade
deleted file mode 100644
index c7754f584..000000000
--- a/views/footer.jade
+++ /dev/null
@@ -1,3 +0,0 @@
1footer
2
3 | PeerTube, CopyLeft 2015
diff --git a/views/header.jade b/views/header.jade
deleted file mode 100644
index 6b84333f9..000000000
--- a/views/header.jade
+++ /dev/null
@@ -1,9 +0,0 @@
1.navbar.navbar-default
2 .container-fluid
3 .navbar-header
4 a.navbar-brand(href='/') PeerTube
5 .navbar-header
6 form.navbar-form(role='search')
7 .form-group.search-group
8 input.form-control#search-video(type='text' name='search_video' placeholder='Search a video...')
9 a.search-btn.btn.btn-link.glyphicon.glyphicon-search(type='submit') \ No newline at end of file
diff --git a/views/index.jade b/views/index.jade
deleted file mode 100644
index a49758fc0..000000000
--- a/views/index.jade
+++ /dev/null
@@ -1,15 +0,0 @@
1extends layout
2
3block content
4 div(class='container')
5 div(class='row')
6 include panel
7
8 div(id='ajax_load' class='col-md-9')
9
10
11 include footer
12
13 // build:js /javascripts/global.min.js
14 script(src='/javascripts/bundle.js')
15 // endbuild
diff --git a/views/layout.jade b/views/layout.jade
deleted file mode 100644
index 43c28cd4f..000000000
--- a/views/layout.jade
+++ /dev/null
@@ -1,15 +0,0 @@
1doctype html
2html
3 head
4 link(rel='icon' type='image/png' href='/images/favicon.png')
5 meta(name='viewport' content='width=device-width, initial-scale=1')
6 title= title
7
8 // build:css /stylesheets/global.min.css
9 each file in [ 'global' ]
10 link(rel='stylesheet', href='/stylesheets/' + file + '.css')
11 // endbuild
12
13 body
14 include header
15 block content
diff --git a/views/panel.jade b/views/panel.jade
deleted file mode 100644
index 0d124fb7e..000000000
--- a/views/panel.jade
+++ /dev/null
@@ -1,17 +0,0 @@
1menu(class='col-md-2')
2
3 div(id='panel_get_videos' class='panel_button')
4 span(class='glyphicon glyphicon-list')
5 | Get videos
6
7 div(id='panel_upload_video' class='panel_button')
8 span(class='glyphicon glyphicon-cloud-upload')
9 | Upload a video
10
11 div(id='panel_make_friends' class='panel_button')
12 span(class='glyphicon glyphicon-user')
13 | Make friends
14
15 div(id='panel_quit_friends' class='panel_button')
16 span(class='glyphicon glyphicon-plane')
17 | Quit friends