The Unified and Autonomous Development Platform
Remove code comment title to make commenting code easier
robin shine233feb78584b
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.javaindex 173239e916..1f09fd7581 100644--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.java+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/entity/CodeComment.java@@ -46,7 +46,7 @@ import com.pmease.gitplex.core.security.SecurityUtils;public class CodeComment extends AbstractEntity {private static final long serialVersionUID = 1L;-+@Versionprivate long version;@@ -58,9 +58,6 @@ public class CodeComment extends AbstractEntity {@JoinColumn(nullable=false)private Account user;- @Column(nullable=false)- private String title;-@Lob@Column(nullable=false, length=65535)private String content;@@ -116,19 +113,10 @@ public class CodeComment extends AbstractEntity {return version;}- public String getTitle() {- return title;- }-- public void setTitle(String title) {- this.title = title;- }-- @Nullablepublic String getContent() {return content;}-+public void setContent(String content) {this.content = content;}diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultMailManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultMailManager.javaindex fb013b19a3..393c77e5c8 100644--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultMailManager.java+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultMailManager.java@@ -190,8 +190,7 @@ public class DefaultMailManager implements MailManager {if (event.getMarkdown() != null) {for (Account user: new MentionParser().parseMentions(markdownManager.parse(event.getMarkdown()))) {CodeComment comment = event.getComment();- String subject = String.format("You are mentioned in a code comment (%s)",- comment.getTitle());+ String subject = "You are mentioned in a code comment";String url;if (event instanceof CodeCommentResolved)url = urlManager.urlFor(((CodeCommentResolved)event).getStatusChange(), event.getRequest());diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentFilter.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentFilter.javaindex ec14607334..4dd217a47a 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentFilter.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentFilter.java@@ -1,207 +1,185 @@-package com.pmease.gitplex.web.component.comment;--import java.io.Serializable;-import java.util.Collection;-import java.util.Date;-import java.util.Iterator;-import java.util.List;--import org.apache.wicket.core.request.handler.IPageRequestHandler;-import org.apache.wicket.request.cycle.RequestCycle;-import org.apache.wicket.request.mapper.parameter.PageParameters;-import org.hibernate.criterion.Restrictions;--import com.pmease.commons.hibernate.dao.EntityCriteria;-import com.pmease.commons.util.match.WildcardUtils;-import com.pmease.commons.wicket.editable.annotation.Editable;-import com.pmease.gitplex.core.annotation.AccountChoice;-import com.pmease.gitplex.core.annotation.FileChoice;-import com.pmease.gitplex.core.entity.CodeComment;--@Editable-public class CodeCommentFilter implements Serializable {-- private static final long serialVersionUID = 1L;-- private static final String PARAM_USER = "user";-- private static final String PARAM_UNRESOLVED = "unresolved";-- private static final String PARAM_PATH = "path";-- private static final String PARAM_TITLE = "title";-- private static final String PARAM_BEFORE = "before";-- private static final String PARAM_AFTER = "after";-- private String userName;-- private boolean unresolved;-- private String path;-- private String title;-- private Date before;-- private Date after;-- @Editable(order=100, name="Created by", description="Choose the user who created the comment")- @AccountChoice- public String getUserName() {- return userName;- }-- public void setUserName(String userName) {- this.userName = userName;- }-- @Editable(order=200, name="Show unresolved only", description="Check this if you only want to show unresolved comments")- public boolean isUnresolved() {- return unresolved;- }-- public void setUnresolved(boolean unresolved) {- this.unresolved = unresolved;- }-- @Editable(order=400, name="Title containing", description="Show comments with title containing specified string")- public String getContent() {- return title;- }-- public void setContent(String content) {- this.title = content;- }-- @Editable(order=500, name="Commented path", description="Show comments on specified path")- @FileChoice("getCommentedFiles")- public String getPath() {- return path;- }-- public void setPath(String path) {- this.path = path;- }-- @Editable(order=600, name="After date", description="Show comments after specified date")- public Date getAfter() {- return after;- }-- public void setAfter(Date after) {- this.after = after;- }-- @Editable(order=700, name="Before date", description="Show comments before specified date")- public Date getBefore() {- return before;- }-- public void setBefore(Date before) {- this.before = before;- }-- public CodeCommentFilter() {- }-- public CodeCommentFilter(PageParameters params) {- userName = params.get(PARAM_USER).toString();- unresolved = "yes".equals(params.get(PARAM_UNRESOLVED).toString());- path = params.get(PARAM_PATH).toString();- title = params.get(PARAM_TITLE).toString();-- String value = params.get(PARAM_BEFORE).toString();- if (value != null)- before = new Date(Long.valueOf(value));-- value = params.get(PARAM_AFTER).toString();- if (value != null)- after = new Date(Long.valueOf(value));- }-- public void fill(EntityCriteria<CodeComment> criteria) {- if (userName != null)- criteria.createCriteria("user").add(Restrictions.eq("name", userName));- if (unresolved)- criteria.add(Restrictions.eq("resolved", false));- if (path != null) {- String pathQuery = path.replace('*', '%');- if (pathQuery.endsWith("/"))- pathQuery += "%";- criteria.add(Restrictions.ilike("commentPos.path", pathQuery));- }- if (title != null)- criteria.add(Restrictions.ilike("title", "%" + title + "%"));-- if (before != null)- criteria.add(Restrictions.le("createDate", before));- if (after != null)- criteria.add(Restrictions.ge("createDate", after));- }-- public void filter(Collection<CodeComment> comments) {- for (Iterator<CodeComment> it = comments.iterator(); it.hasNext();) {- CodeComment comment = it.next();- if (userName != null) {- if (comment.getUser() == null || !comment.getUser().getName().equals(userName)) {- it.remove();- continue;- }- }- if (unresolved && comment.isResolved()) {- it.remove();- continue;- }- if (path != null) {- if (comment.getCommentPos().getPath() == null) {- it.remove();- continue;- } else {- String matchWith = path;- if (matchWith.endsWith("/"))- matchWith += "*";- if (!WildcardUtils.matchString(matchWith, comment.getCommentPos().getPath())) {- it.remove();- continue;- }- }- }- if (title != null && !comment.getTitle().contains(title)) {- it.remove();- continue;- }- if (before != null && comment.getDate().getTime()>before.getTime()) {- it.remove();- continue;- }- if (after != null && comment.getDate().getTime()<after.getTime()) {- it.remove();- continue;- }- }- }-- public void fillPageParams(PageParameters params) {- if (userName != null)- params.add(PARAM_USER, userName);- if (unresolved)- params.add(PARAM_UNRESOLVED, "yes");- if (title != null)- params.add(PARAM_TITLE, title);- if (path != null)- params.add(PARAM_PATH, path);- if (before != null)- params.add(PARAM_BEFORE, before.getTime());- if (after != null)- params.add(PARAM_AFTER, after.getTime());- }-- @SuppressWarnings("unused")- private static List<String> getCommentedFiles() {- IPageRequestHandler handler = (IPageRequestHandler) RequestCycle.get().getActiveRequestHandler();- return ((CodeCommentAware)handler.getPage()).getCommentedFiles();- }--}+package com.pmease.gitplex.web.component.comment;++import java.io.Serializable;+import java.util.Collection;+import java.util.Date;+import java.util.Iterator;+import java.util.List;++import org.apache.wicket.core.request.handler.IPageRequestHandler;+import org.apache.wicket.request.cycle.RequestCycle;+import org.apache.wicket.request.mapper.parameter.PageParameters;+import org.hibernate.criterion.Restrictions;++import com.pmease.commons.hibernate.dao.EntityCriteria;+import com.pmease.commons.util.match.WildcardUtils;+import com.pmease.commons.wicket.editable.annotation.Editable;+import com.pmease.gitplex.core.annotation.AccountChoice;+import com.pmease.gitplex.core.annotation.FileChoice;+import com.pmease.gitplex.core.entity.CodeComment;++@Editable+public class CodeCommentFilter implements Serializable {++ private static final long serialVersionUID = 1L;++ private static final String PARAM_USER = "user";++ private static final String PARAM_UNRESOLVED = "unresolved";++ private static final String PARAM_PATH = "path";++ private static final String PARAM_BEFORE = "before";++ private static final String PARAM_AFTER = "after";++ private String userName;++ private boolean unresolved;++ private String path;++ private Date before;++ private Date after;++ @Editable(order=100, name="Created by", description="Choose the user who created the comment")+ @AccountChoice+ public String getUserName() {+ return userName;+ }++ public void setUserName(String userName) {+ this.userName = userName;+ }++ @Editable(order=200, name="Show unresolved only", description="Check this if you only want to show unresolved comments")+ public boolean isUnresolved() {+ return unresolved;+ }++ public void setUnresolved(boolean unresolved) {+ this.unresolved = unresolved;+ }++ @Editable(order=500, name="Commented path", description="Show comments on specified path")+ @FileChoice("getCommentedFiles")+ public String getPath() {+ return path;+ }++ public void setPath(String path) {+ this.path = path;+ }++ @Editable(order=600, name="After date", description="Show comments after specified date")+ public Date getAfter() {+ return after;+ }++ public void setAfter(Date after) {+ this.after = after;+ }++ @Editable(order=700, name="Before date", description="Show comments before specified date")+ public Date getBefore() {+ return before;+ }++ public void setBefore(Date before) {+ this.before = before;+ }++ public CodeCommentFilter() {+ }++ public CodeCommentFilter(PageParameters params) {+ userName = params.get(PARAM_USER).toString();+ unresolved = "yes".equals(params.get(PARAM_UNRESOLVED).toString());+ path = params.get(PARAM_PATH).toString();++ String value = params.get(PARAM_BEFORE).toString();+ if (value != null)+ before = new Date(Long.valueOf(value));++ value = params.get(PARAM_AFTER).toString();+ if (value != null)+ after = new Date(Long.valueOf(value));+ }++ public void fill(EntityCriteria<CodeComment> criteria) {+ if (userName != null)+ criteria.createCriteria("user").add(Restrictions.eq("name", userName));+ if (unresolved)+ criteria.add(Restrictions.eq("resolved", false));+ if (path != null) {+ String pathQuery = path.replace('*', '%');+ if (pathQuery.endsWith("/"))+ pathQuery += "%";+ criteria.add(Restrictions.ilike("commentPos.path", pathQuery));+ }++ if (before != null)+ criteria.add(Restrictions.le("createDate", before));+ if (after != null)+ criteria.add(Restrictions.ge("createDate", after));+ }++ public void filter(Collection<CodeComment> comments) {+ for (Iterator<CodeComment> it = comments.iterator(); it.hasNext();) {+ CodeComment comment = it.next();+ if (userName != null) {+ if (comment.getUser() == null || !comment.getUser().getName().equals(userName)) {+ it.remove();+ continue;+ }+ }+ if (unresolved && comment.isResolved()) {+ it.remove();+ continue;+ }+ if (path != null) {+ if (comment.getCommentPos().getPath() == null) {+ it.remove();+ continue;+ } else {+ String matchWith = path;+ if (matchWith.endsWith("/"))+ matchWith += "*";+ if (!WildcardUtils.matchString(matchWith, comment.getCommentPos().getPath())) {+ it.remove();+ continue;+ }+ }+ }+ if (before != null && comment.getDate().getTime()>before.getTime()) {+ it.remove();+ continue;+ }+ if (after != null && comment.getDate().getTime()<after.getTime()) {+ it.remove();+ continue;+ }+ }+ }++ public void fillPageParams(PageParameters params) {+ if (userName != null)+ params.add(PARAM_USER, userName);+ if (unresolved)+ params.add(PARAM_UNRESOLVED, "yes");+ if (path != null)+ params.add(PARAM_PATH, path);+ if (before != null)+ params.add(PARAM_BEFORE, before.getTime());+ if (after != null)+ params.add(PARAM_AFTER, after.getTime());+ }++ @SuppressWarnings("unused")+ private static List<String> getCommentedFiles() {+ IPageRequestHandler handler = (IPageRequestHandler) RequestCycle.get().getActiveRequestHandler();+ return ((CodeCommentAware)handler.getPage()).getCommentedFiles();+ }++}diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentListPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentListPanel.javaindex b33282b792..a9eaa42199 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentListPanel.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentListPanel.java@@ -33,6 +33,7 @@ import org.hibernate.criterion.Restrictions;import com.pmease.commons.hibernate.dao.Dao;import com.pmease.commons.hibernate.dao.EntityCriteria;+import com.pmease.commons.util.StringUtils;import com.pmease.commons.wicket.editable.BeanContext;import com.pmease.gitplex.core.GitPlex;import com.pmease.gitplex.core.entity.CodeComment;@@ -54,6 +55,8 @@ import de.agilecoders.wicket.core.markup.html.bootstrap.navigation.BootstrapPagi@SuppressWarnings("serial")public abstract class CodeCommentListPanel extends Panel {+ private static final int TITLE_LEN = 100;+private final IModel<CodeCommentFilter> filterOptionModel;public CodeCommentListPanel(String id, IModel<CodeCommentFilter> filterOptionModel) {@@ -160,7 +163,7 @@ public abstract class CodeCommentListPanel extends Panel {}};- titleLink.add(new Label("label", comment.getTitle()));+ titleLink.add(new Label("label", StringUtils.abbreviate(comment.getContent(), TITLE_LEN)));fragment.add(titleLink);fragment.add(new WebMarkupContainer("resolved").setVisible(comment.isResolved()));fragment.add(new AccountLink("user", comment.getUser()));diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.htmlindex 07e1ecccdc..3b5f814fb7 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.html+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.html@@ -31,11 +31,6 @@<form wicket:id="form" class="leave-confirm"><div wicket:id="feedback" class="feedback"></div><div class="form-group">- <label>Title</label>- <input wicket:id="title" class="form-control focusable"></input>- </div>- <div class="form-group">- <label>Content</label><textarea wicket:id="content" rows="10" class="form-control focusable"></textarea></div><div class="actions">diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.javaindex 71a5229224..c98a787b8e 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/comment/CodeCommentPanel.java@@ -19,7 +19,6 @@ import org.apache.wicket.markup.head.IHeaderResponse;import org.apache.wicket.markup.html.WebMarkupContainer;import org.apache.wicket.markup.html.basic.Label;import org.apache.wicket.markup.html.form.Form;-import org.apache.wicket.markup.html.form.TextField;import org.apache.wicket.markup.html.link.Link;import org.apache.wicket.markup.html.panel.Fragment;import org.apache.wicket.markup.html.panel.Panel;@@ -196,9 +195,6 @@ public abstract class CodeCommentPanel extends Panel {Form<?> form = new Form<Void>("form");form.setOutputMarkupId(true);- TextField<String> titleInput = new TextField<String>("title", Model.of(getComment().getTitle()));- titleInput.setRequired(true);- form.add(titleInput);CommentInput contentInput = new CommentInput("content", Model.of(getComment().getContent())) {@Override@@ -253,7 +249,6 @@ public abstract class CodeCommentPanel extends Panel {CodeComment comment = getComment();if (comment.getVersion() != lastVersion)throw new StaleStateException("");- comment.setTitle(titleInput.getModelObject());comment.setContent(contentInput.getModelObject());GitPlex.getInstance(CodeCommentManager.class).save(comment);WebMarkupContainer commentContainer = newCommentContainer();diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.htmlindex 2ade79030b..8e95ef9a8e 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.html+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.html@@ -3,15 +3,12 @@<div wicket:id="comment" class="comment"><div class="ui-resizable-handle ui-resizable-e"></div><div class="content">- <div wicket:id="head" class="head">- <div wicket:id="title" class="title"></div>- <div class="actions clearfix">- <a wicket:id="context" class="pull-left context close" title="Show this comment by comparing with specified revision"><i class="fa fa-ext fa-file-diff"></i></a>- <a wicket:id="permanent" class="pull-left permanent close" title="Permanent link of this comment"><i class="fa fa-link"></i></a>- <a wicket:id="locate" class="pull-left locate close" title="Locate marked text of this comment"><i class="fa fa-hand-o-right"></i></a>- <a wicket:id="close" class="pull-left close" title="Hide comment"><i class="fa fa-times"></i></a>- <a wicket:id="toggleResolve" class="pull-right resolve"><i class="fa fa-check-circle"></i></a>- </div>+ <div wicket:id="head" class="head clearfix">+ <a wicket:id="context" class="pull-left context close" title="Show this comment by comparing with specified revision"><i class="fa fa-ext fa-file-diff"></i></a>+ <a wicket:id="permanent" class="pull-left permanent close" title="Permanent link of this comment"><i class="fa fa-link"></i></a>+ <a wicket:id="locate" class="pull-left locate close" title="Locate marked text of this comment"><i class="fa fa-hand-o-right"></i></a>+ <a wicket:id="close" class="pull-left close" title="Hide comment"><i class="fa fa-times"></i></a>+ <a wicket:id="toggleResolve" class="pull-right resolve"><i class="fa fa-check-circle"></i></a></div><div wicket:id="body" class="body scrollable"></div></div>@@ -36,11 +33,6 @@<form wicket:id="form" class="new-comment leave-confirm"><div wicket:id="feedback" class="feedback"></div><div class="form-group">- <label>Title</label>- <input wicket:id="title" class="form-control focusable"></input>- </div>- <div class="form-group">- <label>Content</label><textarea wicket:id="content" rows="10" class="form-control focusable"></textarea></div><div class="actions">diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.javaindex 3f379cca9d..0db084f8e2 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/SourceViewPanel.java@@ -28,9 +28,7 @@ import org.apache.wicket.markup.head.IHeaderResponse;import org.apache.wicket.markup.head.JavaScriptHeaderItem;import org.apache.wicket.markup.head.OnDomReadyHeaderItem;import org.apache.wicket.markup.html.WebMarkupContainer;-import org.apache.wicket.markup.html.basic.Label;import org.apache.wicket.markup.html.form.Form;-import org.apache.wicket.markup.html.form.TextField;import org.apache.wicket.markup.html.image.Image;import org.apache.wicket.markup.html.link.AbstractLink;import org.apache.wicket.markup.html.panel.Fragment;@@ -283,23 +281,6 @@ public class SourceViewPanel extends BlobViewPanel {head.setOutputMarkupId(true);commentContainer.add(head);- head.add(new Label("title", new AbstractReadOnlyModel<String>() {-- @Override- public String getObject() {- CodeComment comment = context.getOpenComment();- return comment!=null?comment.getTitle():"";- }-- }) {-- @Override- protected void onConfigure() {- super.onConfigure();- setVisible(context.getOpenComment() != null);- }-- });head.add(new DropdownLink("context") {@Override@@ -508,10 +489,6 @@ public class SourceViewPanel extends BlobViewPanel {String uuid = UUID.randomUUID().toString();- TextField<String> titleInput = new TextField<String>("title", Model.of(""));- titleInput.setRequired(true);- form.add(titleInput);-CommentInput contentInput;form.add(contentInput = new CommentInput("content", Model.of("")) {@@ -565,7 +542,6 @@ public class SourceViewPanel extends BlobViewPanel {comment.setCommentPos(new CommentPos());comment.getCommentPos().setCommit(context.getCommit().name());comment.getCommentPos().setPath(context.getBlobIdent().path);- comment.setTitle(titleInput.getModelObject());comment.setContent(contentInput.getModelObject());comment.setDepot(context.getDepot());comment.setUser(SecurityUtils.getAccount());@@ -798,7 +774,6 @@ public class SourceViewPanel extends BlobViewPanel {CommentInfo commentInfo = new CommentInfo();commentInfo.id = comment.getId();commentInfo.mark = comment.getCommentPos().getRange();- commentInfo.title = comment.getTitle();String jsonOfCommentInfo;try {@@ -894,7 +869,6 @@ public class SourceViewPanel extends BlobViewPanel {CommentInfo commentInfo = new CommentInfo();commentInfo.id = comment.getId();commentInfo.mark = comment.getCommentPos().getRange();- commentInfo.title = comment.getTitle();commentInfosAtLine.add(commentInfo);}}diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.cssindex 73a1f8a80d..142aac445f 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.css+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.css@@ -9,8 +9,8 @@top: 0;left: 0;}-.source-view>.comment>.content>.head .title {- margin-bottom: 8px;+.source-view>.comment>.content>.head>a {+ margin-right: 8px;}.source-view>.comment>.content>.head .context {margin-top: -2px;diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.js b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.jsindex 30c49e0e3e..b15770538c 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.js+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/depotfile/blobview/source/source-view.js@@ -260,7 +260,7 @@ gitplex.sourceview = {for (var i in comments) {var comment = comments[i];var index = parseInt(i) + 1;- content += "<a class='comment-trigger' title='Click to show details of this comment'>" + comment.title + "</a>";+ content += "<a class='comment-trigger' title='Click to show details of this comment'>#" + comment.id + "</a>";}$indicator.popover({html: true,diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.javaindex bb274fe8b2..1e6781197b 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java@@ -464,7 +464,6 @@ public class TextDiffPanel extends Panel implements SourceAware {List<CommentInfo> commentInfosAtLine;CommentInfo commentInfo = new CommentInfo();commentInfo.id = comment.getId();- commentInfo.title = comment.getTitle();commentInfo.mark = new MarkInfo(comment, oldCommitHash);if (commentInfo.mark.leftSide) {commentInfosAtLine = oldCommentInfos.get(line);@@ -1046,7 +1045,6 @@ public class TextDiffPanel extends Panel implements SourceAware {CommentInfo commentInfo = new CommentInfo();commentInfo.id = comment.getId();commentInfo.mark = new MarkInfo(comment, getOldCommit().name());- commentInfo.title = comment.getTitle();String jsonOfCommentInfo;try {diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.js b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.jsindex 2bad68dd52..01ec1a382a 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.js+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/text-diff.js@@ -755,7 +755,7 @@ gitplex.textdiff = {for (var i in comments) {var comment = comments[i];var index = parseInt(i) + 1;- content += "<a class='comment-trigger' title='Click to show comment of marked text'>" + comment.title + "</a>";+ content += "<a class='comment-trigger' title='Click to show comment of marked text'>#" + comment.id + "</a>";}$indicator.popover({html: true,diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.htmlindex 080b3ea19f..5ee8897ba2 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.html+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.html@@ -43,15 +43,12 @@<div wicket:id="comment" class="comment"><div class="ui-resizable-handle ui-resizable-e"></div><div class="content">- <div wicket:id="head" class="head">- <div wicket:id="title" class="title"></div>- <div class="actions clearfix">- <a wicket:id="context" class="pull-left context close" title="Show this comment by comparing with specified revision"><i class="fa fa-ext fa-file-diff"></i></a>- <a wicket:id="permanent" class="pull-left permanent close" title="Permanent link of this comment"><i class="fa fa-link"></i></a>- <a wicket:id="locate" class="pull-left locate close"><i class="fa fa-hand-o-right"></i></a>- <a wicket:id="close" class="pull-left close" title="Hide comment"><i class="fa fa-times"></i></a>- <a wicket:id="toggleResolve" class="pull-right resolve"><i class="fa fa-check-circle"></i></a>- </div>+ <div wicket:id="head" class="head clearfix">+ <a wicket:id="context" class="pull-left context close" title="Show this comment by comparing with specified revision"><i class="fa fa-ext fa-file-diff"></i></a>+ <a wicket:id="permanent" class="pull-left permanent close" title="Permanent link of this comment"><i class="fa fa-link"></i></a>+ <a wicket:id="locate" class="pull-left locate close"><i class="fa fa-hand-o-right"></i></a>+ <a wicket:id="close" class="pull-left close" title="Hide comment"><i class="fa fa-times"></i></a>+ <a wicket:id="toggleResolve" class="pull-right resolve"><i class="fa fa-check-circle"></i></a></div><div wicket:id="body" class="body scrollable"></div></div>@@ -68,11 +65,6 @@<form wicket:id="form" class="new-comment leave-confirm"><div wicket:id="feedback" class="feedback"></div><div class="form-group">- <label>Title</label>- <input wicket:id="title" class="form-control focusable"></input>- </div>- <div class="form-group">- <label>Content</label><textarea wicket:id="content" rows="10" class="form-control focusable"></textarea></div><div class="actions">diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.javaindex 54e9afbdf6..f8932eff85 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/RevisionDiffPanel.java@@ -746,9 +746,6 @@ public class RevisionDiffPanel extends Panel {String uuid = UUID.randomUUID().toString();- TextField<String> titleInput = new TextField<String>("title", Model.of(""));- titleInput.setRequired(true);- form.add(titleInput);CommentInput contentInput;form.add(contentInput = new CommentInput("content", Model.of("")) {@@ -804,7 +801,6 @@ public class RevisionDiffPanel extends Panel {comment.setUser(SecurityUtils.getAccount());comment.setCommentPos(commentPos);comment.setCompareContext(getCompareContext(comment.getCommentPos().getCommit()));- comment.setTitle(titleInput.getModelObject());comment.setContent(contentInput.getModelObject());Ref branchRef = depot.getBranchRef(newRev);if (branchRef != null)@@ -990,24 +986,6 @@ public class RevisionDiffPanel extends Panel {head.setOutputMarkupId(true);commentContainer.add(head);- head.add(new Label("title", new AbstractReadOnlyModel<String>() {-- @Override- public String getObject() {- CodeComment comment = getOpenComment();- return comment!=null?comment.getTitle():"";- }-- }) {-- @Override- protected void onConfigure() {- super.onConfigure();- setVisible(getOpenComment() != null);- }-- });-head.add(new DropdownLink("context") {@Overridediff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.cssindex 306edfc870..d760ccfe14 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.css+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/revision/revision-diff.css@@ -89,6 +89,9 @@position: fixed;z-index: 100;}+.revision-diff>.body>.detail>.comment>.content>.head>a {+ margin-right: 8px;+}.revision-diff>.body>.detail>.comment>.content>.head .locate {font-size: 20px;}