From f6dd4a9ee44b0631f193e06a545572f76469a487 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 24 Oct 2013 17:49:02 +0200 Subject: [PATCH] // Code review --- admin-dev/themes/default/css/admin-theme.css | 99 ++++++++++--------- .../css/admin-theme/_admin-dashboard.sass | 4 + modules/dashactivity/dashactivity.php | 2 +- modules/dashactivity/views/js/dashactivity.js | 2 +- .../templates/hook/dashboard_zone_one.tpl | 2 +- modules/dashgoals/dashgoals.php | 2 +- modules/dashgoals/views/js/dashgoals.js | 4 +- .../templates/hook/dashboard_zone_two.tpl | 15 ++- 8 files changed, 74 insertions(+), 56 deletions(-) diff --git a/admin-dev/themes/default/css/admin-theme.css b/admin-dev/themes/default/css/admin-theme.css index 5711b217e..322d677e2 100644 --- a/admin-dev/themes/default/css/admin-theme.css +++ b/admin-dev/themes/default/css/admin-theme.css @@ -10204,62 +10204,67 @@ li.sortable-placeholder { font-size: 1.2em; background-color: #1ba6e5; } /* line 51, admin-theme/_admin-dashboard.sass */ +#dashboard section header .small { + font-variant: small-cap; + text-transform: uppercase; + font-size: 0.7em; } +/* line 55, admin-theme/_admin-dashboard.sass */ #dashboard section header.panel-heading, #dashboard section #header_notifs_icon_wrapper .notifs_panel header.notifs_panel_header, #header_notifs_icon_wrapper .notifs_panel #dashboard section header.notifs_panel_header { color: #555555; } -/* line 54, admin-theme/_admin-dashboard.sass */ +/* line 58, admin-theme/_admin-dashboard.sass */ #dashboard .data_list { margin: 0 0 10px 0; padding: 0; } -/* line 58, admin-theme/_admin-dashboard.sass */ +/* line 62, admin-theme/_admin-dashboard.sass */ #dashboard .data_list li { position: relative; } -/* line 63, admin-theme/_admin-dashboard.sass */ +/* line 67, admin-theme/_admin-dashboard.sass */ #dashboard .data_list .data_value { line-height: 39px; position: absolute; top: 0; right: 0; padding: 0 10px 0 0; } -/* line 70, admin-theme/_admin-dashboard.sass */ +/* line 74, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_small { margin: 8px 0 10px 0; padding: 0 0 0 0; border-top: solid 1px #dddddd; } -/* line 74, admin-theme/_admin-dashboard.sass */ +/* line 78, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_small li { padding: 3px 0; position: relative; border: none; margin: 0; border-bottom: dashed 1px #dddddd; } -/* line 80, admin-theme/_admin-dashboard.sass */ +/* line 84, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_small .data_label { text-transform: uppercase; color: #bbbbbb; } -/* line 83, admin-theme/_admin-dashboard.sass */ +/* line 87, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_small .data_value { line-height: 25px; position: absolute; top: 0; right: 0; padding: 0; } -/* line 90, admin-theme/_admin-dashboard.sass */ +/* line 94, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_large { margin: 8px 0 10px 0; padding: 0; } -/* line 94, admin-theme/_admin-dashboard.sass */ +/* line 98, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_large li { padding: 6px 0; position: relative; border: none; margin: 0; } -/* line 99, admin-theme/_admin-dashboard.sass */ +/* line 103, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_large .data_label { line-height: 0.8em; } -/* line 101, admin-theme/_admin-dashboard.sass */ +/* line 105, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_large .data_label small { font-size: 0.6em; } -/* line 103, admin-theme/_admin-dashboard.sass */ +/* line 107, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_large .data_value { text-align: right; line-height: 0.6em; @@ -10267,10 +10272,10 @@ li.sortable-placeholder { top: 0; right: 0; padding: 8px 0 0 0; } -/* line 110, admin-theme/_admin-dashboard.sass */ +/* line 114, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_large .data_value small { font-size: 0.5em; } -/* line 113, admin-theme/_admin-dashboard.sass */ +/* line 117, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_vertical { padding: 0; margin: 0 0 10px 0; @@ -10280,30 +10285,30 @@ li.sortable-placeholder { -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } -/* line 120, admin-theme/_admin-dashboard.sass */ +/* line 124, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_vertical li { border-left: solid 1px #dddddd; padding: 6px; } -/* line 124, admin-theme/_admin-dashboard.sass */ +/* line 128, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_vertical li:first-child { border: none; } -/* line 126, admin-theme/_admin-dashboard.sass */ +/* line 130, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_vertical .data_label { min-height: 32px; display: block; line-height: 1em; text-align: center; } -/* line 131, admin-theme/_admin-dashboard.sass */ +/* line 135, admin-theme/_admin-dashboard.sass */ #dashboard .data_list_vertical .data_value { display: block; text-align: center; } -/* line 136, admin-theme/_admin-dashboard.sass */ +/* line 140, admin-theme/_admin-dashboard.sass */ #dashboard #dashtrends header { margin-bottom: 0; } -/* line 138, admin-theme/_admin-dashboard.sass */ +/* line 142, admin-theme/_admin-dashboard.sass */ #dashboard #dashtrends #dashtrends_toolbar { margin: 4px -16px; } -/* line 140, admin-theme/_admin-dashboard.sass */ +/* line 144, admin-theme/_admin-dashboard.sass */ #dashboard #dashtrends dl { cursor: pointer; margin: 0; @@ -10313,25 +10318,25 @@ li.sortable-placeholder { padding: 10px; border-left: 1px solid #dddddd; border-bottom: 1px solid #dddddd; } -/* line 149, admin-theme/_admin-dashboard.sass */ +/* line 153, admin-theme/_admin-dashboard.sass */ #dashboard #dashtrends dl:first-child { border-left: none; } -/* line 151, admin-theme/_admin-dashboard.sass */ +/* line 155, admin-theme/_admin-dashboard.sass */ #dashboard #dashtrends dl.active { background-color: #eeeeee; } -/* line 153, admin-theme/_admin-dashboard.sass */ +/* line 157, admin-theme/_admin-dashboard.sass */ #dashboard #dashtrends dt { text-align: center; height: 37px; line-height: 1em; font: 300 1.1em/120% "Ubuntu", sans-serif; } -/* line 158, admin-theme/_admin-dashboard.sass */ +/* line 162, admin-theme/_admin-dashboard.sass */ #dashboard #dashtrends svg { height: 350px; } -/* line 162, admin-theme/_admin-dashboard.sass */ +/* line 166, admin-theme/_admin-dashboard.sass */ #dashboard #dashgoals svg { height: 250px; } -/* line 167, admin-theme/_admin-dashboard.sass */ +/* line 171, admin-theme/_admin-dashboard.sass */ #dashboard #dashaddons { background-color: white; border: 1px dashed #dfdfdf; @@ -10341,33 +10346,33 @@ li.sortable-placeholder { -o-border-radius: 3px; border-radius: 3px; padding: 10px 20px; } -/* line 171, admin-theme/_admin-dashboard.sass */ +/* line 175, admin-theme/_admin-dashboard.sass */ #dashboard #dashaddons a { display: block; } -/* line 173, admin-theme/_admin-dashboard.sass */ +/* line 177, admin-theme/_admin-dashboard.sass */ #dashboard #dashaddons a:hover { text-decoration: none; } -/* line 178, admin-theme/_admin-dashboard.sass */ +/* line 182, admin-theme/_admin-dashboard.sass */ #dashboard #dashactivity svg { height: 150px; } -/* line 185, admin-theme/_admin-dashboard.sass */ +/* line 189, admin-theme/_admin-dashboard.sass */ #dashboard .loading .data_value { min-width: 30px; text-align: center; } -/* line 188, admin-theme/_admin-dashboard.sass */ +/* line 192, admin-theme/_admin-dashboard.sass */ #dashboard .loading .data_value:before { font-size: 0.7em; font-family: FontAwesome; content: "\f021"; color: #cccccc; } -/* line 194, admin-theme/_admin-dashboard.sass */ +/* line 198, admin-theme/_admin-dashboard.sass */ #dashboard .loading .data_value span, #dashboard .loading .data_value small { display: none; } -/* line 196, admin-theme/_admin-dashboard.sass */ +/* line 200, admin-theme/_admin-dashboard.sass */ #dashboard .loading .data_trend { display: none; } -/* line 221, admin-theme/_admin-dashboard.sass */ +/* line 225, admin-theme/_admin-dashboard.sass */ .data_loading, #dashboard .data_value span, #dashboard .data_value .dash_trend { opacity: 1; -webkit-animation-name: bounceG; @@ -10381,7 +10386,7 @@ li.sortable-placeholder { transform: scale(0.7); } @-webkit-keyframes bounceG { - /* line 229, admin-theme/_admin-dashboard.sass */ + /* line 233, admin-theme/_admin-dashboard.sass */ 0% { opacity: 0; filter: alpha(opacity=0); @@ -10389,7 +10394,7 @@ li.sortable-placeholder { -ms-transform: scale(0.1); transform: scale(0.1); } - /* line 232, admin-theme/_admin-dashboard.sass */ + /* line 236, admin-theme/_admin-dashboard.sass */ 100% { opacity: 1; filter: alpha(opacity=100); @@ -10398,7 +10403,7 @@ li.sortable-placeholder { transform: scale(1); } } @-moz-keyframes bounceG { - /* line 229, admin-theme/_admin-dashboard.sass */ + /* line 233, admin-theme/_admin-dashboard.sass */ 0% { opacity: 0; filter: alpha(opacity=0); @@ -10406,7 +10411,7 @@ li.sortable-placeholder { -ms-transform: scale(0.1); transform: scale(0.1); } - /* line 232, admin-theme/_admin-dashboard.sass */ + /* line 236, admin-theme/_admin-dashboard.sass */ 100% { opacity: 1; filter: alpha(opacity=100); @@ -10415,7 +10420,7 @@ li.sortable-placeholder { transform: scale(1); } } @-ms-keyframes bounceG { - /* line 229, admin-theme/_admin-dashboard.sass */ + /* line 233, admin-theme/_admin-dashboard.sass */ 0% { opacity: 0; filter: alpha(opacity=0); @@ -10423,7 +10428,7 @@ li.sortable-placeholder { -ms-transform: scale(0.1); transform: scale(0.1); } - /* line 232, admin-theme/_admin-dashboard.sass */ + /* line 236, admin-theme/_admin-dashboard.sass */ 100% { opacity: 1; filter: alpha(opacity=100); @@ -10432,7 +10437,7 @@ li.sortable-placeholder { transform: scale(1); } } @-o-keyframes bounceG { - /* line 229, admin-theme/_admin-dashboard.sass */ + /* line 233, admin-theme/_admin-dashboard.sass */ 0% { opacity: 0; filter: alpha(opacity=0); @@ -10440,7 +10445,7 @@ li.sortable-placeholder { -ms-transform: scale(0.1); transform: scale(0.1); } - /* line 232, admin-theme/_admin-dashboard.sass */ + /* line 236, admin-theme/_admin-dashboard.sass */ 100% { opacity: 1; filter: alpha(opacity=100); @@ -10449,7 +10454,7 @@ li.sortable-placeholder { transform: scale(1); } } @keyframes bounceG { - /* line 229, admin-theme/_admin-dashboard.sass */ + /* line 233, admin-theme/_admin-dashboard.sass */ 0% { opacity: 0; filter: alpha(opacity=0); @@ -10457,7 +10462,7 @@ li.sortable-placeholder { -ms-transform: scale(0.1); transform: scale(0.1); } - /* line 232, admin-theme/_admin-dashboard.sass */ + /* line 236, admin-theme/_admin-dashboard.sass */ 100% { opacity: 1; filter: alpha(opacity=100); @@ -10465,11 +10470,11 @@ li.sortable-placeholder { -ms-transform: scale(1); transform: scale(1); } } -/* line 236, admin-theme/_admin-dashboard.sass */ +/* line 240, admin-theme/_admin-dashboard.sass */ #dash_version { padding: 0 !important; overflow: hidden; } -/* line 240, admin-theme/_admin-dashboard.sass */ +/* line 244, admin-theme/_admin-dashboard.sass */ #dash_version iframe { height: 80px; width: 100%; } diff --git a/admin-dev/themes/default/css/admin-theme/_admin-dashboard.sass b/admin-dev/themes/default/css/admin-theme/_admin-dashboard.sass index f9538ca27..7deef5b94 100644 --- a/admin-dev/themes/default/css/admin-theme/_admin-dashboard.sass +++ b/admin-dev/themes/default/css/admin-theme/_admin-dashboard.sass @@ -48,6 +48,10 @@ color: white font-size: 1.2em background-color: $brand-primary + .small + font-variant: small-cap + text-transform: uppercase + font-size: 0.7em header.panel-heading color: #555 diff --git a/modules/dashactivity/dashactivity.php b/modules/dashactivity/dashactivity.php index f4567dfe7..b079ad1d2 100644 --- a/modules/dashactivity/dashactivity.php +++ b/modules/dashactivity/dashactivity.php @@ -86,7 +86,7 @@ class Dashactivity extends Module $this->context->smarty->assign(array_merge(array( 'gapi_mode' => $gapi_mode, 'dashactivity_config_form' => $this->renderConfigForm(), - 'date_subtitle' => $this->l('from %s to %s'), + 'date_subtitle' => $this->l('(from %s to %s)'), 'date_format' => $this->context->language->date_format_lite ), $this->getConfigFieldsValues())); return $this->display(__FILE__, 'dashboard_zone_one.tpl'); diff --git a/modules/dashactivity/views/js/dashactivity.js b/modules/dashactivity/views/js/dashactivity.js index c69dff67e..fd5104a9a 100644 --- a/modules/dashactivity/views/js/dashactivity.js +++ b/modules/dashactivity/views/js/dashactivity.js @@ -103,7 +103,7 @@ Date.prototype.format = function(format) { $(document).ready(function() { if (date_subtitle === undefined) - date_subtitle = 'From %s to %s'; + date_subtitle = '(from %s to %s)'; if (date_format === undefined) date_format = 'Y-m-d'; diff --git a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl index 10765fa78..e96fba8f8 100644 --- a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl +++ b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl @@ -158,7 +158,7 @@ {if $gapi_mode}
  • - {l s="Connect to Google Analytics API" mod="dashactivity"} + {l s="Link to your Google Analytics account" mod="dashactivity"}
  • {/if} diff --git a/modules/dashgoals/dashgoals.php b/modules/dashgoals/dashgoals.php index cc6f79e5c..685bc116a 100644 --- a/modules/dashgoals/dashgoals.php +++ b/modules/dashgoals/dashgoals.php @@ -103,7 +103,7 @@ class Dashgoals extends Module $month_row['values'][$type] = ConfigurationKPI::get(strtoupper($key)); } - $this->context->smarty->assign('currency_code', $this->context->currency->iso_code); + $this->context->smarty->assign('currency', $this->context->currency); $this->context->smarty->assign('goals_year', $year); $this->context->smarty->assign('goals_months', $months); return $this->display(__FILE__, 'dashboard_zone_two.tpl'); diff --git a/modules/dashgoals/views/js/dashgoals.js b/modules/dashgoals/views/js/dashgoals.js index 6bd077007..a1f7c51c4 100644 --- a/modules/dashgoals/views/js/dashgoals.js +++ b/modules/dashgoals/views/js/dashgoals.js @@ -22,9 +22,9 @@ function dashgoals_calc_sales() var key = $(this).attr('id').substr(16); var sales = parseFloat($('#dashgoals_traffic_' + key).val()) * parseFloat($('#dashgoals_avg_cart_value_' + key).val()) * parseFloat($('#dashgoals_conversion_' + key).val()) / 100; if (isNaN(sales)) - $(this).text('0'); + $(this).text(formatCurrency(0, currency_format, currency_sign, currency_blank)); else - $(this).text(parseInt(sales)); + $(this).text(formatCurrency(parseInt(sales), currency_format, currency_sign, currency_blank)); }); } diff --git a/modules/dashgoals/views/templates/hook/dashboard_zone_two.tpl b/modules/dashgoals/views/templates/hook/dashboard_zone_two.tpl index de339dcea..9b66c4bc6 100644 --- a/modules/dashgoals/views/templates/hook/dashboard_zone_two.tpl +++ b/modules/dashgoals/views/templates/hook/dashboard_zone_two.tpl @@ -23,6 +23,13 @@ * International Registered Trademark & Property of PrestaShop SA *} + +
    {l s='Goals' mod='dashgoals'} @@ -55,8 +62,10 @@ {$month.label} - +
    + +
    @@ -67,7 +76,7 @@
    - {$currency_code|escape} + {$currency->iso_code|escape}