\r
def writeStyle() {\r
builder.style(type:"text/css", '''\r
- th, td { \r
- padding: 2px; \r
- }\r
- thead {\r
- text-align: left;\r
- font-weight: bold; \r
- }\r
- thead tr {\r
- border-bottom: 1px dotted #000; \r
- }\r
a {\r
text-decoration: none;\r
}\r
- .commits-table {\r
- border-collapse: collapse;\r
- font-family: sans-serif; \r
- width: 100%; \r
- }\r
- .label-commit {\r
- border-radius:4px;\r
- background-color: #3A87AD;\r
- padding: 2px 4px;\r
- color: white;\r
- vertical-align: baseline; \r
- font-weight: bold; \r
- font-family: monospace; \r
- }\r
- .label-add {\r
- border-radius:4px;\r
- background-color: green;\r
- padding: 2px 4px;\r
- color: white;\r
- vertical-align: baseline; \r
- font-weight: bold; \r
- font-family: monospace; \r
- }\r
- .label-delete {\r
- border-radius:4px;\r
- background-color: grey;\r
- padding: 2px 4px;\r
- color: white;\r
- vertical-align: baseline; \r
- font-weight: bold; \r
- font-family: monospace; \r
- }\r
- .label-rename {\r
- border-radius:4px;\r
- background-color: blue;\r
- padding: 2px 4px;\r
- color: white;\r
- vertical-align: baseline; \r
- font-weight: bold; \r
- font-family: monospace; \r
- }\r
- .label-modify {\r
- border-radius:4px;\r
- background-color: orange;\r
- padding: 2px 4px;\r
- color: white;\r
- vertical-align: baseline; \r
- font-weight: bold; \r
- font-family: monospace; \r
- }\r
- .label-copy {\r
- border-radius:4px;\r
- background-color: teal;\r
- padding: 2px 4px;\r
- color: white;\r
- vertical-align: baseline; \r
- font-weight: bold; \r
- font-family: monospace; \r
+ .table td {\r
+ vertical-align: middle;\r
}\r
.gravatar-column {\r
width: 5%; \r
}\r
.author-column {\r
- width: 10%; \r
+ width: 20%; \r
}\r
.commit-column {\r
width: 5%; \r
}\r
.status-column {\r
width: 10%;\r
- padding-bottom: 5px; \r
- padding-top: 5px; \r
}\r
+.table-disable-hover.table tbody tr:hover td,\r
+.table-disable-hover.table tbody tr:hover th {\r
+ background-color: inherit;\r
+}\r
+.table-disable-hover.table-striped tbody tr:nth-child(odd):hover td,\r
+.table-disable-hover.table-striped tbody tr:nth-child(odd):hover th {\r
+ background-color: #f9f9f9;\r
+}\r
''')\r
}\r
\r
\r
def writeCommitTable(commits) {\r
// Write commits table\r
- builder.table('class':"commits-table") {\r
+ builder.table('class':"table table-disable-hover") {\r
thead {\r
tr {\r
th(colspan:2, "Author")\r
\r
// Write detail on that particular commit\r
tr {\r
- td (colspan:3)\r
- td { writeStatusTable(commit) }\r
+ td (colspan:2)\r
+ td (colspan:2) { writeStatusTable(commit) }\r
}\r
}\r
}\r
def message = commit.shortMessage\r
builder.tr {\r
td('class':"gravatar-column") {\r
- img(src:gravatarUrl(email))\r
+ img(src:gravatarUrl(email), 'class':"img-rounded")\r
}\r
- td('class':"author-column") { p(author) }\r
+ td('class':"author-column", author)\r
td('class':"commit-column") {\r
a(href:commitUrl(commit)) {\r
- span('class':"label-commit", abbreviated )\r
+ span('class':"label label-info", abbreviated )\r
}\r
}\r
td {\r
}\r
\r
def writeStatusLabel(style, label) {\r
- builder.span('class' : style, label )\r
+ builder.span('class' : "label " + style, label )\r
}\r
\r
def writeAddStatusLine(ObjectId id, FileHeader header) {\r
builder.td('class':"status-column") {\r
- a(href:blobDiffUrl(id, header.newPath)) { writeStatusLabel("label-add", "add") }\r
+ a(href:blobDiffUrl(id, header.newPath)) { writeStatusLabel("label-success", "add") }\r
}\r
builder.td {\r
span(style:'font-family: monospace;', header.newPath)\r
\r
def writeCopyStatusLine(ObjectId id, FileHeader header) {\r
builder.td('class':"status-column") {\r
- a(href:blobDiffUrl(id, header.newPath)) { writeStatusLabel("label-copy", "copy") }\r
+ a(href:blobDiffUrl(id, header.newPath)) { writeStatusLabel("label-warning", "copy") }\r
}\r
builder.td() {\r
span(style : "font-family: monospace; ", header.oldPath + " copied to " + header.newPath)\r
\r
def writeDeleteStatusLine(ObjectId id, FileHeader header) {\r
builder.td('class':"status-column") {\r
- a(href:blobDiffUrl(id, header.oldPath)) { writeStatusLabel("label-delete", "delete") }\r
+ a(href:blobDiffUrl(id, header.oldPath)) { writeStatusLabel("label-important", "delete") }\r
}\r
builder.td() {\r
span(style : "font-family: monospace; ", header.oldPath)\r
\r
def writeModifyStatusLine(ObjectId id, FileHeader header) {\r
builder.td('class':"status-column") {\r
- a(href:blobDiffUrl(id, header.oldPath)) { writeStatusLabel("label-modify", "modify") }\r
+ a(href:blobDiffUrl(id, header.oldPath)) { writeStatusLabel("", "modify") }\r
}\r
builder.td() {\r
span(style : "font-family: monospace; ", header.oldPath)\r
\r
def writeRenameStatusLine(ObjectId id, FileHeader header) {\r
builder.td('class':"status-column") {\r
- a(href:blobDiffUrl(id, header.newPath)) { writeStatusLabel("label-rename", "rename") }\r
+ a(href:blobDiffUrl(id, header.newPath)) { writeStatusLabel("label-info", "rename") }\r
}\r
builder.td() {\r
span(style : "font-family: monospace; ", header.olPath + " -> " + header.newPath)\r
new CanonicalTreeParser(null, rw.objectReader, commit.tree))\r
}\r
// Write status table\r
- builder.table('class':"commits-table") {\r
+ builder.table('class':"table table-condensed table-bordered table-disable-hover") {\r
tbody() {\r
for (DiffEntry entry in diffs) {\r
FileHeader header = formatter.toFileHeader(entry)\r
\r
writeNavbar()\r
\r
+ div('class':"container") {\r
+\r
for (command in commands) {\r
def ref = command.refName\r
def refType = 'Branch'\r
break\r
}\r
}\r
+ }\r
}\r
}\r
writer.toString()\r