doortts doortts 2017-01-16
label: Add label edit link at label selection
@af32f6a81991507a2819a518fb9ee748202b6377
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -6600,3 +6600,6 @@
         width: 100% !important;
     }
 }
+.label-edit {
+    color: @blue2
+}
app/views/board/list.scala.html
--- app/views/board/list.scala.html
+++ app/views/board/list.scala.html
@@ -51,7 +51,7 @@
                 </div>
                 <div class="board-labels">
                 @if(!IssueLabel.findByProject(project).isEmpty){
-                    @issue.partial_select_label(IssueLabel.findByProject(project), param.labelIdSet)
+                    @issue.partial_select_label(IssueLabel.findByProject(project), param.labelIdSet, "", "", project)
                 }
                 </div>
             </form>
app/views/board/view.scala.html
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
@@ -70,7 +70,7 @@
         <div class="board-labels pull-right">
         @if(!IssueLabel.findByProject(project).isEmpty){
             @if(isAllowed(UserApp.currentUser(), post.asResource(), Operation.UPDATE)){
-                @issue.partial_select_label(IssueLabel.findByProject(project), post.getLabelIds)
+                @issue.partial_select_label(IssueLabel.findByProject(project), post.getLabelIds, "", "", project)
             } else {
                 @issue.partial_show_selected_label(post.labels.toList, "")
             }
app/views/issue/create.scala.html
--- app/views/issue/create.scala.html
+++ app/views/issue/create.scala.html
@@ -119,7 +119,7 @@
                         </dd>
                     </dl>
 
-                    @partial_select_label(IssueLabel.findByProject(project), null, "issue-option", "data-close-on-select=false")
+                    @partial_select_label(IssueLabel.findByProject(project), null, "issue-option", "data-close-on-select=false", project)
                 </div>
             </div>
         </div>
app/views/issue/edit.scala.html
--- app/views/issue/edit.scala.html
+++ app/views/issue/edit.scala.html
@@ -165,7 +165,7 @@
                         </dd>
                     </dl>
 
-                    @partial_select_label(IssueLabel.findByProject(project), issue.getLabelIds, "issue-option", "data-close-on-select=false")
+                    @partial_select_label(IssueLabel.findByProject(project), issue.getLabelIds, "issue-option", "data-close-on-select=false", project)
                 </div>
             </div>
         </div>
app/views/issue/partial_searchform.scala.html
--- app/views/issue/partial_searchform.scala.html
+++ app/views/issue/partial_searchform.scala.html
@@ -147,7 +147,7 @@
             </a>
             }
 
-            @partial_select_label(labels, param.labelIds, "issue-option")
+            @partial_select_label(labels, param.labelIds, "issue-option", "", project)
         </div>
         }
     </div>
app/views/issue/partial_select_label.scala.html
--- app/views/issue/partial_select_label.scala.html
+++ app/views/issue/partial_select_label.scala.html
@@ -19,12 +19,12 @@
 * limitations under the License.
 **@
 @(labels:List[models.IssueLabel], selectedLabelIds:Set[Long] = null,
-  wrapperCSSClassName:String = "", additionalAttr:String = "")
+  wrapperCSSClassName:String = "", additionalAttr:String = "", project:Project)
 
 @if(!labels.isEmpty){
 <dl class="@wrapperCSSClassName">
   <dt>
-    @Messages("label")
+      @Messages("label") @if(UserApp.currentUser().isManagerOf(project)){<a href="@routes.IssueLabelApp.labelsForm(project.owner, project.name)" target="_blank" class="label-edit">[@Messages("button.edit")]</a>}
   </dt>
   <dd>
     <select name="labelIds" multiple="multiple" data-search="labelIds"
app/views/issue/view.scala.html
--- app/views/issue/view.scala.html
+++ app/views/issue/view.scala.html
@@ -284,7 +284,7 @@
                         @**<!-- labels -->**@
                         @if(!IssueLabel.findByProject(project).isEmpty){
                             @if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)){
-                                @partial_select_label(IssueLabel.findByProject(project), issue.getLabelIds)
+                                @partial_select_label(IssueLabel.findByProject(project), issue.getLabelIds, "", "", project)
                             } else {
                                 @partial_show_selected_label(issue.labels.toList, routes.IssueApp.issues(project.owner, project.name, issue.state.state(), "html", 1).toString)
                             }
Add a comment
List