Compare commits

..

No commits in common. "182d0c0c8696e28e3cd094430f18b1a75e0f5e21" and "91e17be830f117a3e4dfa032e5e5cc424a157b51" have entirely different histories.

5 changed files with 5 additions and 20 deletions

View File

@ -1,4 +1,2 @@
.git/
db-importer/
# poetry
poetry.lock
db-importer/

View File

@ -5,12 +5,10 @@ RUN python3 -m pip install poetry
EXPOSE 5000
WORKDIR /app
COPY db_explorer/pyproject.toml /app/
COPY db_explorer/ /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" ]

View File

@ -54,7 +54,6 @@ 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
@ -68,13 +67,8 @@ 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()

View File

@ -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 %}

View File

@ -2,11 +2,6 @@
{% 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 %}