-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3982de6
commit 34a7a89
Showing
7 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class AddressesController < ApplicationController | ||
|
||
def index | ||
@addresses = BitcoinAddress.all.page params[:page] | ||
|
||
redirect_to address_path(params[:bitcoin_address]) if params[:bitcoin_address].present? | ||
end | ||
|
||
def show | ||
@address = BitcoinAddress.find_by_bitcoin_address(params[:id]) | ||
|
||
if @address.blank? | ||
redirect_to addresses_path, alert: "Sorry, bitcoin address '#{params[:id]}' is not found in the database" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- model_class = BitcoinAddress | ||
- title "Bitcoin addresses" | ||
|
||
h1 =t '.title', :default => model_class.model_name.human.pluralize.titleize | ||
|
||
form.navbar-form role="search" action="#{addresses_path}" method="get" | ||
.input-group | ||
input.form-control type="text" placeholder="Go to bitcoin address..." name="bitcoin_address" | ||
span.input-group-btn | ||
button.btn.btn-default type="submit" | ||
span.fa.fa-search aria-hidden="true" | ||
|
||
div | ||
- @addresses.each do |address| | ||
div | ||
| #{btc_human address.balance}: | ||
= link_to address.bitcoin_address, address_path(address.bitcoin_address) | ||
|
||
= paginate @addresses, :theme => 'twitter-bootstrap-3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- title "Signed by #{@address.bitcoin_address}" | ||
h1 #{@address.bitcoin_address} | ||
.lead Balance: #{btc_human @address.balance} | ||
.lead Statements signed: | ||
|
||
ul | ||
- @address.signatures.shuffle.each do |signature| | ||
li.lead | ||
= link_to signature.message, argument_path(signature.argument), class: (signature.negation? ? 'text-danger' : 'text-success') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters