// Code review

This commit is contained in:
Damien Metzger
2013-10-24 17:49:18 +02:00
parent 1a7f9e6c11
commit f6dd4a9ee4
8 changed files with 74 additions and 56 deletions
+52 -47
View File
@@ -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%; }
@@ -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
+1 -1
View File
@@ -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');
@@ -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';
@@ -158,7 +158,7 @@
{if $gapi_mode}
<li>
<span class="data_label">
<a href="{$link->getAdminLink('AdminModules')}&{$gapi_mode}=gapi"><img src="../modules/gapi/logo.gif" width="16" height="16" /> {l s="Connect to Google Analytics API" mod="dashactivity"}</a>
<a href="{$link->getAdminLink('AdminModules')}&{$gapi_mode}=gapi"><img src="../modules/gapi/logo.gif" width="16" height="16" /> {l s="Link to your Google Analytics account" mod="dashactivity"}</a>
</span>
</li>
{/if}
+1 -1
View File
@@ -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');
+2 -2
View File
@@ -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));
});
}
@@ -23,6 +23,13 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<script>
var currency_format = {$currency->format|intval};
var currency_sign = '{$currency->sign|addslashes}';
var currency_blank = {$currency->blank|intval};
var priceDisplayPrecision = 0;
</script>
<section id="dashgoals" class="panel widget">
<header class="panel-heading">
<i class="icon-bar-chart"></i> {l s='Goals' mod='dashgoals'}
@@ -55,8 +62,10 @@
{$month.label}
</td>
<td>
<input id="dashgoals_traffic_{$month@key}" name="dashgoals_traffic_{$month@key}" class="dashgoals_config_input form-control"
value="{$month.values.traffic|intval}" />
<div class="input-group">
<input id="dashgoals_traffic_{$month@key}" name="dashgoals_traffic_{$month@key}" class="dashgoals_config_input form-control"
value="{$month.values.traffic|intval}" />
</div>
</td>
<td>
<div class="input-group">
@@ -67,7 +76,7 @@
</td>
<td>
<div class="input-group">
<span class="input-group-addon">{$currency_code|escape}</span>
<span class="input-group-addon">{$currency->iso_code|escape}</span>
<input id="dashgoals_avg_cart_value_{$month@key}" name="dashgoals_avg_cart_value_{$month@key}" class="dashgoals_config_input form-control"
value="{$month.values.avg_cart_value|intval}" />
</div>