diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/info/project-info.css b/server-core/src/main/java/io/onedev/server/web/component/project/info/project-info.css index e3e954aa06..87cba20950 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/project/info/project-info.css +++ b/server-core/src/main/java/io/onedev/server/web/component/project/info/project-info.css @@ -1,3 +1,4 @@ .project-info { min-width: 360px; + max-width: 600px; } diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.html index 6234745927..1d5cd39de0 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.html +++ b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.html @@ -45,6 +45,7 @@ +
diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java index be1baaa7ba..9d58a37c9a 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java +++ b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java @@ -92,6 +92,8 @@ @SuppressWarnings("serial") public class ProjectListPanel extends Panel { + private static final int MAX_DESCRIPTION_LEN = 120; + private final IModel queryStringModel; private final int expectedCount; @@ -1086,24 +1088,29 @@ protected void doBeforeNav(AjaxRequestTarget target) { fragment.add(projectLink); fragment.add(new EntityLabelsPanel<>("labels", rowModel)); + if (project.getDescription() != null) { + fragment.add(new Label("description", StringUtils.abbreviate(project.getDescription(), MAX_DESCRIPTION_LEN))); + } else { + fragment.add(new WebMarkupContainer("description").setVisible(false)); + } if (!project.isPendingDelete() && project.getActiveServer(false) != null) { if (project.isCodeManagement() && SecurityUtils.canReadCode(project)) { fragment.add(new CodeStatsPanel("codeStats", rowModel)); - fragment.add(new PullRequestStatsPanel("pullRequestStats", rowModel, - new LoadableDetachableModel>() { - - @Override - protected Map load() { - Map statusCounts = new LinkedHashMap<>(); - for (ProjectPullRequestStatusStat stats: pullRequestStatsModel.getObject()) { - if (stats.getProjectId().equals(projectId)) - statusCounts.put(stats.getPullRequestStatus(), stats.getStatusCount()); - } - return statusCounts; - } - - })); + fragment.add(new PullRequestStatsPanel("pullRequestStats", rowModel, + new LoadableDetachableModel<>() { + + @Override + protected Map load() { + Map statusCounts = new LinkedHashMap<>(); + for (ProjectPullRequestStatusStat stats : pullRequestStatsModel.getObject()) { + if (stats.getProjectId().equals(projectId)) + statusCounts.put(stats.getPullRequestStatus(), stats.getStatusCount()); + } + return statusCounts; + } + + })); } else { fragment.add(new WebMarkupContainer("codeStats").setVisible(false)); fragment.add(new WebMarkupContainer("pullRequestStats").setVisible(false)); diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/list/project-list.css b/server-core/src/main/java/io/onedev/server/web/component/project/list/project-list.css index 8a9b1a3c10..809dae7603 100644 --- a/server-core/src/main/java/io/onedev/server/web/component/project/list/project-list.css +++ b/server-core/src/main/java/io/onedev/server/web/component/project/list/project-list.css @@ -4,6 +4,9 @@ .project-list .row-selector { padding-top: 16px; } +.project-list .description { + text-overflow: ellipsis; +} .project-list .project-summary { margin-left: 2px; }