Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/2015-07-29'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pike committed Jul 29, 2015
2 parents c670bca + 7d79f4b commit cd2a63b
Show file tree
Hide file tree
Showing 51 changed files with 6,021 additions and 776 deletions.
3 changes: 3 additions & 0 deletions apps/shipping/static/shipping/js/dashboard.js
Expand Up @@ -20,3 +20,6 @@ jQuery(document).one("scriptsLoaded.exhibit", function(evt) {
}
}
});
jQuery(document).one("exhibitConfigured.exhibit", function(evt) {
$('table.exhibit-tabularView-body').thead();
});
2 changes: 2 additions & 0 deletions apps/shipping/templates/shipping/dashboard.html
Expand Up @@ -23,6 +23,8 @@
{% block javascript_matter %}
<script src="{% static "simile/exhibit/exhibit-api.js" %}?persist=false"></script>
{% compress js %}
<script src="{% static "js/libs/jquery-migrate-1.2.1.min.js" %}"></script>
<script src="{% static "js/libs/jquery.thead-1.1.min.js" %}"></script>
<script src="{% static "shipping/js/dashboard.js" %}"></script>
{% endcompress %}
{% endblock %}
Expand Down
4 changes: 0 additions & 4 deletions apps/shipping/tests/test_signoff.py
Expand Up @@ -87,22 +87,18 @@ def test_status_json(self):
ok_('fx/da' in sos)
so = sos['fx/da']
eq_(so['signoff'], ['accepted', 'pending'])
eq_(so['apploc'], 'fx::da')
eq_(so['tree'], 'fx')
ok_('fx/de' in sos)
so = sos['fx/de']
eq_(so['signoff'], ['accepted'])
eq_(so['apploc'], 'fx::de')
eq_(so['tree'], 'fx')
ok_('fx/fr' in sos)
so = sos['fx/fr']
eq_(so['signoff'], ['rejected'])
eq_(so['apploc'], 'fx::fr')
eq_(so['tree'], 'fx')
ok_('fx/pl' in sos)
so = sos['fx/pl']
eq_(so['signoff'], ['pending'])
eq_(so['apploc'], 'fx::pl')
eq_(so['tree'], 'fx')

def test_ship_milestone(self):
Expand Down
17 changes: 9 additions & 8 deletions apps/shipping/tests/test_views.py
Expand Up @@ -413,21 +413,22 @@ def test_status_json_multiple_locales_multiple_trees(self):
appver4trees = [x for x in struct['items']
if x['type'] == 'AppVer4Tree']

trees = [x['label'] for x in appver4trees]
trees = sorted(x['label'] for x in appver4trees)
# note that trees without an appversion isn't returned
eq_(trees, [tree.code, tree2.code, tree3.code])
appversions = [x['appversion'] for x in appver4trees]
# nor are appversions that don't accept sign-offs
eq_(trees, [tree2.code, tree3.code])
appversions = sorted(x['appversion'] for x in appver4trees)
# note that appversion without an appversion isn't returned
eq_(appversions, [appver.code, appver2.code, appver3.code])
eq_(appversions, [appver2.code, appver3.code])

# query a specific set of trees
data = {'tree': [tree2.code, tree3.code]}
response = self.client.get(url, data)
struct = json.loads(response.content)
appver4trees = [x for x in struct['items']
if x['type'] == 'AppVer4Tree']
trees = [x['label'] for x in appver4trees]
eq_(trees, [tree.code, tree2.code, tree3.code])
trees = sorted(x['label'] for x in appver4trees)
eq_(trees, [tree2.code, tree3.code])

# query a specific set of trees, one which isn't implemented by any
# appversion
Expand All @@ -436,10 +437,10 @@ def test_status_json_multiple_locales_multiple_trees(self):
struct = json.loads(response.content)
appver4trees = [x for x in struct['items']
if x['type'] == 'AppVer4Tree']
trees = [x['label'] for x in appver4trees]
trees = sorted(x['label'] for x in appver4trees)
# tree4 is skipped because there's no appversion for that one
assert not Run.objects.all()
eq_(trees, [tree.code, tree2.code, tree3.code])
eq_(trees, [tree3.code])

