Skip to content

Commit

Permalink
Include transaction hex (fixes blockcypher#78) and also SEO friendly …
Browse files Browse the repository at this point in the history
…page titles
  • Loading branch information
Michael Flaxman committed Apr 9, 2015
1 parent fac4ef2 commit f34b5d3
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Django==1.7.1
-e git://github.com/blockcypher/blockcypher-python.git@e32ecb184f19ab9fa124afc61f5dd9391ad9738d#egg=blockcypher
-e git://github.com/blockcypher/blockcypher-python.git@547d8d625d83cb04266dd13ad9d85c258e2daeae#egg=blockcypher
dj-database-url==0.3.0
dj-static==0.0.6
django-annoying==0.8.0
Expand Down
5 changes: 4 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
<link rel="icon" type="image/png" href="{% static "img/favicon-32x32.png" %}" sizes="32x32">

<title>
{% block title %}{% trans "Block Explorer for Bitcoin, Litecoin, Dogecoin and More" %}{% endblock %} | BlockCypher
{% block title %}
{% trans "Block Explorer for Bitcoin, Litecoin, Dogecoin and More" %}
{% endblock %}
| BlockCypher
</title>

{# Webfonts #}
Expand Down
4 changes: 3 additions & 1 deletion templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
{% load btc_formats %}
{% load static %}

{% block title %}Dashboard{% endblock title %}
{% block title %}
{% trans "Dashboard" %}
{% endblock title %}

{% block page_header %}
<h1>Dashboard</h1>
Expand Down
6 changes: 5 additions & 1 deletion templates/decodetx.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
{% load btc_formats %}
{% load static %}

{% block title %}
Decode Raw {{ coin_symbol|coin_symbol_to_display_name }} Hexadecimal Transaction
{% endblock %}

{% block page_header %}
<h1>
<i class="fa fa-send"></i>
Decode Your Transaction
Decode A Transaction
</h1>
{% endblock page_header %}

Expand Down
4 changes: 4 additions & 0 deletions templates/pushtx.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
{% load btc_formats %}
{% load static %}

{% block title %}
Push Raw {{ coin_symbol|coin_symbol_to_display_name }} Hexadecimal Transaction
{% endblock %}

{% block page_header %}
<h1>
<i class="fa fa-send"></i>
Expand Down
2 changes: 1 addition & 1 deletion templates/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load i18n %}
{% load staticfiles %}

{% block title %}{% trans "Login" %}{% endblock title %}
{% block title %}{% trans "Sign Up" %}{% endblock title %}

{% block page_header %}
<h1>{% trans "Sign Up" %}</h1>
Expand Down
20 changes: 13 additions & 7 deletions templates/transaction_overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,27 @@ <h2 class="tagline wrapit semi">{{ tx_hash }}</h2>
<table class="table">
{% if transaction.block_hash %}
<tr>
<th>Block Hash</th>
<th>Block Height</th>
<td>
<a href="{% url 'block_overview' coin_symbol transaction.block_hash %}" class="hidden-xs">{{ transaction.block_hash }}</a>
<a href="{% url 'block_overview' coin_symbol transaction.block_hash %}" class="visible-xs">See Block</a>
<a href="{% url 'block_overview' coin_symbol transaction.block_height %}">{{ transaction.block_height|intcomma }}</a>
</td>
</tr>

<tr>
<th>Block Height</th>
<th>Block Hash</th>
<td>
<a href="{% url 'block_overview' coin_symbol transaction.block_height %}">{{ transaction.block_height|intcomma }}</a>
<a href="{% url 'block_overview' coin_symbol transaction.block_hash %}" class="hidden-xs">{{ transaction.block_hash }}</a>
<a href="{% url 'block_overview' coin_symbol transaction.block_hash %}" class="visible-xs">See Block</a>
</td>
</tr>
{% endif %}

<tr>
<th>TX Hex</th>
<td>
<a href="{% url 'decode_tx' coin_symbol %}?t={{ transaction.hex }}">{{ transaction.hex|truncatechars:"32" }}</a>
</td>
</tr>

{% if is_coinbase_tx and coinbase_msg %}
<tr>
<th>Coinbase Message:</th>
Expand All @@ -182,7 +188,7 @@ <h2 class="tagline wrapit semi">{{ tx_hash }}</h2>
{% endif %}
<tr>
<td colspan="2" class="text-center">
<a href="{{ api_url }}" class="btn btn-default">
<a href="{{ api_url }}?includeHex=true" class="btn btn-default">
<i class="fa fa-code"></i>
API Call
</a>
Expand Down
1 change: 1 addition & 0 deletions transactions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def transaction_overview(request, coin_symbol, tx_hash):
coin_symbol=coin_symbol,
limit=500,
api_key=BLOCKCYPHER_API_KEY,
include_hex=True,
)
except AssertionError:
msg = _('Invalid Transaction Hash')
Expand Down

0 comments on commit f34b5d3

Please sign in to comment.