Merge "Move change id and status to left side of ChangeScreen2"

This commit is contained in:
Shawn Pearce
2014-01-03 22:49:16 +00:00
committed by Gerrit Code Review
3 changed files with 8 additions and 37 deletions

View File

@@ -81,7 +81,6 @@ import com.google.gwt.user.client.ui.ToggleButton;
import com.google.gwtexpui.globalkey.client.GlobalKey;
import com.google.gwtexpui.globalkey.client.KeyCommand;
import com.google.gwtexpui.globalkey.client.KeyCommandSet;
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
import com.google.gwtorm.client.KeyUtil;
import java.sql.Timestamp;
@@ -133,7 +132,6 @@ public class ChangeScreen2 extends Screen {
@UiField HTMLPanel headerLine;
@UiField Style style;
@UiField Element commitSubjectText;
@UiField ToggleButton star;
@UiField Anchor permalink;
@@ -773,7 +771,6 @@ public class ChangeScreen2 extends Screen {
statusText.setInnerText(Util.toLongString(info.status()));
}
renderCommitSubject(info);
renderOwner(info);
renderActionTextDate(info);
renderDiffBaseListBox(info);
@@ -823,13 +820,6 @@ public class ChangeScreen2 extends Screen {
setWindowTitle(sb.toString());
}
private void renderCommitSubject(ChangeInfo info) {
RevisionInfo rev = info.revision(revision);
String sub = rev.commit().subject();
commitSubjectText.setInnerSafeHtml(commentLinkProcessor.apply(
new SafeHtmlBuilder().append(sub).linkify()));
}
private void renderOwner(ChangeInfo info) {
// TODO info card hover
String name = info.owner().name() != null

View File

@@ -47,7 +47,6 @@ limitations under the License.
background-color: trimColor;
color: textColor;
font-family: sans-serif;
font-weight: bold;
}
.subjectText {
width: 460px;
@@ -99,10 +98,6 @@ limitations under the License.
outline: none;
}
.changeId {
display: block;
position: absolute;
top: 0;
left: 22px;
width: 300px;
white-space: nowrap;
line-height: HEADER_HEIGHT;
@@ -198,11 +193,6 @@ limitations under the License.
.commitColumn { width: COMMIT_WIDTH; }
.relatedColumn { width: 375px; }
.commitSubjectText {
font-family: monospace;
white-space: pre;
}
.labels {
border-spacing: 0;
padding: 0;
@@ -317,7 +307,13 @@ limitations under the License.
<g:HTMLPanel styleName='{style.cs2}'>
<g:HTMLPanel styleName='{style.headerLine}' ui:field='headerLine'>
<div class='{style.subjectLine}'>
<div class='{style.subjectText}' ui:field='commitSubjectText'/>
<div class='{style.idAndStatus}'>
<span class='{style.changeId}'>
<ui:msg>Change <g:Anchor ui:field='permalink' title='Reload the change (Shortcut: R)'>
<ui:attribute name='title'/>
</g:Anchor> - <span ui:field='statusText' class='{style.statusText}'/></ui:msg>
</span>
</div>
<div class='{style.subjectButtons} {style.headerButtons}'>
<g:Button ui:field='editMessage'
styleName=''
@@ -343,13 +339,6 @@ limitations under the License.
<ui:attribute name='title'/>
</c:QuickApprove>
</div>
<div class='{style.idAndStatus}'>
<span class='{style.changeId}'>
<ui:msg>Change <g:Anchor ui:field='permalink' title='Reload the change (Shortcut: R)'>
<ui:attribute name='title'/>
</g:Anchor> - <span ui:field='statusText' class='{style.statusText}'/></ui:msg>
</span>
</div>
</div>
<div class='{style.statusRight}'>

View File

@@ -90,14 +90,6 @@ class CommitBox extends Composite {
String revision) {
RevisionInfo revInfo = change.revision(revision);
CommitInfo commit = revInfo.commit();
String sub = commit.subject();
String msg = commit.message();
if (msg.startsWith(sub)) {
msg = msg.substring(sub.length());
if (msg.length() > 0 && msg.charAt(0) == '\n') {
msg = msg.substring(1);
}
}
commitName.setText(revision);
idText.setText("Change-Id: " + change.change_id());
@@ -107,7 +99,7 @@ class CommitBox extends Composite {
formatLink(commit.committer(), committerNameEmail,
committerDate, change.status());
text.setHTML(commentLinkProcessor.apply(
new SafeHtmlBuilder().append(msg).linkify()));
new SafeHtmlBuilder().append(commit.message()).linkify()));
GitwebLink gw = Gerrit.getGitwebLink();
if (gw != null && gw.canLink(revInfo)) {