浏览代码

Add viewer for nightly commits

master
Fen Dweller 5 年前
父节点
当前提交
27c5cb4c7b
共有 3 个文件被更改,包括 89 次插入0 次删除
  1. +11
    -0
      app.py
  2. +16
    -0
      static/changelog.css
  3. +62
    -0
      templates/commits.html

+ 11
- 0
app.py 查看文件

@@ -55,5 +55,16 @@ def changelog():

return render_template("changelog.html", games=games)

@app.route('/commits')
def commits():
game_names = ["stroll", "feast", "gorge", "satiate"]
games = []
for game in game_names:
data = json.load(open("nightly/{0}/nightly.json".format(game)))
games.append({"name": game, "commits": data})

return render_template("commits.html", games=games)

if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0', port=5002)


+ 16
- 0
static/changelog.css 查看文件

@@ -280,4 +280,20 @@ h3 {
font-size: 40px;
padding-top: 10px;
padding-bottom: 5px;
}

.commit-date {
font-size: 175%;
color: #999;
}

.commit-subject {
font-size: 125%;
text-indent: 1.5em;
}

.commit-body {
font-size: 100%;
color: #aaa;
margin-left: 3em;
}

+ 62
- 0
templates/commits.html 查看文件

@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>

<head>
<title>crux.sexy</title>
<link rel="stylesheet" type="text/css" href="changelog.css">
<script>
window.onload = () => {
window.scrollTo(0, -500);
window.addEventListener("hashchange", function scroll() {
window.scrollTo(0, -500);
});
};
</script>
</head>

<body>
<a class="changelog-banner" href="/">
<div class="changelog-text">
back
</div>
</a>
<div class="flex-container">
<a href="#stroll" class="game-button-small" id="game-button-stroll">
<img class="game-logo" src="/images/stroll-transparent.png">
</a>
<a href="#feast" class="game-button-small" id="game-button-feast">
<img class="game-logo" src="/images/feast-transparent.png">
</a>
<a href="#gorge" class="game-button-small" id="game-button-gorge">
<img class="game-logo" src="/images/gorge-transparent.png">
</a>
<a href="#satiate" class="game-button-small" id="game-button-satiate">
<img class="game-logo" src="/images/satiate-transparent.png">
</a>
</div>
<div class="changelog-fade">

</div>
{% for game in games %}
<div class="changelogs" id="{{game.name}}">
{% set ns = namespace(last="") %}
{% for entry in game.commits %}
<div class="changelog">
{% if ns.last != entry.date %}
{% set ns.last = entry.date %}
<div class="commit-date">{{entry.date}}</div>
<br>
{% endif %}
<div class="commit-subject">{{entry.subject|safe}}</div>
<br>
<div class="commit-body">{{entry.body|safe}}</div>
</div>
{% endfor %}
</div>

{% endfor %}

</body>

</html>

正在加载...
取消
保存