Skip to content

Commit 812d1ed

Browse files
committed
Ajout de vidéos #10
- uploads
1 parent 636d5bc commit 812d1ed

File tree

34 files changed

+203
-878
lines changed

34 files changed

+203
-878
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
.idea
2-
.meteor/local
3-
.meteor/meteorite
42
tests/core/__pycache__/
53
tests/worker/__pycache__/
64
scripts/core/__pycache__/

meteor/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.meteor/local
2+
node_modules
3+
.uploads

meteor/.meteor/.finished-upgraders

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ notices-for-facebook-graph-api-2
1010
1.2.0-meteor-platform-split
1111
1.2.0-cordova-changes
1212
1.2.0-breaking-changes
13+
1.3.0-split-minifiers-package

meteor/.meteor/packages

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,31 @@ blaze-html-templates # Compile .html files into Meteor Blaze views
1111
session # Client-side reactive dictionary for your app
1212
jquery # Helpful client-side library
1313
tracker # Meteor's client-side reactive programming library
14-
15-
standard-minifiers # JS/CSS minifiers run for production mode
1614
es5-shim # ECMAScript 5 compatibility for older browsers.
1715
ecmascript # Enable ECMAScript2015+ syntax in app code
1816

19-
meteorhacks:npm
20-
npm-container
21-
2217
accounts-facebook
2318
accounts-google
2419
accounts-password
25-
aldeed:autoform
26-
aldeed:collection2
27-
cfs:autoform
28-
cfs:filesystem
29-
cfs:standard-packages
20+
less
21+
standard-minifier-css
22+
standard-minifier-js
23+
random
24+
reactive-var
25+
26+
aldeed:tabular
3027
chrismbeckett:toastr
3128
fortawesome:fontawesome
3229
ian:accounts-ui-bootstrap-3
3330
iron:router
34-
less
3531
matb33:collection-hooks
3632
meteorhacks:cluster
3733
mrgalaxy:stripe
3834
natestrauser:animate-css
3935
nemo64:bootstrap
4036
ongoworks:security
41-
reactive-var
4237
smaltcreation:alert-i18n
4338
tap:i18n
4439
tomi:upload-server
4540
tomi:upload-jquery
46-
transcode:autoform-files
4741
underscorestring:underscore.string

meteor/.meteor/release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
METEOR@1.2.1
1+
METEOR@1.3.2.4

meteor/.meteor/versions

Lines changed: 93 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,120 @@
1-
2-
3-
4-
5-
6-
7-
8-
aldeed:simple-schema@1.3.3
1+
2+
3+
4+
5+
6+
7+
8+
allow-deny@1.0.4
99
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
3022
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
23+
4124
chrismbeckett:[email protected]_1
42-
43-
44-
45-
46-
47-
48-
49-
50-
51-
52-
53-
54-
55-
56-
57-
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
5840
fortawesome:[email protected]
59-
60-
61-
62-
63-
64-
41+
42+
43+
44+
45+
46+
6547
66-
48+
6749
6850
6951
7052
7153
72-
iron:middleware-stack@1.0.11
54+
iron:middleware-stack@1.1.0
7355
7456
75-
76-
57+
7758
78-
79-
less@2.5.1
80-
81-
82-
59+
60+
less@2.6.0
61+
62+
63+
8364
84-
85-
meteor-base@1.0.1
86-
meteorhacks:async@1.0.0
65+
66+
meteor@1.1.14
67+
meteor-base@1.0.4
8768
meteorhacks:[email protected]
88-
meteorhacks:[email protected]
8969
meteorspark:[email protected]
90-
91-
92-
93-
94-
95-
96-
97-
70+
71+
72+
73+
74+
75+
76+
77+
78+
9879
9980
natestrauser:[email protected]
10081
10182
102-
103-
104-
105-
106-
107-
83+
84+
85+
86+
87+
10888
109-
110-
promise@0.5.1
89+
90+
promise@0.6.7
11191
112-
113-
114-
115-
116-
117-
118-
119-
120-
121-
122-
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
123102
smaltcreation:[email protected]
124-
smaltcreation:imagesloaded@4.1.0
125-
126-
spacebars-compiler@1.0.7
127-
srp@1.0.4
128-
standard-minifiers@1.0.2
129-
103+
spacebars@1.0.11
104+
spacebars-compiler@1.0.11
105+
srp@1.0.8
106+
standard-minifier-css@1.0.6
107+
standard-minifier-js@1.0.6
108+
130109
131-
132-
110+
111+
133112
134113
135-
136-
137-
138-
114+
115+
116+
139117
underscorestring:[email protected]
140-
141-
142-
118+
119+
120+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template name="profileFileActions">
2+
<button class="btn btn-xs btn-primary convert">Convert</button>
3+
</template>

meteor/client/pages/profile/profile.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ <h2>
1111
<div class="container">
1212
<div class="row">
1313
<div id="videos" class="col-sm-8">
14-
{{#autoForm collection="Collection.Tasks" id="insert-task-form" type="insert"}}
15-
{{> afQuickField name='file'}}
16-
<button type="submit" class="btn btn-primary">Submit file</button>
17-
{{/autoForm}}
14+
{{> upload_bootstrap}}
15+
{{> tabular table=TabularTables.Files class="table table-striped table-bordered table-condensed"}}
1816
</div>
1917
<div id="offer" class="col-sm-4">
2018
{{> offer offerOptions}}

meteor/lib/collections/collections.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
Collection = {
22
Tasks: new Mongo.Collection('tasks'),
3+
Files: new Mongo.Collection('files'),
34
Charges: new Meteor.Collection('charges')
45
};
5-
6-
Files = new FS.Collection("files", {
7-
stores: [new FS.Store.FileSystem("files"/*, {path: Meteor.settings.data}*/)]
8-
});
9-
10-
Collection.Tasks.attachSchema(new SimpleSchema({
11-
file: {
12-
type: String,
13-
autoform: {
14-
type: 'smalt-file',
15-
collection: Files,
16-
automaticUpload: true,
17-
automaticRemove: true,
18-
multiple: false,
19-
subscription: 'schema.task.file',
20-
accept: 'video/*,audio/*'
21-
}
22-
},
23-
createdBy: {
24-
type: String
25-
}
26-
}));

meteor/lib/routes/file.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import fs from 'fs';
2+
3+
if (Meteor.isServer) {
4+
const fail = response => {
5+
response.statusCode = 404;
6+
response.end('<h1>404 - File not found</h1>');
7+
};
8+
9+
const dataFile = function() {
10+
const file = `${Meteor.settings.data}/${this.params.name}`;
11+
12+
let stat = null;
13+
try {
14+
stat = fs.statSync(file);
15+
} catch (error) {
16+
return fail(this.response);
17+
}
18+
19+
this.response.writeHead(200, {
20+
'Content-Type': stat.type,
21+
'Content-Disposition': `attachment; filename=${this.params.name}`,
22+
'Content-Length': stat.size
23+
});
24+
25+
fs.createReadStream(file).pipe(this.response);
26+
};
27+
28+
Router.route('/file/:name', dataFile, {where: 'server'});
29+
}

0 commit comments

Comments
 (0)