Redesign tasks lists headers and expander link

This commit is contained in:
perryharlock
2013-09-23 15:12:12 +01:00
parent 9f917f97ec
commit aa1cf59ff0
6 changed files with 87 additions and 47 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@ $(document).ready(function(){
var data = {}; var data = {};
var standardsList = $('[data-role="standards-list"]'); var standardsList = $('[data-role="standards-list"]');
var standardSelect = $('[data-role="new-task-select"]'); var standardSelect = $('[data-role="new-task-select"]');
var headingBadges = $('.heading-badges'); var expandLink = $('[data-role="expander"]');
var taskListSelector = $('[data-role="task-list"] a'); var taskListSelector = $('[data-role="task-list"] a');
var toTopLinks = $('[data-role="top"]'); var toTopLinks = $('[data-role="top"]');
var zoomResetButton = $('[data-role="zoom-reset"]'); var zoomResetButton = $('[data-role="zoom-reset"]');
@@ -40,9 +40,15 @@ $(document).ready(function(){
}; };
// Toggle appearance of lists of error/warnings/notifications // Toggle appearance of lists of error/warnings/notifications
headingBadges.click( function(){ expandLink.click( function(){
$(this).parent().next('ul').slideToggle(); $(this).parent().next('ul').slideToggle('slow', function(){});
$(this).toggleClass('showing'); if ($(this).parent().hasClass('showing')) {
$(this).html('+');
}
else {
$(this).html('-');
}
$(this).parent().toggleClass('showing');
}); });
// Back to top links // Back to top links
@@ -62,8 +68,8 @@ $(document).ready(function(){
e.preventDefault(); e.preventDefault();
target = $(this).attr('href'); target = $(this).attr('href');
animateSection($(target), -25); animateSection($(target), -25);
if (!$(target).next('ul').hasClass('showing')) { if (!$(target).hasClass('showing')) {
$(target).children('.heading-badges').click(); $(target).children('[data-role="expander"]').click();
} }
}); });

View File

@@ -1,14 +1,20 @@
/* No javascript */ /* No javascript */
.no-javascript .graph-container { .no-javascript {
.graph-container, .expander {
display:none; display:none;
} }
.no-javascript .hidden { .hidden {
display:block !important; display:block !important;
visibility:visible !important; visibility:visible !important;
} }
.no-javascript table.hidden { table.hidden {
display:table !important; display:table !important;
} }
.no-javascript .collapse { .collapse {
display:block; display:block;
}
.heading {
margin-top:0;
border-radius: 3px 3px 0 0;
}
} }

View File

@@ -53,7 +53,7 @@
.task-header .h4 { .task-header .h4 {
font-size:floor(@font-size-base * 1.1); // ~16px; font-size:floor(@font-size-base * 1.1); // ~16px;
} }
.label, .badge { .badge {
font-size:floor(@font-size-base * 0.75); // ~11px; font-size:floor(@font-size-base * 0.75); // ~11px;
padding:7px; padding:7px;
} }

View File

@@ -146,21 +146,12 @@
.badge { .badge {
border-radius:0.25em; border-radius:0.25em;
} }
.label, .badge { .badge {
display:inline-block; display:inline-block;
padding:10px; padding:10px;
font-size:ceil(@font-size-base * 0.85); // ~13px; font-size:ceil(@font-size-base * 0.85); // ~13px;
text-transform: uppercase; text-transform: uppercase;
} }
.badge-danger {
background-color:@brand-danger;
}
.badge-warning {
background-color:@brand-warning;
}
.badge-info {
background-color:@brand-info;
}
.rule-name .badge { .rule-name .badge {
padding:6px; padding:6px;
} }
@@ -177,10 +168,9 @@
margin-bottom:30px; margin-bottom:30px;
border-width:3px; border-width:3px;
border-style:solid; border-style:solid;
border-radius: 3px;
li { li {
margin-bottom:30px; margin-bottom:20px;
&:last-child { &:last-child {
margin-bottom:0; margin-bottom:0;
@@ -208,10 +198,27 @@
/* Task list heading */ /* Task list heading */
.heading { .heading {
margin-bottom:10px; margin-top:12px;
padding:11px;
color: @btn-default-color;
font-weight:bold;
border-radius: 3px;
&.showing {
margin-bottom:0;
border-radius: 3px 3px 0 0;
}
&:first-child, &.first {
margin-top:0;
}
} }
.heading-badges { .expander {
cursor:pointer; cursor:pointer;
padding:0 5px;
font-weight:bold;
font-size:floor(@font-size-base * @line-height-base); // ~20px
line-height:1;
} }
/* Graph */ /* Graph */

View File

@@ -98,15 +98,12 @@
</div> </div>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{#if results}} {{#if results}}
<p class="heading showing" id="errors"> <div class="heading label-danger showing first" id="errors">
<span class="heading-badges"> Errors ( 13 )
<span class="label label-danger">Errors</span> <span class="badge badge-danger">?</span> <span data-role="expander" class="pull-right expander"> - </span>
</span> </div>
<a href="#top" data-role="top" class="pull-right default"> <span class="glyphicon glyphicon-arrow-up"></span></a>
</p>
<ul class="list-unstyled task-danger tasks-list collapse in"> <ul class="list-unstyled task-danger tasks-list collapse in">
{{#lastResult.messages}} {{#lastResult.messages}}
<li> <li>
@@ -115,12 +112,36 @@
</li> </li>
{{/lastResult.messages}} {{/lastResult.messages}}
</ul> </ul>
<p class="heading">
<span class="heading-badges"> <div class="heading label-warning" id="warnings">
<span class="label label-default">Ignored Rules</span> Warnings ( 142 )
</span> <span data-role="expander" class="pull-right expander"> + </span>
<a href="#top" data-role="top" class="pull-right default"> <span class="glyphicon glyphicon-arrow-up"></span></a> </div>
</p> <ul class="list-unstyled task-warning tasks-list collapse">
{{#lastResult.messages}}
<li>
<p class="crunch rule-name">{{type}} : {{code}} <span class="badge">{{count}}</span></p>
<p>{{message}}</p>
</li>
{{/lastResult.messages}}
</ul>
<div class="heading label-info" id="notifications">
Notifications ( 166 )
<span data-role="expander" class="pull-right expander"> + </span>
</div>
<ul class="list-unstyled task-info tasks-list collapse">
{{#lastResult.messages}}
<li>
<p class="crunch rule-name">{{type}} : {{code}} <span class="badge">{{count}}</span></p>
<p>{{message}}</p>
</li>
{{/lastResult.messages}}
</ul>
<div class="heading label-default">Ignored Rules
<span data-role="expander" class="pull-right expander"> + </span>
</div>
<ul class="list-unstyled task-default tasks-list collapse"> <ul class="list-unstyled task-default tasks-list collapse">
{{#task.ignore}} {{#task.ignore}}
<li> <li>