git ssb

30+

cel / git-ssb-web



Commit cf2e841e49a18c0ef5554cdfafffe5c63efe1959

Use template strings for CLI instructions

cel committed on 11/9/2016, 11:40:57 PM
Parent: fc8a95ff43100771f202cc297beadee2bf48a96d

Files changed

lib/repos/index.jschanged
lib/repos/pulls.jschanged
lib/repos/index.jsView
@@ -262,22 +262,23 @@
262262 '<h3>' + req._t('EmptyRepo') + '</h3>' +
263263 '</section>')
264264
265265 var gitUrl = 'ssb://' + repo.id
266- return 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>'))
266 + return 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
271 +git init
272 +git add ${req._t('initRepo.README')}.md
273 +git commit -m "${req._t('initRepo.InitialCommit')}"
274 +git remote add origin ${gitUrl}
275 +git push -u origin master</pre>
276 + <h4>${req._t('initRepo.PushExisting')}</h4>
277 + <pre>
278 +git remote add origin ${gitUrl}
279 +git push -u origin master</pre>
280 + </section>`)
280281 }
281282
282283 R.serveRepoTree = function (req, repo, rev, path) {
283284 var type = repo.isCommitHash(rev) ? 'Tree' : 'Branch'
lib/repos/pulls.jsView
@@ -176,28 +176,25 @@
176176 return self.repo.issues.renderIssueActivityMsg(req, repo, pr,
177177 req._t('pull request'), postId, item)
178178 })
179179 ),
180- !self.web.isPublic && pr.open && pull.once(
181- '<section class="merge-instructions">' +
182- '<input type="checkbox" class="toggle" id="merge-instructions"/>' +
183- '<h4><label for="merge-instructions" class="toggle-link"><a>' +
184- req._t('mergeInstructions.MergeViaCmdLine') +
185- '</a></label></h4>' +
186- '<div class="contents">' +
187- '<p>' + req._t('mergeInstructions.CheckOut') + '</p>' +
188- '<pre>' +
189- 'git fetch ssb://' + u.escape(pr.headRepo) + ' ' +
190- u.escape(pr.headBranch) + '\n' +
191- 'git checkout -b ' + u.escape(pr.headBranch) + ' FETCH_HEAD' +
192- '</pre>' +
193- '<p>' + req._t('mergeInstructions.MergeAndPush') + '</p>' +
194- '<pre>' +
195- 'git checkout ' + u.escape(pr.baseBranch) + '\n' +
196- 'git merge ' + u.escape(pr.headBranch) + '\n' +
197- 'git push ssb ' + u.escape(pr.baseBranch) +
198- '</pre>' +
199- '</div></section>'),
180 + !self.web.isPublic && pr.open && pull.once(`
181 + <section class="merge-instructions">
182 + <input type="checkbox" class="toggle" id="merge-instructions"/>
183 + <h4><label for="merge-instructions" class="toggle-link"><a>
184 + ${req._t('mergeInstructions.MergeViaCmdLine')}
185 + </a></label></h4>
186 + <div class="contents">
187 + <p>${req._t('mergeInstructions.CheckOut')}</p>
188 + <pre>
189 +git fetch ssb://${u.escape(pr.headRepo)} ${u.escape(pr.headBranch)}
190 +git checkout -b ${u.escape(pr.headBranch)} FETCH_HEAD</pre>
191 + <p>${req._t('mergeInstructions.MergeAndPush')}</p>
192 + <pre>
193 +git checkout ${u.escape(pr.baseBranch)}
194 +git merge ${u.escape(pr.headBranch)}
195 +git push ssb ${u.escape(pr.baseBranch)}</pre>
196 + </div></section>`),
200197 !self.web.isPublic && u.readOnce(function (cb) {
201198 cb(null, forms.issueComment(req, pr, repo, newestMsg.key,
202199 req._t('pull request')))
203200 })

Built with git-ssb-web