]> source.dussan.org Git - gitblit.git/commitdiff
Remove S# text, set severity in tooltip 57/157/2
authorJames Moger <james.moger@gitblit.com>
Tue, 21 Oct 2014 17:28:15 +0000 (13:28 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 21 Oct 2014 17:28:15 +0000 (13:28 -0400)
src/main/java/com/gitblit/wicket/TicketsUI.java
src/main/java/com/gitblit/wicket/panels/TicketListPanel.java
src/main/resources/gitblit.css

index 2367c9840ba052e9df55195e1aadf9f3de56d562..8d599523ee44c28f0124afd298eb036bc3a138ce 100644 (file)
@@ -38,12 +38,12 @@ public class TicketsUI {
        public static final String [] openStatii = new String [] { Status.New.name().toLowerCase(), Status.Open.name().toLowerCase() };
 
        public static final String [] closedStatii = new String [] { "!" + Status.New.name().toLowerCase(), "!" + Status.Open.name().toLowerCase() };
-       
+
        public static Label getStateIcon(String wicketId, TicketModel ticket) {
-               return getStateIcon(wicketId, ticket.type, ticket.status);
+               return getStateIcon(wicketId, ticket.type, ticket.status, ticket.severity);
        }
 
-       public static Label getStateIcon(String wicketId, Type type, Status state) {
+       public static Label getStateIcon(String wicketId, Type type, Status state, Severity severity) {
                Label label = new Label(wicketId);
                if (type == null) {
                        type = Type.defaultType;
@@ -68,11 +68,11 @@ public class TicketsUI {
                        // standard ticket
                        WicketUtils.setCssClass(label, "fa fa-ticket fa-fw");
                }
-               WicketUtils.setHtmlTooltip(label, getTypeState(type, state));
-               
+               WicketUtils.setHtmlTooltip(label, getTypeState(type, state, severity));
+
                return label;
        }
-       
+
        public static Label getPriorityIcon(String wicketId, Priority priority) {
                Label label = new Label(wicketId);
                if (priority == null) {
@@ -91,20 +91,23 @@ public class TicketsUI {
                default:
                }
                WicketUtils.setHtmlTooltip(label, priority.toString());
-               
+
                return label;
        }
-       
+
        public static String getPriorityClass(Priority priority) {
                return String.format("priority-%s", priority);
        }
 
        public static String getSeverityClass(Severity severity) {
-               return String.format("severity-%s", severity);  
+               return String.format("severity-%s", severity);
        }
-       
-       public static String getTypeState(Type type, Status state) {
-               return state.toString() + " " + type.toString();
+
+       public static String getTypeState(Type type, Status state, Severity severity) {
+               if (Severity.Unrated == severity) {
+                       return state.toString() + " " + type.toString();
+               }
+               return state.toString() + " " + type.toString() + ", " + severity.toString();
        }
 
        public static String getLozengeClass(Status status, boolean subtle) {
index b4c43cb8f1a667a19efe24108af1bbf107ae52ed..2ac33d5327379dd2e8f1456e4837b8ec9d0442a8 100644 (file)
@@ -53,7 +53,7 @@ import com.gitblit.wicket.pages.UserPage;
 public class TicketListPanel extends BasePanel {
 
        private static final long serialVersionUID = 1L;
-       
+
        public TicketListPanel(String wicketId, List<QueryResult> list, final boolean showSwatch, final boolean showRepository) {
                super(wicketId);
 
@@ -83,10 +83,10 @@ public class TicketListPanel extends BasePanel {
                                        item.add(new Label("ticketsLink").setVisible(false));
                                }
 
-                               Label icon = TicketsUI.getStateIcon("state", ticket.type, ticket.status);
+                               Label icon = TicketsUI.getStateIcon("state", ticket.type, ticket.status, ticket.severity);
                                WicketUtils.addCssClass(icon, TicketsUI.getSeverityClass(ticket.severity));
                                item.add(icon);
-                               
+
                                item.add(new Label("id", "" + ticket.number));
                                UserModel creator = app().users().getUserModel(ticket.createdBy);
                                if (creator != null) {
@@ -174,7 +174,7 @@ public class TicketListPanel extends BasePanel {
                                Label priorityIcon = TicketsUI.getPriorityIcon("priority", ticket.priority);
                                WicketUtils.addCssClass(priorityIcon, TicketsUI.getPriorityClass(ticket.priority));
                                item.add(priorityIcon.setVisible(true));
-                               
+
                                // status indicator
                                String css = TicketsUI.getLozengeClass(ticket.status, true);
                                Label l = new Label("status", ticket.status.toString());
index e517cfa992de567f0ce77fbd840d12376f63b632..4cc9ab6b4a9c4445d6bc4e08c07be377fa3eb7d8 100644 (file)
@@ -2089,7 +2089,7 @@ div.markdown table.text th, div.markdown table.text td {
 }\r
 .severity-catastrophic:after {\r
        font-family: Helvetica,arial,freesans,clean,sans-serif ;\r
-       content: "S5\a●●●●●";\r
+       content: "●●●●●";\r
        font-weight:900;\r
        font-size:.45em;        \r
        font-variant:small-caps;\r
@@ -2101,7 +2101,7 @@ div.markdown table.text th, div.markdown table.text td {
 }\r
 .severity-critical:after {\r
        font-family: Helvetica,arial,freesans,clean,sans-serif ;\r
-       content: "S4\a●●●●";\r
+       content: "●●●●";\r
        font-weight:900;\r
        font-size:.45em;        \r
        font-variant:small-caps;\r
@@ -2113,7 +2113,7 @@ div.markdown table.text th, div.markdown table.text td {
 }\r
 .severity-serious:after {\r
        font-family: Helvetica,arial,freesans,clean,sans-serif ;\r
-       content: "  S3\a   ●●●";\r
+       content: "  ●●●";\r
        font-weight:900;\r
        font-size:.45em;        \r
        font-variant:small-caps;\r
@@ -2125,7 +2125,7 @@ div.markdown table.text th, div.markdown table.text td {
 }\r
 .severity-minor:after {\r
        font-family: Helvetica,arial,freesans,clean,sans-serif ;\r
-       content: "   S2\a    ●●";\r
+       content: "   ●●";\r
        font-weight:900;\r
        font-size:.45em;        \r
        font-variant:small-caps;\r
@@ -2137,7 +2137,7 @@ div.markdown table.text th, div.markdown table.text td {
 }\r
 .severity-negligible:after {\r
        font-family: Helvetica,arial,freesans,clean,sans-serif ;\r
-       content: "   S1\a    ●";\r
+       content: "    ●";\r
        font-weight:900;\r
        font-size:.45em;        \r
        font-variant:small-caps;\r