Permalink
Browse files

Split messages into title/message so multi-line commits look better

  • Loading branch information...
1 parent 98b5ff6 commit 40708baadcc146c41c9912ddb40b230710a104ee @kballard kballard committed Mar 22, 2008
Showing with 40 additions and 14 deletions.
  1. +18 −1 CommitsController.rb
  2. +2 −2 GitNub.xcodeproj/project.pbxproj
  3. +6 −6 commit.html
  4. +14 −5 style.css
View
@@ -110,7 +110,14 @@ def select_latest_commit
def update_main_document
diffs = []
doc = @commit_details.mainFrame.DOMDocument
- set_html("message", active_commit.message.gsub("\n", "<br />"))
+ title, message = active_commit.message.split("\n", 2)
+ set_html("title", title.strip.gsub("\n", "<br />"))
+ if message
+ set_html("message", message.strip.gsub("\n", "<br />"))
+ show_element("message")
+ else
+ hide_element("message")
+ end
set_html("hash", active_commit.id)
if Time.now.day == active_commit.authored_date.day
@@ -217,4 +224,14 @@ def setup_commit_detail_view
def set_html(element, html)
@commit_details.mainFrame.DOMDocument.getElementById(element).setInnerHTML(html)
end
+
+ def show_element(element)
+ element = @commit_details.mainFrame.DOMDocument.getElementById(element)
+ element.style.removeProperty("display")
+ end
+
+ def hide_element(element)
+ element = @commit_details.mainFrame.DOMDocument.getElementById(element)
+ element.style.setProperty_value_priority("display", "none", nil)
+ end
end
@@ -232,7 +232,7 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
- buildConfigurationList = 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "GitNub" */;
+ buildConfigurationList = 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "gitnub" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 0;
mainGroup = 29B97314FDCFA39411CA2CEA /* GitNub */;
@@ -367,7 +367,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "GitNub" */ = {
+ 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "gitnub" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4D7A7B580ABF745500C2D4C0 /* Debug */,
View
@@ -10,12 +10,12 @@
<body>
<div id="content">
- <h1 id="commit">
- <span id="message"></span>
- <span id="hash"></span>
- </h1>
- <h2 id="date"></h2>
-
+ <div id="metadata">
+ <h1 id="title"></h1>
+ <div id="message"></div>
+ <div id="hash"></div>
+ <h2 id="date"></h2>
+ </div>
<div id="main">
<ul id="files">
View
@@ -66,20 +66,28 @@ table {
/* @end */
/* @group details */
+#metadata {
+ padding: 9px;
+ margin: 0 9px;
+}
+
h1 {
- border-bottom: 1px solid #eee;
+ margin: 9px 0;
font-size: 150%;
- padding: 9px;
- margin: 9px;
line-height: 130%;
color: #222;
}
+#message {
+ margin-top: 1em;
+ margin-bottom: 9px;
+}
+
#hash {
- font-size: 62%;
+ font-size: 93%;
color: #888;
font-weight: normal;
- display: block;
+ margin-bottom: 9px;
}
#date {
@@ -90,6 +98,7 @@ h1 {
text-align: center;
padding: 6px;
font-weight: normal;
+ border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
margin: 0 9px;
}

0 comments on commit 40708ba

Please sign in to comment.