From 4f9fd70b9e4f3cdbd620ce9130e06b4c50b4d09a Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 4 Mar 2016 12:17:03 +0800 Subject: [PATCH 1/5] * improve UI of story/create view. --- module/story/css/create.css | 7 +++++++ module/story/js/create.js | 28 ++++++++++++++++------------ module/story/view/create.html.php | 14 ++++++-------- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/module/story/css/create.css b/module/story/css/create.css index 73c283b6c5..168ca0b892 100644 --- a/module/story/css/create.css +++ b/module/story/css/create.css @@ -4,3 +4,10 @@ select {border:1px solid #ccc} .row .col-sm-8{width:76%} .row .col-sm-2{padding-left:0px; padding-right:0px; width:12%} + +#dataform .input-group-btn > .btn + .btn {margin-left: -1px;} +#dataform .input-group-addon > .checkbox-inline {padding-right: 10px;} +#dataform .input-group .chosen-container-single .chosen-single {border-top-right-radius: 0; border-bottom-right-radius: 0} +#title.form-control {border-top-right-radius: 0; border-bottom-right-radius: 0} + +.dropdown-pris > .btn {background-color: #fff;} diff --git a/module/story/js/create.js b/module/story/js/create.js index bad3c11473..9ed93eb63f 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -9,17 +9,21 @@ $(function() $('#assignedTo').removeAttr('disabled'); } $('#assignedTo').trigger("chosen:updated"); -}) -$('#needNotReview').change(function() -{ - if($('#needNotReview').prop('checked')) + $('#needNotReview').change(function() { - $('#assignedTo').attr('disabled', 'disabled'); - } - else - { - $('#assignedTo').removeAttr('disabled'); - } - $('#assignedTo').trigger("chosen:updated"); -}) + if($('#needNotReview').prop('checked')) + { + $('#assignedTo').attr('disabled', 'disabled'); + } + else + { + $('#assignedTo').removeAttr('disabled'); + } + $('#assignedTo').trigger("chosen:updated"); + }); + + $('[data-toggle=tooltip]').tooltip(); +}); + + diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 0a86aeb447..a51bd573f9 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -55,10 +55,10 @@ echo html::select('plan', $plans, $planID, "class='form-control chosen'"); if(count($plans) == 1) { - echo ""; - echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch"), $lang->productplan->create, '_blank'); + echo ""; + echo html::a($this->createLink('productplan', 'create', "productID=$productID&branch=$branch"), "", '_blank', "class='btn' data-toggle='tooltip' title='{$lang->productplan->create}'"); echo '  '; - echo html::a("javascript:loadProductPlans($productID)", $lang->refresh); + echo html::a("javascript:loadProductPlans($productID)", "", '', "class='btn' data-toggle='tooltip' title='{$lang->refresh}'"); echo ''; } ?> @@ -119,11 +119,9 @@ if($contactLists) echo html::select('', $contactLists, '', "class='form-control chosen' onchange=\"setMailto('mailto', this.value)\""); if(empty($contactLists)) { - echo ''; - echo '' . $lang->user->contacts->manage . ''; - echo ''; - echo ''; - echo '' . $lang->refresh . ''; + echo ''; + echo ''; + echo ''; echo ''; } ?> From 2fc659447f919d5ef5f3501eb13f5f62a1dcd1bf Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 4 Mar 2016 12:17:23 +0800 Subject: [PATCH 2/5] * add white space to button and link in login form. --- module/user/view/login.html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/user/view/login.html.php b/module/user/view/login.html.php index 8f84e6b6de..c8af176dbf 100644 --- a/module/user/view/login.html.php +++ b/module/user/view/login.html.php @@ -46,9 +46,9 @@ include '../../common/view/header.lite.html.php'; login); - if($app->company->guest) echo html::linkButton($lang->user->asGuest, $this->createLink($config->default->module)); - echo html::hidden('referer', $referer); - echo html::a(inlink('reset'), $lang->user->resetPassword); + if($app->company->guest) echo '  ' . html::linkButton($lang->user->asGuest, $this->createLink($config->default->module)); + echo '  ' . html::hidden('referer', $referer); + echo '  ' . html::a(inlink('reset'), $lang->user->resetPassword); ?> From f4980f8377df114619d20d1979cbd55710ed64da Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 4 Mar 2016 12:17:53 +0800 Subject: [PATCH 3/5] * add css helpers. --- www/theme/default/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 3c1ce4127a..154d9a77c0 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -13,7 +13,7 @@ /* Width definitions */ .w-p5 {width: 5%} .w-p10 {width: 10%} .w-p15 {width: 15%} .w-p20 {width: 20%} .w-p25 {width: 25%} .w-p30 {width: 30%} .w-p35 {width: 35%} .w-p40 {width: 40%} .w-p45 {width: 45%} .w-p50 {width: 50%} .w-p55 {width: 55%} .w-p60 {width: 60%} .w-p65 {width: 65%} .w-p70 {width: 70%} .w-p75 {width: 75%} .w-p80 {width: 80%} .w-p85 {width: 85%} .w-p90 {width: 90%} .w-p94 {width: 94%} .w-p95 {width: 95%} .w-p98 {width: 98%} .w-p99 {width: 99%} .w-p100{width: 100%} -.w-auto {width: auto} .w-20px {width:20px} .w-30px {width:30px} .w-35px {width:35px} .w-40px {width:40px} .w-45px {width:45px} .w-50px {width:50px} .w-60px {width:60px} .w-70px {width:70px} .w-80px {width:80px} .w-90px {width:90px} .w-100px {width:100px} .w-110px {width:110px} .w-120px {width:120px} .w-130px {width:130px} .w-140px {width:140px} .w-150px {width:150px} .w-160px {width:160px} .w-180px {width:180px} .w-200px {width:200px} .w-300px {width:300px} .w-400px {width:400px} .w-500px {width:500px} .w-600px {width:600px} .w-700px {width:700px} .w-800px {width:800px} .w-900px {width:900px} +.w-auto {width: auto} .w-20px {width:20px} .w-30px {width:30px} .w-35px {width:35px} .w-40px {width:40px} .w-45px {width:45px} .w-50px {width:50px} .w-60px {width:60px} .w-70px {width:70px} .w-80px {width:80px} .w-90px {width:90px} .w-100px {width:100px} .w-110px {width:110px} .w-120px {width:120px} .w-130px {width:130px} .w-140px {width:140px} .w-150px {width:150px} .w-160px {width:160px} .w-180px {width:180px} .w-200px {width:200px} .w-250px {width:250px} .w-300px {width:300px} .w-400px {width:400px} .w-500px {width:500px} .w-600px {width:600px} .w-700px {width:700px} .w-800px {width:800px} .w-900px {width:900px} .mw-200px {max-width:200px!important} .mw-300px {max-width:300px!important} .mw-400px {max-width:400px!important} .mw-500px {max-width:500px!important} .mw-600px {max-width:600px!important} .mw-700px {max-width:700px!important} .mw-800px {max-width:800px!important} .mw-900px {max-width:900px!important} .mw-1400px {max-width:1400px!important} .w-id {width:70px;} .w-pri {width:40px;} .w-severity {width:50px;} .w-hour {width:57px;} .w-date {width:90px;} .w-user {width:80px;} .w-status {width:60px} .w-type {width:80px} .w-resolution {width:70px} @@ -48,7 +48,7 @@ tr.text-center > td.text-right, tr.text-center > th.text-right {text-align: righ /* columns */ .row-table {display: table; width: 100%} -.col-side, .col-main {padding: 0; display: table-cell; vertical-align: top;} +.col-side, .col-main, .col-table {padding: 0; display: table-cell; vertical-align: top;} .col-side {width: 350px; max-width:350px; padding-left: 10px;} .col-main, .row-table-swap .col-side {padding-right: 10px; padding-left: 0;} .row-table-swap .col-main {padding-right: 0; padding-left: 10px;} From f1454d2d991fa1e8f722ae0c79a0468728279b5b Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 4 Mar 2016 12:18:42 +0800 Subject: [PATCH 4/5] * create new UI for priority selectors. --- module/story/view/create.html.php | 24 ++++++++++-------- www/js/my.full.js | 42 +++++++++++++++++++++++++++++++ www/theme/default/style.css | 23 +++++++++++------ 3 files changed, 70 insertions(+), 19 deletions(-) diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index a51bd573f9..186d7ddb26 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -83,19 +83,21 @@ story->title;?> -
-
+
+
-
-
- story->pri?> - story->priList, $pri, "class='form-control'");?> -
-
-
-
- story->estimateAB;?> +
+
+ story->pri;?> + + story->estimateAB;?>
diff --git a/www/js/my.full.js b/www/js/my.full.js index 2bdf0e99dc..118ff0bd63 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -1434,6 +1434,46 @@ function fixedTableHead(boxObj) }); } +/** + * Init prioprity selectors + * @return void + */ +function initPrioritySelector() +{ + $('.dropdown-pris').each(function() + { + var $dropdown = $(this); + var $select = $dropdown.find('select'); + var selectVal = parseInt($select.val()); + var $menu = $dropdown.children('.dropdown-menu'); + if(!$menu.length) + { + $menu = $(''); + $dropdown.append($menu); + } + if(!$menu.children('li').length) + { + var set = $dropdown.data('set').split(',') || [0,1,2,3,4]; + for(var i = 0; i < set.length; ++i) + { + $menu.append('
  • ' + (i ? i : '') + '
  • '); + } + } + $menu.find('a[data-pri="' + selectVal + '"]').parent().addClass('active'); + $dropdown.find('.pri-text').html('' + (selectVal ? selectVal : '') + ''); + + $dropdown.on('click', '.dropdown-menu > li > a', function() + { + var $a = $(this); + $menu.children('li.active').removeClass('active'); + $a.parent().addClass('active'); + selectVal = $a.data('pri'); + $select.val(selectVal); + $dropdown.find('.pri-text').html('' + (selectVal ? selectVal : '') + ''); + }); + }); +} + /* Ping the server every some minutes to keep the session. */ needPing = true; @@ -1481,6 +1521,8 @@ $(document).ready(function() if(checkeds != '') checkeds = checkeds.substring(0, checkeds.length - 1); $.cookie('checkedItem', checkeds, {expires:config.cookieLife, path:config.webRoot}); }); + + initPrioritySelector(); }); /* CTRL+g, auto focus on the search box. */ diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 154d9a77c0..e1656abae0 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -32,6 +32,7 @@ .pdt-20 {padding-top: 20px !important} /* borders */ +.br-0 {border-radius: 0!important} .bd-0, .borderless, .bd-none {border: none !important;} /* backgrounds */ @@ -147,14 +148,20 @@ i[class^="icon-"],i[class*=" icon-"],.link-icon i[class^="icon-"],.link-icon i[c .btn-icon.text-danger:hover {color: #7e0501!important} /* priority icons. */ -.pri1,.pri0,.pri2,.pri3,.pri4,.pri5,.pri6,.pri{display:inline-block;width: 18px;height: 18px;font-size: 12px;line-height: 14px;font-weight: bold; text-align: center; color: #272d68; -moz-border-radius:50%; -webkit-border-radius:50%; border-radius:50%;border: 2px solid #272d68; font-family: arial, helvetica, clean, sans-serif;} -.pri,.pri0{border-color: #ccc;color: #ccc;} -.pri:before{content: '?'} -.pri2{border-color: #25367e;color: #25367e} -.pri3{border-color: #2c4a9b;color: #2c4a9b} -.pri4{border-color: #475da8;color: #475da8} -.pri5{border-color: #6989c5;color: #6989c5} -.pri6{border-color: #9ebee5;color: #9ebee5} +.pri1,.pri0,.pri2,.pri3,.pri4,.pri5,.pri6,.pri{display:inline-block;width: 18px;height: 18px;font-size: 12px;line-height: 14px;font-weight: bold; text-align: center; color: #ccc; -moz-border-radius:50%; -webkit-border-radius:50%; border-radius:50%;border: 2px solid #ccc; font-family: arial, helvetica, clean, sans-serif; background-color: #fff} +.pri:before, .pri0:before{content: '?'} +.pri1{border-color: #EA644A;color: #EA644A;} +.pri2{border-color: #F1A325;color: #F1A325;} +.pri3{border-color: #BD7B46;color: #BD7B46;} +.pri4{border-color: #8666B8;color: #8666B8;} +.pri5{border-color: #03B8CF;color: #03B8CF} +.pri6{border-color: #38B03F;color: #38B03F} +.dropdown-pris > .dropdown-menu {padding: 0 5px;} +.dropdown-pris > .dropdown-menu > li {display: table-cell;} +.dropdown-pris > .dropdown-menu > li > a {opacity: 0.6; transition: all .2s; padding: 6px 5px; display: block} +.dropdown-pris > .dropdown-menu > li.active > a {opacity: 1} +.dropdown-pris > .dropdown-menu > li.active > a:before {display: none} +.dropdown-pris > .dropdown-menu > li > a:hover {background-color: #f5f5f5; opacity: 1} /* bug severity icons. */ .severity,.severity1,.severity2,.severity3,.severity4,.severity5,.severity6{display:inline-block;width: 16px;height: 16px;line-height: 16px;font-weight: bold; text-align: center; font-size: 12px; color: #fff; -moz-border-radius:50%; -webkit-border-radius:50%; border-radius:50%;font-family: arial, helvetica, clean, sans-serif;} From 51d75e71a2a0299e01bf3ceb6d0f7258a7737272 Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 4 Mar 2016 13:01:28 +0800 Subject: [PATCH 5/5] * add method to init priority selectors. --- www/js/my.full.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/www/js/my.full.js b/www/js/my.full.js index 104ac49e1b..5e43f76527 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -1470,6 +1470,46 @@ function fixedTheadOfList(tableID) }); } +/** + * Init prioprity selectors + * @return void + */ +function initPrioritySelector() +{ + $('.dropdown-pris').each(function() + { + var $dropdown = $(this); + var $select = $dropdown.find('select'); + var selectVal = parseInt($select.val()); + var $menu = $dropdown.children('.dropdown-menu'); + if(!$menu.length) + { + $menu = $(''); + $dropdown.append($menu); + } + if(!$menu.children('li').length) + { + var set = $dropdown.data('set').split(',') || [0,1,2,3,4]; + for(var i = 0; i < set.length; ++i) + { + $menu.append('
  • ' + (i ? i : '') + '
  • '); + } + } + $menu.find('a[data-pri="' + selectVal + '"]').parent().addClass('active'); + $dropdown.find('.pri-text').html('' + (selectVal ? selectVal : '') + ''); + + $dropdown.on('click', '.dropdown-menu > li > a', function() + { + var $a = $(this); + $menu.children('li.active').removeClass('active'); + $a.parent().addClass('active'); + selectVal = $a.data('pri'); + $select.val(selectVal); + $dropdown.find('.pri-text').html('' + (selectVal ? selectVal : '') + ''); + }); + }); +} + /* Ping the server every some minutes to keep the session. */ needPing = true; @@ -1517,6 +1557,8 @@ $(document).ready(function() if(checkeds != '') checkeds = checkeds.substring(0, checkeds.length - 1); $.cookie('checkedItem', checkeds, {expires:config.cookieLife, path:config.webRoot}); }); + + initPrioritySelector(); }); /* CTRL+g, auto focus on the search box. */