git ssb

30+

cel / git-ssb-web



Commit 04e0ffb74aac37debb378531b7616145dc5f220c

add section styling, some alignment stuff

mix irving committed on 10/8/2016, 11:40:31 AM
Parent: f46fe361bf5c8e1220f51ca7e56b81a5bf8e9aa7

Files changed

lib/repos/index.jschanged
static/styles.csschanged
lib/repos/index.jsView
@@ -40,10 +40,11 @@
4040 pull.once('<table' + (props ? ' ' + props : '') + '>'),
4141 pull(
4242 read,
4343 pull.map(function (row) {
44- return row ? '<tr>' + row.map(function (cell) {
45- return '<td>' + cell + '</td>'
44 + return row ? '<tr>' + row.map(function (cell, i) {
45 + var className = (i > 0) ? 'w-100' : ''
46 + return '<td class="' + className + '">' + cell + '</td>'
4647 }).join('') + '</tr>' : ''
4748 })
4849 ),
4950 pull.once('</table>')
@@ -184,9 +185,9 @@
184185 pull.once(
185186 '<div class="repo-title">' +
186187 html`
187188 <form class="right-bar" action="" method="post">
188- <button class="btn" name="action" value="vote"
189 + <button class="btn" name="action" value="vote"
189190 ${isPublic ? 'disabled="disabled"' : 'type="submit"'}
190191 >
191192 <i>✌</i>
192193 ${req._t(!isPublic && upvoted ? 'Undig' : 'Dig')}
@@ -197,13 +198,13 @@
197198 <input type="hidden" name="value" value=${upvoted ? '0' : '1'} />
198199 <input type="hidden" name="id" value=${u.escape(repo.id)} />
199200 </div>
200201 `
201- }
202 + }
202203 <strong>
203204 <a href=${u.encodeLink(digsPath)}>${votes.upvotes}</a>
204205 </strong>
205- ${isPublic ? ''
206 + ${isPublic ? ''
206207 : html`
207208 <button class="btn" type="submit" name="action" value="fork-prompt">
208209 <i>⑂</i>
209210 ${req._t('Fork')}
@@ -276,16 +277,16 @@
276277 var title = (path.length ? path.join('/') + ' · ' : '') +
277278 '%{author}/%{repo}' +
278279 (repo.head == 'refs/heads/' + rev ? '' : '@' + rev)
279280 return this.renderRepoPage(req, repo, 'code', rev, title, cat([
280- pull.once('<section><form action="" method="get">' +
281 + pull.once('<section class="branch-info light-grey"><form action="" method="get">' +
281282 '<h3>' + req._t(type) + ': ' + rev + ' '),
282283 this.revMenu(req, repo, rev),
283284 pull.once('</h3></form>'),
284285 type == 'Branch' && renderRepoLatest(req, repo, rev),
285286 pull.once('</section>'),
286287 rev ? cat([
287- pull.once('<section>'),
288 + pull.once('<section class="files">'),
288289 renderRepoTree(req, repo, rev, path),
289290 pull.once('</section>'),
290291 this.renderRepoReadme(req, repo, rev, path)
291292 ]) : this.serveEmptyRepo(req, repo)
@@ -455,10 +456,10 @@
455456 if (err) return cb(err)
456457 var commitPath = [repo.id, 'commit', commit.id]
457458 cb(null,
458459 req._t('Latest') + ': ' +
459- '<strong>' + u.link(commitPath, commit.title) + '</strong><br/>' +
460- '<tt>' + commit.id + '</tt><br/> ' +
460 + '<strong>' + u.link(commitPath, commit.title) + '</strong>' +
461 + '<tt class="ml2">' + commit.id + '</tt><br/> ' +
461462 req._t('CommittedOn', {
462463 name: u.escape(commit.committer.name),
463464 date: commit.committer.date.toLocaleString(req._locale)
464465 }) +
@@ -522,10 +523,9 @@
522523 '<p>' + req._t('NoReadme') + '</p>'))
523524 repo.getObjectFromAny(file.id, function (err, obj) {
524525 if (err) return cb(err)
525526 cb(null, cat([
526- pull.once('<section><h4><a name="readme">' +
527- u.escape(file.name) + '</a></h4><hr/>'),
527 + pull.once('<section class="readme">'),
528528 self.web.renderObjectData(obj, file.name, repo, branch, path),
529529 pull.once('</section>')
530530 ]))
531531 })
static/styles.cssView
@@ -67,14 +67,11 @@
6767 border-radius: 1em;
6868 }
6969
7070 .profile-icon {
71- height: 1.5em;
72- width: 1.5em;
73- margin-right: .2em;
74- margin-left: .15em;
75- margin-top: .4em;
76- margin-bottom: .5em;
71 + height: 1.6em;
72 + width: 1.6em;
73 + margin: .4em 0 .5em .15em;
7774 border: 1px solid #eee;
7875 float: left;
7976 }
8077
@@ -91,8 +88,16 @@
9188 border-radius: 0;
9289 border-bottom: 1px solid #eee;
9390 }
9491
92 +section.branch-info, section.files {
93 + border: none;
94 +}
95 +
96 +section.readme {
97 + margin-top: 2em;
98 +}
99 +
95100 section.collapse {
96101 margin-bottom: 0;
97102 }
98103
@@ -152,10 +157,10 @@
152157 float: right;
153158 display: inline-block;
154159 }
155160
156-.repo-title .right-bar {
157- margin-top: .25em;
161 +.right-bar .btn {
162 + margin-top: 0.2em;
158163 }
159164
160165 input { border: 1px solid #eee;}
161166
@@ -246,8 +251,12 @@
246251 }
247252
248253 /* files list */
249254
255 +table.files {
256 + border: 1px #dedede solid;
257 +}
258 +
250259 .files td:first-child {
251260 padding: 0 1ex;
252261 }
253262
@@ -475,4 +484,11 @@
475484
476485 .date { font-size: .8em; color: #666;}
477486
478487 .dib { display: inline-block; }
488 +
489 +.w-100 { width: 100%; }
490 +
491 +.ml2 { margin-left: 2rem; }
492 +
493 +.light-grey { color: #909090; }
494 +

Built with git-ssb-web