lib/repos/index.jsView |
---|
256 | 256 … | } |
257 | 257 … | |
258 | 258 … | R.serveEmptyRepo = function (req, repo) { |
259 | 259 … | if (repo.feed != this.web.myId) |
260 | | - return this.renderRepoPage(req, repo, 'code', null, null, pull.once( |
261 | | - '<section>' + |
262 | | - '<h3>' + req._t('EmptyRepo') + '</h3>' + |
263 | | - '</section>')) |
| 260 … | + return this.renderRepoPage(req, repo, 'code', null, null, |
| 261 … | + h('section', [ |
| 262 … | + h('h3', req._t('EmptyRepo')) |
| 263 … | + ]) |
| 264 … | + ) |
264 | 265 … | |
265 | 266 … | var gitUrl = 'ssb://' + repo.id |
266 | | - return this.renderRepoPage(req, repo, 'code', null, null, pull.once( |
267 | | - '<section>' + |
268 | | - '<h3>' + req._t('initRepo.GettingStarted') + '</h3>' + |
269 | | - '<h4>' + req._t('initRepo.CreateNew') + '</h4><pre>' + |
270 | | - 'touch ' + req._t('initRepo.README') + '.md\n' + |
271 | | - 'git init\n' + |
272 | | - 'git add ' + req._t('initRepo.README') + '.md\n' + |
273 | | - 'git commit -m "' + req._t('initRepo.InitialCommit') + '"\n' + |
274 | | - 'git remote add origin ' + gitUrl + '\n' + |
275 | | - 'git push -u origin master</pre>\n' + |
276 | | - '<h4>' + req._t('initRepo.PushExisting') + '</h4>\n' + |
277 | | - '<pre>git remote add origin ' + gitUrl + '\n' + |
278 | | - 'git push -u origin master</pre>' + |
279 | | - '</section>')) |
| 267 … | + return this.renderRepoPage(req, repo, 'code', null, null, |
| 268 … | + h('section', [ |
| 269 … | + h('h3', req._t('initRepo.GettingStarted')), |
| 270 … | + h('h4', req._t('initRepo.CreateNew')), |
| 271 … | + preInitRepo(req, gitUrl), |
| 272 … | + h('h4', req._t('initRepo.PushExisting')), |
|
| 273 … | + preRemote(gitUrl) |
| 274 … | + ]) |
| 275 … | + ) |
280 | 276 … | } |
| 277 … | +var preInitRepo = (req, gitUrl) => h('pre', |
| 278 … | +`touch ${req._t('initRepo.README')}.md |
| 279 … | +git init |
| 280 … | +git add ${req._t('initRepo.README')}.md |
| 281 … | +git commit -m ${req._t('initRepo.InitialCommit')} |
| 282 … | +git remote add origin ${gitUrl} |
| 283 … | +git push -u origin master`) |
281 | 284 … | |
| 285 … | +var preRemote = (gitUrl) => h('pre', |
| 286 … | +`git remote add origin ${gitUrl} |
| 287 … | +git push -u origin master`) |
| 288 … | + |
| 289 … | + |
282 | 290 … | R.serveRepoTree = function (req, repo, rev, path) { |
283 | 291 … | var type = repo.isCommitHash(rev) ? 'Tree' : 'Branch' |
284 | 292 … | var title = (path.length ? path.join('/') + ' · ' : '') + |
285 | 293 … | '%{author}/%{repo}' + |