Skip to content

Commit

Permalink
Merge pull request #22 from offish/v2.0.4
Browse files Browse the repository at this point in the history
improvements to gui
  • Loading branch information
offish authored Dec 13, 2023
2 parents cc325b5 + 6cc275c commit 9ba9417
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion express/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__title__ = "tf2-express"
__author__ = "offish"
__license__ = "MIT"
__version__ = "2.0.3"
__version__ = "2.0.4"
6 changes: 5 additions & 1 deletion express/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ def summarize_items(items: list[dict]) -> dict:
item_name = items[item]["market_hash_name"]

if item_name not in summary:
summary[item_name] = {"count": 1, "image": items[item]["icon_url"]}
summary[item_name] = {
"count": 1,
"image": items[item]["icon_url"],
"color": items[item]["name_color"],
}
else:
summary[item_name]["count"] += 1

Expand Down
11 changes: 8 additions & 3 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="" style="color:var(--green); margin-left: 5%;">tf2-express</a>
<a class="navbar-brand" href="/" style="color:var(--green); margin-left: 5%;">tf2-express</a>
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/?db={{ db_name }}">Home</a>
Expand All @@ -26,11 +26,10 @@
<a class="nav-link" href="/trades?db={{ db_name }}">Trades</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown"
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Database ({{ db_name }})
</a>
<!-- TODO: fix dropdown menu -->
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% for db in database_names %}
<a class="dropdown-item" href="?db={{ db }}">{{ db }}</a>
Expand All @@ -46,6 +45,12 @@
{% block contents %}
{% endblock %}
</div>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+"
crossorigin="anonymous"></script>
</body>

</html>
4 changes: 2 additions & 2 deletions templates/trades.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3>Our items ({{ trade.our_items|length }}x)</h3>
{% for item in trade.our_summary %}
<div>
<img src="https://community.akamai.steamstatic.com/economy/image/{{ trade.our_summary[item].image }}"
style="width: 75px;">
style="width: 75px; margin:10px; background-color: #{{ trade.our_summary[item].color }}">
{{ trade.our_summary[item].count }}x {{ item }}
</div>
{% endfor %}
Expand All @@ -50,7 +50,7 @@ <h3>Their items ({{ trade.their_items|length }}x)</h3>
{% for item in trade.their_summary %}
<div>
<img src="https://community.akamai.steamstatic.com/economy/image/{{ trade.their_summary[item].image }}"
style="width: 75px;">
style="width: 75px; margin:10px; background-color: #{{ trade.their_summary[item].color }}">
{{ trade.their_summary[item].count }}x {{ item }}
</div>
{% endfor %}
Expand Down

0 comments on commit 9ba9417

Please sign in to comment.