# Now, let's add some Runs
run = Run.objects.create(
Expand Down
7 changes: 7 additions & 0 deletions apps/shipping/views/app.py
Expand Up @@ -174,6 +174,13 @@ def changes(request, app_code):
'name': '%s .next' % str(av),
'changes': newso
})
addcount = len([t for t in newso if t[1]=='added'])
if addcount:
rows[-1].update({
'rowspan': 1,
'rowspan_last': True,
'group_locales_count': '+%d' % addcount
})

return render(request, 'shipping/app-changes.html', {
'appver': av,
Expand Down
24 changes: 4 additions & 20 deletions apps/shipping/views/status.py
Expand Up @@ -273,18 +273,7 @@ def get_signoffs(self):
else:
avq['id__in'] = currently_building

apps = list(AppVersion.objects
.filter(**avq)
.values_list('app', flat=True)
.distinct())
if len(apps) == 1:
given_app = Application.objects.get(id=apps[0]).code
else:
given_app = None
if apps:
appvers = AppVersion.objects.filter(app__in=apps)
else:
appvers = AppVersion.objects.all()
appvers = AppVersion.objects.filter(**avq)
lq = {}
if self.locales:
lq['code__in'] = self.locales
Expand All @@ -293,13 +282,10 @@ def get_signoffs(self):
tree_avs = (AppVersion.trees.through.objects
.current()
.filter(appversion__in=appvers))
tree2av = dict(tree_avs.values_list("tree__code", "appversion__code"))
av2tree = dict((av, tree) for tree, av in tree2av.iteritems())
tree2app = dict(tree_avs.values_list("tree__code",
"appversion__app__code"))
av2tree = dict(tree_avs.values_list("appversion__code", "tree__code"))
values = dict(Action._meta.get_field('flag').flatchoices)
so_items = {}
for av in AppVersion.objects.filter(**avq):
for av in appvers:
for loc, (real_av, flags) in locflags4av[av].iteritems():
flag_values = [
(real_av == av.code or f != Action.ACCEPTED) and values[f]
Expand All @@ -311,15 +297,13 @@ def get_signoffs(self):
items = [{"type": "SignOff",
"label": "%s/%s" % (tree, locale),
"tree": tree,
"apploc": ("%s::%s" % (given_app or tree2app[tree],
locale)),
"signoff": sorted(values)}
for (tree, locale), values in sorted(so_items.iteritems(),
key=lambda t:t[0])]
items += [{"type": "AppVer4Tree",
"label": tree,
"appversion": av}
for tree, av in tree2av.iteritems()]
for av, tree in av2tree.iteritems()]
return items

def content(self, request, items):
Expand Down
6 changes: 5 additions & 1 deletion elmo/static/css/style.css
Expand Up @@ -7,6 +7,10 @@ table {
border-spacing: 0;
}

#tabzilla:before {
background-color: #484848;
}

#masthead {
margin-bottom: 48px;
}
Expand Down Expand Up @@ -100,12 +104,12 @@ table.standard tr {
}
table.exhibit-tabularView-body tr {
background-color: #eee; /* fallback color if gradients are not supported */
background-image: linear-gradient(to bottom, white, #eee);
background-image: -webkit-gradient(linear, left top, left bottom, from(white), to(#eee));
background-image: -webkit-linear-gradient(top, white, #eee);
background-image: -moz-linear-gradient(top, white, #eee);
background-image: -ms-linear-gradient(top, white, #eee);
background-image: -o-linear-gradient(top, white, #eee);
background-image: linear-gradient(to bottom, white, #eee);
border-top: 1px solid #ccc;
}
table.exhibit-tabularView-body td,
Expand Down
34 changes: 34 additions & 0 deletions elmo/static/css/tabzilla.css
@@ -0,0 +1,34 @@
#tabzilla {
position: relative;
float: right;
}
#tabzilla a {
position: relative;
display: block;
width: 147px;
height: 37px;
text-indent: 120%;
white-space: nowrap;
overflow: hidden;
background-image: url('../img/tabzilla-static.png');
background-repeat: no-repeat;
z-index: 2;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx) {
#tabzilla a {
background-image: url("../img/tabzilla-static-high-res.png");
-webkit-background-size: 147px 37px;
background-size: 147px 37px;
}
}
#tabzilla:before {
position: absolute;
display: block;
left: 28px;
top: 0;
width: 88px;
height: 26px;
content: '';
background-color: transparent;
z-index: 1;
}
Binary file added elmo/static/img/tabzilla-static-high-res.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added elmo/static/img/tabzilla-static.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 18 additions & 4 deletions elmo/static/simile/exhibit/exhibit-api.js
Expand Up @@ -12,7 +12,7 @@ var Exhibit = {
* The version number for Exhibit.
* @constant
*/
version: "3.0.0",
version: "3.1.2-rc1",

/**
* The XML namespace for Exhibit.
Expand Down Expand Up @@ -72,7 +72,8 @@ var Exhibit = {
"babel": undefined,
"backstage": undefined,
"locale": undefined,
"persist": true
"persist": true,
"dev": false
},

/**
Expand All @@ -81,7 +82,7 @@ var Exhibit = {
Extension: {},

_dependencies: {
"lib/jquery-1.7.2.min.js": "jQuery",
"lib/jquery-1.11.3.min.js": "jQuery",
"lib/json2.js": "JSON",
"lib/base64.js": "Base64",
"lib/sprintf.js": "sprintf",
Expand Down Expand Up @@ -175,10 +176,18 @@ var Exhibit = {
"scripts/ui/facets/numeric-range-facet.js",
"scripts/ui/facets/alpha-range-facet.js",
"scripts/ui/facets/cloud-facet.js",
"scripts/ui/facets/image-facet.js",
"scripts/ui/facets/slider-facet.js",
"scripts/ui/facets/slider.js",
"scripts/ui/facets/text-search-facet.js",
"scripts/ui/facets/hierarchical-facet.js",
"scripts/ui/facets/timegrid-facet.js",
"scripts/ui/facets/week-facet.js",
"scripts/ui/facets/month-facet.js",
"scripts/ui/facets/dstructs.js",
"scripts/ui/facets/util/date.js",
"scripts/ui/facets/date-l10n.js",
"scripts/ui/facets/util/jquery.prettybox.js",
"scripts/ui/views/view.js",
"scripts/ui/views/view-panel.js",
"scripts/ui/views/ordered-view-frame.js",
Expand Down Expand Up @@ -209,10 +218,13 @@ var Exhibit = {

"styles": [
"styles/graphics.css",
"styles/bubbles.css",
"styles/exhibit.css",
"styles/browse-panel.css",
"styles/lens.css",
"styles/control-panel.css",
"styles/timegrid.css",
"styles/theme-sandy-stone-beach-ocean-diver.css",
"styles/util/facets.css",
"styles/util/views.css",
"styles/views/view-panel.css",
Expand Down Expand Up @@ -471,7 +483,8 @@ Exhibit.load = function() {
"babel": String,
"backstage": String,
"locale": String,
"persist": Boolean
"persist": Boolean,
"dev": Boolean
};

if (typeof Exhibit_urlPrefix === "string") {
Expand Down Expand Up @@ -501,6 +514,7 @@ Exhibit.load = function() {
if ((arg.length === 2) &&
(arg[0]==="exhibit-dev") &&
(arg[1]==="true")) {
Exhibit.params.dev = true;
Exhibit.params.bundle = false;
Exhibit.params.persist = false;
}
Expand Down
2 changes: 1 addition & 1 deletion elmo/static/simile/exhibit/exhibit-scripted-bundle.js

Large diffs are not rendered by default.

0 comments on commit cd2a63b

Please sign in to comment.