8000 Merge pull request #68 from dongweiming/v1 · lcppcl/code@42ad89b · GitHub
[go: up one dir, main page]

Skip to content

Commit 42ad89b

Browse files
committed
Merge pull request douban#68 from dongweiming/v1
CODE is coming
2 parents 44ad53d + 11032ba commit 42ad89b

File tree

1,175 files changed

+130630
-7470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,175 files changed

+130630
-7470
lines changed

AUTHORS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* hongqn - pullrequest & code review
2+
* qingfeng - 其他 转换框架到quixote
3+
* mengwei - 前期构建
4+
* fengji - 前期构建
5+
* libohan - Hooks & API
6+
* zhangchi - Notifications
7+
* xingben - 各种提醒,UI的精简,向github致敬
8+
* lijunpeng - trello卡片墙

Gruntfile.js

Lines changed: 380 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,380 @@
1+
module.exports = function(grunt) {
2+
grunt.initConfig({
3+
meta: {
4+
src: 'hub/static/',
5+
dest: 'dist/',
6+
appOzConfig: {
7+
baseUrl: '<%= meta.src %>js/',
8+
distUrl: '<%= meta.dest %>js/',
9+
disableAutoSuffix: true,
10+
ignore: [ 'jquery', 'jquery-tmpl', 'mustache', 'bootbox', 'bootstrap',
11+
'spin', 'jquery-timeago', 'jquery-forms', 'jquery-atwho',
12+
'jquery-caret', 'jquery-zclip', 'jquery-lazyload', 'jquery-unobstrusive',
13+
'jquery-tooltipster']
14+
}
15+
},
16+
ozma: {
17+
common: {
18+
src: 'hub/static/js/mod/common.js',
19+
config: {
20+
baseUrl: '<%= meta.src %>js/',
21+
distUrl: '<%= meta.dest %>js/',
22+
loader: 'lib/oz.js',
23+
disableAutoSuffix: true
24+
}
25+
},
26+
raven: {
27+
src: 'hub/static/js/mod/raven.js',
28+
config: {
29+
baseUrl: '<%= meta.src %>js/',
30+
distUrl: '<%= meta.dest %>js/',
31+
loader: 'lib/oz.js',
32+
disableAutoSuffix: true
33+
}
34+
},
35+
badge: {
36+
src: 'hub/static/js/app/badge/main.js',
37+
config: '<%= meta.appOzConfig %>'
38+
},
39+
create: {
40+
src: 'hub/static/js/app/create/main.js',
41+
config: '<%= meta.appOzConfig %>'
42+
},
43+
explore: {
44+
src: 'hub/static/js/app/explore/main.js',
45+
config: '<%= meta.appOzConfig %>',
46+
},
47+
public_timeline: {
48+
src: 'hub/static/js/app/explore/public_timeline.js',
49+
config: '<%= meta.appOzConfig %>',
50+
},
51+
notify_timeline: {
52+
src: 'hub/static/js/app/explore/notify_timeline.js',
53+
config: '<%= meta.appOzConfig %>',
54+
},
55+
gist: {
56+
src: 'hub/static/js/app/gist/gist.js',
57+
config: '<%= meta.appOzConfig %>'
58+
},
59+
gist_edit: {
60+
src: 'hub/static/js/app/gist/edit.js',
61+
config: '<%= meta.appOzConfig %>'
62+
},
63+
gist_main: {
64+
src: 'hub/static/js/app/gist/main.js',
65+
config: '<%= meta.appOzConfig %>'
66+
},
67+
graph: {
68+
src: 'hub/static/js/app/graph/main.js',
69+
config: '<%= meta.appOzConfig %>'
70+
},
71+
home: {
72+
src: 'hub/static/js/app/home/main.js',
73+
config: '<%= meta.appOzConfig %>'
74+
},
75+
settings: {
76+
src: 'hub/static/js/app/home/settings.js',
77+
config: '<%= meta.appOzConfig %>'
78+
},
79+
userfeed_timeline: {
80+
src: 'hub/static/js/app/home/userfeed_timeline.js',
81+
config: '<%= meta.appOzConfig %>'
82+
},
83+
hook: {
84+
src: 'hub/static/js/app/hook/main.js',
85+
config: '<%= meta.appOzConfig %>'
86+
},
87+
people: {
88+
src: 'hub/static/js/app/people/main.js',
89+
config: '<%= meta.appOzConfig %>'
90+
},
91+
praise: {
92+
src: 'hub/static/js/app/praise/main.js',
93+
config: '<%= meta.appOzConfig %>'
94+
},
95+
pull: {
96+
src: 'hub/static/js/app/pull/main.js',
97+
config: '<%= meta.appOzConfig %>'
98+
},
99+
pull_new: {
100+
src: 'hub/static/js/app/pull/new.js',
101+
config: '<%= meta.appOzConfig %>'
102+
},
103+
pulls: {
104+
src: 'hub/static/js/app/pull/pulls.js',
105+
config: '<%= meta.appOzConfig %>'
106+
},
107+
src: {
108+
src: 'hub/static/js/app/src/src.js',
109+
config: '<%= meta.appOzConfig %>'
110+
},
111+
commit: {
112+
src: 'hub/static/js/app/src/commit.js',
113+
config: '<%= meta.appOzConfig %>'
114+
},
115+
compare: {
116+
src: 'hub/static/js/app/src/compare.js',
117+
config: '<%= meta.appOzConfig %>'
118+
},
119+
src_edit: {
120+
src: 'hub/static/js/app/src/editor.js',
121+
config: '<%= meta.appOzConfig %>'
122+
},
123+
search: {
124+
src: 'hub/static/js/app/search/search.js',
125+
config: '<%= meta.appOzConfig %>'
126+
},
127+
m: {
128+
src: 'hub/static/js/app/m/main.js',
129+
config: '<%= meta.appOzConfig %>'
130+
},
131+
team: {
132+
src: 'hub/static/js/app/team/main.js',
133+
config: '<%= meta.appOzConfig %>'
134+
},
135+
team_group: {
136+
src: 'hub/static/js/app/team/group.js',
137+
config: '<%= meta.appOzConfig %>'
138+
},
139+
team_settings: {
140+
src: 'hub/static/js/app/team/settings.js',
141+
config: '<%= meta.appOzConfig %>'
142+
},
143+
team_add_project: {
144+
src: 'hub/static/js/app/team/add_project.js',
145+
config: '<%= meta.appOzConfig %>'
146+
},
147+
teamfeed_timeline: {
148+
src: 'hub/static/js/app/team/teamfeed_timeline.js',
149+
config: '<%= meta.appOzConfig %>'
150+
},
151+
issue: {
152+
src: 'hub/static/js/app/issue/main.js',
153+
config: '<%= meta.appOzConfig %>'
154+
},
155+
issue_new: {
156+
src: 'hub/static/js/app/issue/new.js',
157+
config: '<%= meta.appOzConfig %>'
158+
},
159+
issues: {
160+
src: 'hub/static/js/app/issue/issues.js',
161+
config: '<%= meta.appOzConfig %>'
162+
},
163+
team_issue: {
164+
src: 'hub/static/js/app/issue/team-issue.js',
165+
config: '<%= meta.appOzConfig %>'
166+
},
167+
notification: {
168+
src: 'hub/static/js/app/settings/notification.js',
169+
config: '<%= meta.appOzConfig %>'
170+
},
171+
codereview: {
172+
src: 'hub/static/js/app/settings/codereview.js',
173+
config: '<%= meta.appOzConfig %>'
174+
},
175+
watch: {
176+
src: 'hub/static/js/app/watching/main.js',
177+
config: '<%= meta.appOzConfig %>'
178+
},
179+
chat: {
180+
src: 'hub/static/js/app/chat/main.js',
181+
config: '<%= meta.appOzConfig %>'
182+
},
183+
center: {
184+
src: 'hub/static/js/app/center/main.js',
185+
config: '<%= meta.appOzConfig %>'
186+
},
187+
stat: {
188+
src: 'hub/static/js/app/stat/main.js',
189+
config: '<%= meta.appOzConfig %>'
190+
}
191+
},
192+
copy: {
193+
},
194+
lint: {
195+
files: [ 'hub/static/js/app/**/*.js', 'hub/static/js/mod/**/*.js' ]
196+
},
197+
uglify: {
198+
//options: {
199+
//compress: true,
200+
//mangle: true
201+
//},
202+
dynamic_mappings: {
203+
files: [
204+
{
205+
expand: true,
206+
cwd: '<%= meta.dest %>js/',
207+
src: ['**/?*.js'],
208+
dest: '<%= meta.dest %>js/',
209+
},
210+
],
211+
}
212+
},
213+
clean: [ 'dist/*' ],
214+
watch: {
215+
js: {
216+
files: [ 'hub/static/js/**/*.js' ],
217+
tasks: [ 'ozma' ]
218+
},
219+
scss: {
220+
files: ['hub/static/css/**/*.scss'],
221+
tasks: ['compass:dev']
222+
}
223+
},
224+
compass: {
225+
dev: {
226+
options: {
227+
sassDir: '<%= meta.src %>css',
228+
cssDir: '<%= meta.dest %>css',
229+
noLineComments: false,
230+
force: true,
231+
importPath: '<%= meta.src %>',
232+
outputStyle: 'expanded'
233+
}
234+
},
235+
prod: {
236+
options: {
237+
sassDir: '<%= meta.src %>css',
238+
cssDir: '<%= meta.dest %>css',
239+
noLineComments: true,
240+
force: true,
241+
importPath: '<%= meta.src %>',
242+
outputStyle: 'compressed',
243+
environment: 'production'
244+
}
245+
},
246+
dynamic_mappings: {
247+
files: [
248+
{
249+
expand: true,
250+
cwd: '<%= meta.src %>css/',
251+
src: ['**/?.scss'],
252+
dest: '<%= meta.dest %>css/',
253+
ext: '.css'
254+
}
255+
]
256+
}
257+
},
258+
deploy: {
259+
'static': {
260+
before_deploy: 'build',
261+
submodule_dir: 'dist/',
262+
submodule_commit_comment: 'deploy static files'
263+
}
264+
},
265+
});
266+
267+
grunt.registerTask('default', 'dev');
268+
grunt.registerTask('build', ['clean', 'ozma', 'uglify', 'compass:prod']);
269+
grunt.registerTask('dev', ['clean', 'ozma', 'compass:dev']);
270+
271+
grunt.loadNpmTasks('grunt-contrib-watch');
272+
grunt.loadNpmTasks('grunt-contrib-clean');
273+
grunt.loadNpmTasks('grunt-contrib-copy');
274+
grunt.loadNpmTasks('grunt-contrib-compass');
275+
grunt.loadNpmTasks('grunt-contrib-uglify');
276+
grunt.loadNpmTasks('grunt-ozjs');
277+
278+
grunt.registerMultiTask('deploy', 'Deploy submodule files', function() {
279+
var data = this.data,
280+
beforeCmd = data.before_deploy || '',
281+
afterCmd = data.after_deploy || ',',
282+
submoduleDirPath = data.submodule_dir,
283+
submoduleDir,
284+
comment = data.submodule_commit_comment || 'update';
285+
286+
if (submoduleDir = grunt.file.findup(submoduleDirPath)) {
287+
try {
288+
this.requires(beforeCmd);
289+
var taskDone = this.async();
290+
var oldBase = process.cwd();
291+
grunt.log.ok('Grunt command: ' + beforeCmd + ' ok!');
292+
grunt.file.setBase(submoduleDir);
293+
grunt.util.async.series([
294+
// git add -A
295+
function(done) {
296+
grunt.log.writeln('git add -A');
297+
grunt.util.spawn({
298+
cmd: 'git',
299+
args: [ 'add', '-A' ]
300+
}, function(error, result, code) {
301+
if (code === 0) {
302+
done(null);
303+
} else {
304+
done(error);
305+
}
306+
});
307+
},
308+
// git commit -m
309+
function(done) {
310+
grunt.log.writeln('git commit -m');
311+
grunt.util.spawn({
312+
cmd: 'git',
313+
args: [ 'commit', '-m', comment ]
314+
}, function(error, result, code) {
315+
if (code === 0) {
316+
done(null);
317+
} else {
318+
done(result.stdout);
319+
}
320+
});
321+
},
322+
// git push
323+
function(done) {
324+
grunt.log.writeln('git push');
325+
grunt.util.spawn({
326+
cmd: 'git',
327+
args: [ 'push' ]
328+
}, function(error, result, code) {
329+
if (code === 0) {
330+
done(null);
331+
} else {
332+
done(error);
333+
}
334+
});
335+
},
336+
// git rev-parse HEAD
337+
function(done) {
338+
grunt.util.spawn({
339+
cmd: 'git',
340+
args: [ 'rev-parse', 'HEAD' ]
341+
}, function(error, result, code) {
342+
if (code === 0) {
343+
grunt.log.ok('Static files deployed @version: ' + result.stdout);
344+
done(null);
345+
} else {
346+
done(error);
347+
}
348+
});
349+
},
350+
// return to BASE and add submodule dir
351+
function(done) {
352+
grunt.file.setBase(oldBase);
353+
grunt.log.writeln('git add ' + submoduleDirPath);
354+
grunt.util.spawn({
355+
cmd: 'git',
356+
args: [ 'add', submoduleDirPath ]
357+
}, function(error, result, code) {
358+
if (code === 0) {
359+
grunt.log.ok('Git add submodule: ' + submoduleDirPath);
360+
done(null);
361+
} else {
362+
done(error);
363+
}
364+
});
365+
}
366+
], function(error, result) {
367+
if (error) {
368+
grunt.fail.fatal(error);
369+
grunt.file.setBase(oldBase);
370+
}
371+
taskDone();
372+
});
373+
} catch(ex) {
374+
grunt.task.run([ beforeCmd, this.name + ':' + this.target ]);
375+
}
376+
} else {
377+
grunt.log.error('Submodule directory: ' + submoduleDirPath + ' is not exsit.');
378+
}
379+
});
380+
};

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44

55
from web import app as web
6-
from smart_httpd import app as git_http
6+
from app_sina import app as git_http
77

88

99
ROUTE_MAP = [(re.compile(r'/[^/]*\.git.*'), git_http),

0 commit comments

Comments
 (0)
0