Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
app transaction list page (bug 825262)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Jan 10, 2013
1 parent 3ef31ef commit d08c79d
Show file tree
Hide file tree
Showing 16 changed files with 468 additions and 163 deletions.
7 changes: 7 additions & 0 deletions apps/constants/payments.py
Expand Up @@ -73,6 +73,13 @@
CONTRIB_VOLUNTARY: _('Voluntary'),
}

MKT_TRANSACTION_CONTRIB_TYPES = {
CONTRIB_CHARGEBACK: _('Chargeback'),
CONTRIB_INAPP: _('In-app Purchase'),
CONTRIB_PURCHASE: _('Purchase'),
CONTRIB_REFUND: _('Refund'),
}

CONTRIB_TYPE_DEFAULT = CONTRIB_VOLUNTARY

INAPP_STATUS_ACTIVE = 0
Expand Down
14 changes: 7 additions & 7 deletions apps/stats/models.py
Expand Up @@ -14,7 +14,7 @@

import amo
from amo.helpers import absolutify, urlparams
from amo.models import ModelBase, SearchMixin
from amo.models import SearchMixin
from amo.fields import DecimalCharField
from amo.utils import send_mail, send_mail_jinja
from zadmin.models import DownloadSource
Expand Down Expand Up @@ -430,12 +430,12 @@ def get_or_create(cls, request):
else:
lang = translation.get_language()
client_data, c = cls.objects.get_or_create(
download_source=download_source,
device_type=request.POST.get('device_type', ''),
user_agent=request.META.get('HTTP_USER_AGENT', ''),
is_chromeless=request.POST.get('chromeless', False),
language=lang,
region=region)
download_source=download_source,
device_type=request.POST.get('device_type', ''),
user_agent=request.META.get('HTTP_USER_AGENT', ''),
is_chromeless=request.POST.get('chromeless', False),
language=lang,
region=region)
return client_data

class Meta:
Expand Down
1 change: 0 additions & 1 deletion apps/stats/tasks.py
Expand Up @@ -5,7 +5,6 @@
from django.db import connection, transaction
from django.db.models import Sum, Max


from apiclient.discovery import build
import requests
import commonware.log
Expand Down
42 changes: 42 additions & 0 deletions media/css/devreg/transactions.less
@@ -0,0 +1,42 @@
@import 'lib';

th.amount, td.amount {
text-align: right;
}

#tx-filters {
margin-bottom: 52px;
label {
display: inline-block;
margin-right: 5px;
text-align: right;
width: 110px;
}
.date-to label {
width: 50px
}
button {
bottom: 26px;
float: right;
position: relative;
}
.form-elem, .errorlist, .errorlist li {
display: inline;
}
.errorlist li {
left: 5px;
position: relative;
}
}
.date-from {
float: left;
}
.form-row {
margin-bottom: 13px;
}

.results-found {
clear: both;
display: block;
margin-bottom: 13px;
}
146 changes: 146 additions & 0 deletions media/css/mkt/data-grid.less
@@ -0,0 +1,146 @@
@import '../devreg/lib';

/* data grids */
.data-grid-top {
border-bottom: 1px solid #A5BFCE;
}
.data-grid-bottom {
border-top: 1px solid #A5BFCE;
}
.data-grid-content {
padding: 5px;

ol.pagination {
margin: 0;
}
&:after {
content: ".";
display: block;
clear: both;
height: 0;
visibility: hidden;
}
}

table.data-grid {
margin-bottom: 0;
width: 100%;
thead th {
background: @faded-blue;
a {
&:active, &:hover, &:visited {
color: #36b;
}
}
&.ordered {
.gradient-two-color(@faded-blue, @border-blue);
a {
color: #137;
&:active, &:hover, &:visited {
color: #039;
}
}
}
}
tr {
td {
border-top: 1px dotted @border-gray;
}
a {
display: block;
}
&:nth-child(odd) {
background-color: #FAFAFA;
}
&:nth-child(even) {
background-color: @white;
}
}
.addon-locked {
width: 16px;
height: 16px;
position: relative;
top: 4px;
}
.locked .addon-locked {
background: url(../../img/mkt/icons/mkt-reviewer-icons.png) no-repeat top left;
background-position: -16px -16px;
}
ul {
margin: 0;
}
}

@media (min-width: @tablet-min) {
.data-grid {
thead th {
&:nth-child(3) {
min-width: 7em;
}
&:nth-child(4) {
min-width: 8em;
}
&:nth-child(5) {
min-width: 90px;
}
&:nth-child(6) {
min-width: 7em;
}
&:nth-child(7) {
min-width: 7em;
}
&:nth-child(8) {
min-width: 10em;
}
}
tr {
th, td {
padding: 7px 10px;
}
}
th {
line-height: 1.3;
}
.addon-row a {
max-width: 600px;
}
}
}

@media (max-width: @landscape-max) {
.data-grid {
tr {
th, td {
border: 1px solid @faint-gray;
line-height: 12px;
font-size: 11px;
padding: 4px 2px;
text-align: center;
}
// Don't add borders around table cell for locked icon.
th:nth-child(1),
td:nth-child(1) {
border-right: 0;
}
th:nth-child(2),
td:nth-child(2) {
border-left: 0;
}
}
thead th {
&:nth-child(2) {
max-width: 300px;
}
&:nth-child(6) {
min-width: 55px;
}
&:nth-child(7) {
min-width: 45px;
}
}
th {
font-weight: 400;
vertical-align: middle;
}
}
}

0 comments on commit d08c79d

Please sign in to comment.