Skip to content
This repository was archived by the owner on Oct 29, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion app/assets/javascripts/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ $(document).ready(function() {
});

$('.tooltipster').tooltipster({
trigger: 'click'
trigger: 'click',
functionInit: function(instance, helper){

var $origin = $(helper.origin),
dataOptions = $origin.attr('data-tooltipster');

if(dataOptions){

dataOptions = JSON.parse(dataOptions);

$.each(dataOptions, function(name, option){
instance.option(name, option);
});
}
}
});
});
23 changes: 22 additions & 1 deletion app/assets/stylesheets/built.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ Styleguide 2.5
*/
.card {
position: relative;
box-shadow: 0 0 10px #ccc;
box-shadow: 0 0 7px #ccc;
/* Types */ }
.card.text-center {
text-align: center; }
Expand Down Expand Up @@ -2517,6 +2517,10 @@ table {
font-size: 0.8em; }
table tbody td p + p {
margin-top: 10px; }
table tbody td a {
text-decoration: none; }
table tbody td a:hover {
text-decoration: underline; }
table.borderless tbody td {
border: none; }

Expand All @@ -2533,6 +2537,7 @@ markup:
Styleguide 2.14
*/
.bitcoin-address {
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand Down Expand Up @@ -4639,6 +4644,22 @@ Styleguide 3.4
.tooltip_templates {
display: none; }

.actions-on-hover .bitcoin-address {
vertical-align: middle; }

.actions-on-hover .actions {
display: inline-block;
margin-left: 5px;
vertical-align: middle;
opacity: 0;
-webkit-transition: opacity 0.2s cubic-bezier(0.55, 0, 0.1, 1);
-moz-transition: opacity 0.2s cubic-bezier(0.55, 0, 0.1, 1);
transition: opacity 0.2s cubic-bezier(0.55, 0, 0.1, 1);
color: #AAA; }

.actions-on-hover:hover .actions {
opacity: 1; }

/*
Basic Components

Expand Down
4 changes: 4 additions & 0 deletions app/models/bitcoin_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ def update_balance
end
end

def to_s
bitcoin_address
end

end
6 changes: 5 additions & 1 deletion app/models/signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ def create_bitcoin_address_if_needed
self.bitcoin_address_id = btc_addr.id
end
end
end
end
end

def to_s
signature
end

end
15 changes: 15 additions & 0 deletions app/views/arguments/_signatures.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.card.text-center
h3 #{btc_human(bitcoin_value)} #{percent_human(percentage)} #{word}
.content
.section
.table-container
table class="table borderless"
- signatures.each do |s|
tr.actions-on-hover
td
p.bitcoin-address= link_to s.bitcoin_address, address_path(s.bitcoin_address)
td
p= btc_human(s.bitcoin_address.balance)
td
span.actions
span.icon.icon-info-circled.tooltipster title="Signature: #{s}" data-tooltipster='{"interactive":true}'
49 changes: 18 additions & 31 deletions app/views/arguments/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
=button_tag "Submit", class:"button"
.section
.alert.transparent
| Warning:
| Warning:
a href="https://www.reddit.com/r/btc/comments/4mhjh3/psa_bitcoinocracycom_signatures_expose_your/" rel="nofollow" target="_blank" Bitcoin signatures expose your public keys
| (that shouldn't be a problem until
| (that shouldn't be a problem until
a href="https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm" rel="nofollow" target="_blank" ECDSA
| is broken). Moreover address reuse with a faulty random number generator
| is broken). Moreover address reuse with a faulty random number generator
a href="http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html" rel="nofollow" target="_blank" may leak your private keys
|.
=hidden_field("signature", "negation", {value: @is_doubt, autocomplete: false})
Expand All @@ -60,7 +60,7 @@
- if @argument.pros_sum > 0 && @argument.cons_sum > 0 && @argument.pros_sum == @argument.cons_sum
h3 This proposition is currently tied.
p Vote now by signing with your bitcoin signature above.

.button-group.center
a.button href="https://forum.bitcoin.com/bitcoin-discussion/" Discuss this proposition
.section
Expand All @@ -76,39 +76,26 @@
/ .argument-score
/ .bar.positive style="flex-basis: #{percent_human(@argument.pros_share)};"= percent_human(@argument.pros_share)
/ .bar.negative style="flex-basis: #{percent_human(@argument.cons_share)};"= percent_human(@argument.cons_share)

- if @argument.pros_sum > 0 && @argument.cons_sum > 0
.section
.card-group.horizontal
.card.text-center
h3 #{btc_human(@argument.pros_sum)} #{percent_human(@argument.pros_share)} Believe
.content
.section
.table-container
- [@argument.pros].each_with_index do |addresses, i|
table class="table borderless #{i==0 ? 'bg-success' : 'bg-danger'}"
- addresses.each do |address|
tr
td
p.bitcoin-address= link_to address.bitcoin_address, address_path(address.bitcoin_address)
td
p= btc_human address.balance
.card.text-center
h3 #{btc_human(@argument.cons_sum)} #{percent_human(@argument.cons_share)} Doubt
.content
.section
.table-container
- [@argument.cons].each_with_index do |addresses, i|
table class="table borderless #{i==0 ? 'bg-success' : 'bg-danger'}"
- addresses.each do |address|
tr
td
p.bitcoin-address= link_to address.bitcoin_address, address_path(address.bitcoin_address)
td
p= btc_human address.balance
= render partial: 'signatures', locals: { \
signatures: @argument.pro_signatures, \
bitcoin_value: @argument.pros_sum, \
percentage: @argument.pros_share, \
word: "Believe" }

= render partial: 'signatures', locals: { \
signatures: @argument.con_signatures, \
bitcoin_value: @argument.cons_sum, \
percentage: @argument.cons_share, \
word: "Doubt" }

div#signature_status style='display:none'

small =link_to "All signatures as JSON", argument_path(@argument, :json)

input type='hidden' name='pro_statement' id='pro_statement' value=@argument.pro_statement
input type='hidden' name='con_statement' id='con_statement' value=@argument.con_statement

Expand Down
1 change: 1 addition & 0 deletions styleguide/components/_bitcoin_address.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Styleguide 2.14
*/

.bitcoin-address {
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
2 changes: 1 addition & 1 deletion styleguide/components/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Styleguide 2.5
*/
.card {
position: relative;
box-shadow: 0 0 10px #ccc;
box-shadow: 0 0 7px #ccc;

&.text-center {
text-align: center;
Expand Down
21 changes: 21 additions & 0 deletions styleguide/components/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,24 @@
.tooltip_templates {
display: none;
}

.actions-on-hover {
.bitcoin-address {
vertical-align: middle;
}

.actions {
display: inline-block;
margin-left: 5px;
vertical-align: middle;
opacity: 0;
transition: opacity 0.2s $easing;
color: #AAA;
}

&:hover {
.actions {
opacity: 1;
}
}
}
8 changes: 8 additions & 0 deletions styleguide/components/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ table {
margin-top: 10px;
}
}

a {
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
}

Expand Down