| | |
| | | import org.wicketstuff.googlecharts.IChartData;
|
| | |
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.Constants.AccessPermission;
|
| | | import com.gitblit.Constants.FederationPullStatus;
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.Keys;
|
| | |
| | | setCssClass(container, css);
|
| | | }
|
| | | }
|
| | | |
| | | public static void setPermissionClass(Component container, AccessPermission permission) {
|
| | | if (permission == null) {
|
| | | setCssClass(container, "badge");
|
| | | return;
|
| | | }
|
| | | switch (permission) {
|
| | | case REWIND:
|
| | | case DELETE:
|
| | | case CREATE:
|
| | | setCssClass(container, "badge badge-success");
|
| | | break;
|
| | | case PUSH:
|
| | | setCssClass(container, "badge badge-info");
|
| | | break;
|
| | | case CLONE:
|
| | | setCssClass(container, "badge badge-inverse");
|
| | | break;
|
| | | default:
|
| | | setCssClass(container, "badge");
|
| | | break;
|
| | | } |
| | | }
|
| | |
|
| | | public static void setAlternatingBackground(Component c, int i) {
|
| | | String clazz = i % 2 == 0 ? "light" : "dark";
|
| | |
| | | || filename.endsWith(".xlsx")) {
|
| | | return newImage(wicketId, "file_excel_16x16.png");
|
| | | } else if (filename.endsWith(".doc") || filename.endsWith(".docx")) {
|
| | | return newImage(wicketId, "file_word_16x16.png");
|
| | | return newImage(wicketId, "file_doc_16x16.png");
|
| | | } else if (filename.endsWith(".ppt")) {
|
| | | return newImage(wicketId, "file_ppt_16x16.png");
|
| | | } else if (filename.endsWith(".zip")) {
|
| | |
| | | return new PageParameters("r=" + repositoryName + ",h=" + objectId);
|
| | | }
|
| | |
|
| | | public static PageParameters newRangeParameter(String repositoryName, String startRange, String endRange) {
|
| | | return new PageParameters("r=" + repositoryName + ",h=" + startRange + ".." + endRange);
|
| | | }
|
| | |
|
| | | public static PageParameters newPathParameter(String repositoryName, String objectId,
|
| | | String path) {
|
| | | if (StringUtils.isEmpty(path)) {
|
| | |
| | | }
|
| | |
|
| | | public static int getDaysBack(PageParameters params) {
|
| | | return params.getInt("db", 14);
|
| | | return params.getInt("db", 7);
|
| | | }
|
| | |
|
| | | public static String getUsername(PageParameters params) {
|
| | |
| | | dateString = df.format(date);
|
| | | }
|
| | | String title = null;
|
| | | if (TimeUtils.isToday(date)) {
|
| | | if (TimeUtils.isToday(date, timeZone)) {
|
| | | title = timeUtils.today();
|
| | | } else if (TimeUtils.isYesterday(date)) {
|
| | | } else if (TimeUtils.isYesterday(date, timeZone)) {
|
| | | title = timeUtils.yesterday();
|
| | | } else if (date.getTime() <= System.currentTimeMillis()) {
|
| | | // past
|