commit | author | age
|
f13c4c
|
1 |
/*
|
JM |
2 |
* Copyright 2011 gitblit.com.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
c1c3c6
|
16 |
package com.gitblit.wicket.panels;
|
JM |
17 |
|
|
18 |
import org.apache.wicket.markup.html.basic.Label;
|
|
19 |
import org.eclipse.jgit.revwalk.RevCommit;
|
|
20 |
|
baa7fd
|
21 |
import com.gitblit.Constants;
|
JM |
22 |
import com.gitblit.utils.StringUtils;
|
c1c3c6
|
23 |
import com.gitblit.wicket.WicketUtils;
|
JM |
24 |
import com.gitblit.wicket.pages.CommitPage;
|
|
25 |
|
|
26 |
public class CommitHeaderPanel extends BasePanel {
|
|
27 |
|
|
28 |
private static final long serialVersionUID = 1L;
|
|
29 |
|
4ab184
|
30 |
public CommitHeaderPanel(String id, String title) {
|
JM |
31 |
super(id);
|
|
32 |
add(new Label("shortmessage", title));
|
|
33 |
add(new Label("commitid"));
|
|
34 |
add(new Label("author"));
|
|
35 |
add(new Label("date"));
|
|
36 |
}
|
008322
|
37 |
|
c1c3c6
|
38 |
public CommitHeaderPanel(String id, String repositoryName, RevCommit c) {
|
JM |
39 |
super(id);
|
baa7fd
|
40 |
add(new LinkPanel("shortmessage", "title", StringUtils.trimString(c.getShortMessage(),
|
JM |
41 |
Constants.LEN_SHORTLOG), CommitPage.class,
|
2a7306
|
42 |
WicketUtils.newObjectParameter(repositoryName, c.getName())));
|
62cec2
|
43 |
add(new Label("commitid", c.getName()));
|
bc9d4a
|
44 |
add(new Label("author", c.getAuthorIdent().getName()));
|
9adf62
|
45 |
add(WicketUtils.createDateLabel("date", c.getAuthorIdent().getWhen(), getTimeZone(), getTimeUtils()));
|
62cec2
|
46 |
add(new GravatarImage("authorAvatar", c.getAuthorIdent()));
|
c1c3c6
|
47 |
}
|
JM |
48 |
} |