Handle level 8

This commit is contained in:
Alexandre Aubin 2019-04-29 20:29:08 +00:00
parent 318992cec5
commit 5a9d14162b
3 changed files with 20 additions and 12 deletions

View file

@ -46,14 +46,17 @@ def get_lists_history():
cmd = 'cd ./.work/apps; git checkout `git rev-list -1 --before="%s" master`' cmd = 'cd ./.work/apps; git checkout `git rev-list -1 --before="%s" master`'
os.system(cmd % t.strftime("%b %d %Y")) os.system(cmd % t.strftime("%b %d %Y"))
# Merge community and official if t < datetime(2019,4,4):
community = json.loads(open("./.work/apps/community.json").read()) # Merge community and official
official = json.loads(open("./.work/apps/official.json").read()) community = json.loads(open("./.work/apps/community.json").read())
for key in official: official = json.loads(open("./.work/apps/official.json").read())
official[key]["state"] = "official" for key in official:
merged = {} official[key]["state"] = "official"
merged.update(community) merged = {}
merged.update(official) merged.update(community)
merged.update(official)
else:
merged = json.loads(open("./.work/apps/apps.json").read())
# Save it # Save it
json.dump(merged, open('./.work/merged_lists.json.%s' % t.strftime("%y-%m-%d"), 'w')) json.dump(merged, open('./.work/merged_lists.json.%s' % t.strftime("%y-%m-%d"), 'w'))
@ -179,7 +182,7 @@ def make_count_summary():
for state in states: for state in states:
summary[state] = len([ k for k, infos in j.items() if infos["state"] == state ]) summary[state] = len([ k for k, infos in j.items() if infos["state"] == state ])
for level in range(0,8): for level in range(0,9):
summary["level-%s"%level] = len([ k for k, infos in j.items() \ summary["level-%s"%level] = len([ k for k, infos in j.items() \
if infos["state"] in ["working", "official"] \ if infos["state"] in ["working", "official"] \
and infos.get("level", None) == level ]) and infos.get("level", None) == level ])

View file

@ -39,6 +39,9 @@
<label class="btn btn-sm btn-light"> <label class="btn btn-sm btn-light">
<input type="radio" name="options" level="7" autocomplete="off"> 7 <input type="radio" name="options" level="7" autocomplete="off"> 7
</label> </label>
<label class="btn btn-sm btn-light">
<input type="radio" name="options" level="8" autocomplete="off"> 8
</label>
</div> </div>
<button id="filter_onlyOfficials" type="button" class="btn btn-light btn-sm" href="javascript:void(0)" onclick="toggle(this)" style="margin-left:30px;">Show only officials</button> <button id="filter_onlyOfficials" type="button" class="btn btn-light btn-sm" href="javascript:void(0)" onclick="toggle(this)" style="margin-left:30px;">Show only officials</button>
</div> </div>
@ -139,7 +142,8 @@ window.onload = function () {
{ y: $(".ci-app-level[value=4]").length, label: "Level 4", color: "#CBB052" }, { y: $(".ci-app-level[value=4]").length, label: "Level 4", color: "#CBB052" },
{ y: $(".ci-app-level[value=5]").length, label: "Level 5", color: "#A6B255" }, { y: $(".ci-app-level[value=5]").length, label: "Level 5", color: "#A6B255" },
{ y: $(".ci-app-level[value=6]").length, label: "Level 6", color: "#7AB659" }, { y: $(".ci-app-level[value=6]").length, label: "Level 6", color: "#7AB659" },
{ y: $(".ci-app-level[value=7]").length, label: "Level 7", color: "#5cb85c" } { y: $(".ci-app-level[value=7]").length, label: "Level 7", color: "#5cb85c" },
{ y: $(".ci-app-level[value=8]").length, label: "Level 8", color: "#4695d5" }
] ]
}] }]
}); });

View file

@ -16,7 +16,8 @@ window.onload = function () {
"#CBB052", "#CBB052",
"#A6B255", "#A6B255",
"#7AB659", "#7AB659",
"#5cb85c" "#5cb85c",
"#4695d5"
]; ];
var colors_per_state = { var colors_per_state = {
@ -36,7 +37,7 @@ window.onload = function () {
shared: true shared: true
}, },
data: [ data: [
{% for level in range(7,-1,-1) %} {% for level in range(8,-1,-1) %}
{ {
color: colors_per_level[{{ level }}], color: colors_per_level[{{ level }}],
type: "stackedArea", type: "stackedArea",