Compare commits
3 Commits
91e17be830
...
182d0c0c86
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
182d0c0c86 | ||
|
|
b459f5f4b1 | ||
|
|
6c1b479bd5 |
@ -1,2 +1,4 @@
|
||||
.git/
|
||||
db-importer/
|
||||
db-importer/
|
||||
# poetry
|
||||
poetry.lock
|
||||
|
||||
@ -5,10 +5,12 @@ RUN python3 -m pip install poetry
|
||||
EXPOSE 5000
|
||||
WORKDIR /app
|
||||
|
||||
COPY db_explorer/ /app/
|
||||
COPY db_explorer/pyproject.toml /app/
|
||||
|
||||
RUN poetry update
|
||||
RUN poetry run pip install setuptools
|
||||
|
||||
COPY db_explorer/ /app/
|
||||
|
||||
ENTRYPOINT [ "poetry", "run" ]
|
||||
CMD [ "gunicorn", "-b=0.0.0.0:5000", "db_explorer:app" ]
|
||||
@ -54,6 +54,7 @@ def list_actions():
|
||||
@app.route("/action/<name>")
|
||||
def show_action(name):
|
||||
item = mongo.db.action.find_one_or_404({"name": name})
|
||||
# Actions
|
||||
if item["data"]["actions"]["value"] == None:
|
||||
if item["data"]["actionType"]["value"] == 'passive':
|
||||
item['_action_icon'] = None
|
||||
@ -67,8 +68,13 @@ def show_action(name):
|
||||
item['_action_icon'] = item["data"]["actions"]["value"]
|
||||
else:
|
||||
raise ValueError(f'Unknown action: {item["data"]["actionType"]["value"]} - {item["data"]["actions"]["value"]}')
|
||||
|
||||
# Traits
|
||||
_traits = item.get("data", {}).get("traits", {})
|
||||
item["_all_traits"] = []
|
||||
item["_all_traits"].append(_traits.get("rarity", {}).get("value", "unkown rarity"))
|
||||
item["_all_traits"] += _traits.get("value", [])
|
||||
item["_all_traits"] += _traits.get("custom").split(',')
|
||||
return render_template("action.html", action=item)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
app.run()
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
{% block head %}
|
||||
<title>{% block title %}PF2 DB{% endblock %}</title>
|
||||
{% endblock %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/base.css') }}"
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/base.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
|
||||
@ -2,6 +2,11 @@
|
||||
{% block title %}{{action.name}} - PF2 DB{% endblock %}
|
||||
{% block body %}
|
||||
<h1>{{action["name"]}}{{c.actions[action["_action_icon"]]|safe}}</h1>
|
||||
<ul class="traits">
|
||||
{%- for trait in action["_all_traits"] %}
|
||||
<li class="trait">{{trait|upper}}</li>
|
||||
{% endfor -%}
|
||||
</ul>
|
||||
<p>{{action["data"]["description"]["value"]|filter_vtt|safe}}</p>
|
||||
<p class="sourcebook">{{action["data"]["source"]["value"]}}</p>
|
||||
{% endblock %}
|
||||
Loading…
Reference in New Issue
Block a user