Skip to content

Commit 6caf79b

Browse files
committed
account and portraits
1 parent 356dff8 commit 6caf79b

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

app/models/account.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,20 @@ def set_expected_portrait!
210210
# Yes, it's presentation in a model, I'm sorry. The way we currently work,
211211
# we need this in the objects attributes for the frontend.
212212
def portrait_css(expected = false, size = 75)
213+
#print "TEST"
213214
_portrait = expected ? expected_portrait : portrait
215+
216+
begin
217+
puts "ACC:3 " + _portrait
218+
rescue SystemCallError
219+
puts "ACC:2 " + _portrait
220+
221+
# raise
222+
end
223+
224+
# puts "ACC: " + expected if expected?
225+
#puts "ACC: " + expected_portrait
226+
214227
return 'display: none;' if !_portrait || _portrait.blank?
215228
portrait_position = BnetScraper::Starcraft2.portrait_position(_portrait)
216229
if portrait_position.present?

app/views/home/_support.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
padding:0.62em;
66
}
77
article {
8-
font:1.2em/1.62 sans-serif;
8+
font:1.05em/1.47 sans-serif;
99
}
1010

1111
h15,h25,h35 {

app/views/players/show.html.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<script>
2+
console.log('test')
3+
</script>
14
<div id="player" ng-controller="PlayerController">
25
<div id="heading" class="inset">
36
<div class="content player">

app/views/users/_accounts.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<a href class="ggtipper underline clicky" ng-click="toggle()" data-gravity="nw"><span class="tiny" >Example</span></a>
2929
<div class="ggtipcontent">
3030
<div id="find-your-profile" class="settings-tip">
31-
<p>Tell us about your Battle.Net Account so we can customize GGTracker for you. Here's how:</p><br>
31+
<p>Tell us about your Battle.Net Account so we can customize GGGReplays for you. Here's how:</p><br>
3232

3333
<ul>
3434
<li>Log into Battle.Net by clicking <a target="_blank" href="http://battle.net/sc2?login">here</a></li>
@@ -61,7 +61,7 @@
6161

6262
<p>and then hit the UPDATE button. Afterwards, you may change your portrait back.</p>
6363
<br>
64-
<p>(There's a bug with the 4th Anniversary portraits, please change to something else for the authentication process)</p>
64+
<p>(There's a bug with some portraits, please change to something else (Kachinsky) for the authentication process)</p>
6565
</div>
6666
</div>
6767
<br />
@@ -98,6 +98,6 @@
9898
<% if false %>
9999
<a class="add" href ng-click="addAccount()">GGGReplays Pro: Add Another Account</a>
100100
<br>
101-
<a class="add" href="cancel">Cancel GGTracker Pro</a>
101+
<a class="add" href="cancel">Cancel GGGReplays Pro</a>
102102
<% end %>
103103
</div>

lib/patch/bnet_scraper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ module BnetScraper
77
module Starcraft2
88
# Returns the map file and position of a portrait by name
99
def self.portrait_position(name)
10+
print "Apple "
11+
print "Apple puts"
1012
index = PORTRAITS.flatten(1).collect(&:downcase).index(name.to_s.downcase)
1113
if index.nil?
1214
return nil
@@ -34,4 +36,4 @@ def portrait_css(size = 75)
3436
"background: url('/assets/sc2/portraits/#{portrait_position[0]}-#{size}.jpg') -#{portrait_position[1]*size}px -#{portrait_position[2]*size}px no-repeat;"
3537
end
3638
end
37-
end
39+
end

spec/models/account_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
it 'should output correct portrait_css' do
4949
account = Account.new
5050
account.portrait = 'Thatcher'
51-
51+
# puts "ACC:4"
5252
account.portrait_css(false, 75).should == "background: url('/assets/sc2/portraits/0-75.jpg') -150px -0px no-repeat;"
5353
end
5454
end

0 commit comments

Comments
 (0)