git-ssb-web
Advanced tools
Comparing version 1.17.0 to 1.17.1
19
index.js
@@ -296,15 +296,2 @@ var fs = require('fs') | ||
case 'issue-title': | ||
if (!data.id) | ||
return cb(null, self.serveError(req, | ||
new ParamError(req._t('error.MissingId')), 400)) | ||
if (!data.name) | ||
return cb(null, self.serveError(req, | ||
new ParamError(req._t('error.MissingName')), 400)) | ||
var msg = Issues.schemas.edit(data.id, {title: data.name}) | ||
return self.ssb.publish(msg, function (err) { | ||
if (err) return cb(null, self.serveError(req, err)) | ||
cb(null, self.serveRedirect(req, req.url)) | ||
}) | ||
case 'comment': | ||
@@ -330,3 +317,3 @@ if (!data.id) | ||
case 'new-issue': | ||
var msg = Issues.schemas.new(dir, data.title, data.text) | ||
var msg = Issues.schemas.new(dir, data.text) | ||
var mentions = Mentions(data.text) | ||
@@ -342,3 +329,3 @@ if (mentions.length) | ||
var msg = PullRequests.schemas.new(dir, data.branch, | ||
data.head_repo, data.head_branch, data.title, data.text) | ||
data.head_repo, data.head_branch, data.text) | ||
var mentions = Mentions(data.text) | ||
@@ -626,3 +613,3 @@ if (mentions.length) | ||
case 'pull-request': | ||
var issueLink = u.link([msg.key], c.title) | ||
var issueLink = u.link([msg.key], u.messageTitle(msg)) | ||
return self.getMsg(c.project, function (err, projectMsg) { | ||
@@ -629,0 +616,0 @@ if (err) return cb(null, |
@@ -13,2 +13,3 @@ /* ssb-about | ||
var asyncMemo = require('asyncmemo') | ||
var u = require('./util') | ||
@@ -33,7 +34,2 @@ module.exports = function (sbot, id) { | ||
function truncate(str, len) { | ||
str = String(str) | ||
return str.length < len ? str : str.substr(0, len-1) + '…' | ||
} | ||
// Get About info (name and icon) for a feed. | ||
@@ -83,3 +79,3 @@ function getAboutFull(sbot, source, dest, cb) { | ||
if (err && err !== true) return cb(err) | ||
if (!info.name) info.name = truncate(target, 20) | ||
if (!info.name) info.name = u.truncate(target, 20) | ||
cb(null, info) | ||
@@ -86,0 +82,0 @@ }) |
@@ -92,5 +92,3 @@ var pull = require('pull-stream') | ||
'<input type="hidden" name="action" value="new-issue">' + | ||
'<p><input class="wide-input" name="title" placeholder="' + | ||
req._t('issue.Title') + '" size="77" /></p>' + | ||
forms.post(req, repo, req._t('Description'), 8) + | ||
forms.post(req, repo, null, 8) + | ||
'<button type="submit" class="btn">' + req._t('Create') + '</button>' + | ||
@@ -110,5 +108,3 @@ '</form></section>')) | ||
pull.once( | ||
forms.name(req, !self.web.isPublic, issue.id, issue.title, | ||
'issue-title', null, req._t('issue.Rename'), | ||
'<h3>' + u.link([issue.id], issue.title) + '</h3>') + | ||
'<h3>' + u.link([issue.id], issue.title) + '</h3>' + | ||
'<code>' + issue.id + '</code>' + | ||
@@ -196,3 +192,3 @@ '<section class="collapse">' + | ||
type: type, | ||
post: u.link([msg.key], String(c.title || msg.key).substr(0, 140)) | ||
post: u.link([msg.key], u.messageTitle(msg)) | ||
}) + '</section>' | ||
@@ -202,2 +198,3 @@ case 'issue-edit': | ||
(msg.key == postId ? '<div class="highlight">' : '') + | ||
// handle deprecated rename | ||
(c.title == null ? '' : req._t('issue.Renamed', { | ||
@@ -204,0 +201,0 @@ author: authorLink, |
@@ -32,5 +32,3 @@ var pull = require('pull-stream') | ||
pull.once('<div class="pull-request">' + | ||
forms.name(req, !self.web.isPublic, pr.id, pr.title, | ||
'issue-title', null, req._t('pullRequest.Rename'), | ||
'<h3>' + u.link([pr.id], pr.title) + '</h3>') + | ||
'<h3>' + u.link([pr.id], pr.title) + '</h3>' + | ||
'<code>' + pr.id + '</code>'), | ||
@@ -97,7 +95,12 @@ u.readOnce(function (cb) { | ||
if (err) return cb(null, self.web.renderError(err)) | ||
cb(null, cat([ | ||
pull.once('<section>'), | ||
self.renderCommitLog(req, baseRepo, revs.base, headRepo, revs.head), | ||
pull.once('</section>') | ||
])) | ||
GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head, | ||
function (err, mergeBase) { | ||
if (err) return cb(null, self.web.renderError(err)) | ||
cb(null, cat([ | ||
pull.once('<section>'), | ||
self.renderCommitLog(req, baseRepo, mergeBase, headRepo, revs.head), | ||
pull.once('</section>') | ||
])) | ||
} | ||
) | ||
}) | ||
@@ -110,8 +113,13 @@ } | ||
if (err) return cb(null, self.web.renderError(err)) | ||
cb(null, cat([ | ||
pull.once('<section>'), | ||
self.repo.renderDiffStat(req, | ||
[baseRepo, headRepo], [revs.base, revs.head]), | ||
pull.once('</section>') | ||
])) | ||
GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head, | ||
function (err, mergeBase) { | ||
if (err) return cb(null, self.web.renderError(err)) | ||
cb(null, cat([ | ||
pull.once('<section>'), | ||
self.repo.renderDiffStat(req, | ||
[baseRepo, headRepo], [mergeBase, revs.head]), | ||
pull.once('</section>') | ||
])) | ||
} | ||
) | ||
}) | ||
@@ -378,5 +386,3 @@ } | ||
}) + | ||
'<input class="wide-input" name="title"' + | ||
' placeholder="' + req._t('Title') + '" size="77"/>' + | ||
forms.post(req, repo, req._t('Description'), 8) + | ||
forms.post(req, repo, null, 8) + | ||
'<button type="submit" class="btn open">' + | ||
@@ -446,3 +452,4 @@ req._t('Create') + '</button>' + | ||
'<td>' + u.escape(commit.author.name) + '</td>' + | ||
'<td>' + u.link(commitPath, commit.title) + '</td>' + | ||
'<td class="commit-title">' + | ||
u.link(commitPath, commit.title) + '</td>' + | ||
'<td>' + u.link(commitPath, commitIdShort, true) + '</td>' + | ||
@@ -449,0 +456,0 @@ '</tr>' |
@@ -152,1 +152,11 @@ var pull = require('pull-stream') | ||
} | ||
u.truncate = function (str, len) { | ||
str = String(str) | ||
return str.length < len ? str : str.substr(0, len) + '…' | ||
} | ||
u.messageTitle = function (msg) { | ||
var c = msg.value.content | ||
return u.truncate(c.title || c.text || msg.key, 40) | ||
} |
@@ -119,5 +119,2 @@ { | ||
"New": "New Issue", | ||
"Title": "Issue Title", | ||
"Description": "Description", | ||
"Rename": "Rename the issue", | ||
"Opened": "%{name} opened this issue on %{datetime}", | ||
@@ -134,3 +131,2 @@ "Reopened": "%{name} reopened this %{type}", | ||
"pullRequest": { | ||
"Rename": "Rename the pull request", | ||
"WantToMerge": "%{name} wants to merge commits into %{base} from %{head}", | ||
@@ -137,0 +133,0 @@ "Discussion": "Discussion", |
@@ -119,5 +119,2 @@ { | ||
"New": "Nova Temo", | ||
"Title": "Temo titolo", | ||
"Description": "Priskribo", | ||
"Rename": "Renomiĝi la temon", | ||
"Opened": "%{name} malfermis tiun temon je %{datetime}", | ||
@@ -134,3 +131,2 @@ "Reopened": "%{name} remalfermis tiun %{type}", | ||
"pullRequest": { | ||
"Rename": "Alinomigado el tiro-petojn", | ||
"WantToMerge": "%{name} volas kunfandi enmetoj en %{base} de %{head}", | ||
@@ -137,0 +133,0 @@ "Discussion": "Priparolado", |
{ | ||
"name": "git-ssb-web", | ||
"version": "1.17.0", | ||
"version": "1.17.1", | ||
"description": "web server for browsing git repos on ssb", | ||
@@ -23,3 +23,3 @@ "bin": "server.js", | ||
"ssb-git-repo": "^1.8.0", | ||
"ssb-issues": "^0.1.4", | ||
"ssb-issues": "^0.2.0", | ||
"ssb-keys": "^5.0.0", | ||
@@ -29,3 +29,3 @@ "ssb-marked": "^0.6.0", | ||
"ssb-msg-schemas": "^6.1.0", | ||
"ssb-pull-requests": "^0.0.4", | ||
"ssb-pull-requests": "^0.1.1", | ||
"ssb-reconnect": "^0.1.0", | ||
@@ -32,0 +32,0 @@ "ssb-ref": "^2.2.2", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
285149
3776
+ Addedssb-pull-requests@0.1.3(transitive)
- Removedssb-issues@0.1.4(transitive)
- Removedssb-pull-requests@0.0.4(transitive)
Updatedssb-issues@^0.2.0
Updatedssb-pull-requests@^0.1.1