Commit cf2e841e49a18c0ef5554cdfafffe5c63efe1959
Use template strings for CLI instructions
cel committed on 11/9/2016, 11:40:57 PMParent: fc8a95ff43100771f202cc297beadee2bf48a96d
Files changed
lib/repos/index.js | changed |
lib/repos/pulls.js | changed |
lib/repos/index.js | |||
---|---|---|---|
@@ -262,22 +262,23 @@ | |||
262 | 262 … | '<h3>' + req._t('EmptyRepo') + '</h3>' + | |
263 | 263 … | '</section>') | |
264 | 264 … | ||
265 | 265 … | 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>`) | ||
280 | 281 … | } | |
281 | 282 … | ||
282 | 283 … | R.serveRepoTree = function (req, repo, rev, path) { | |
283 | 284 … | var type = repo.isCommitHash(rev) ? 'Tree' : 'Branch' |
lib/repos/pulls.js | ||
---|---|---|
@@ -176,28 +176,25 @@ | ||
176 | 176 … | return self.repo.issues.renderIssueActivityMsg(req, repo, pr, |
177 | 177 … | req._t('pull request'), postId, item) |
178 | 178 … | }) |
179 | 179 … | ), |
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>`), | |
200 | 197 … | !self.web.isPublic && u.readOnce(function (cb) { |
201 | 198 … | cb(null, forms.issueComment(req, pr, repo, newestMsg.key, |
202 | 199 … | req._t('pull request'))) |
203 | 200 … | }) |
Built with git-ssb-web