Skip to content
This repository
Browse code

allow the ability to pass in a url to go back to. If it exists, and l…

…ink will show up for a user to tap on to bring them back to Play.
  • Loading branch information...
commit 2b7fdd7673bfdbfd809907e9a29616d7044d91aa 1 parent 954b545
Jon Maddox maddox authored
2  app/app.rb
@@ -103,6 +103,8 @@ def current_user
103 103 end
104 104
105 105 get "/token" do
  106 + @back_to = params[:back_to]
  107 +
106 108 content_type :html
107 109 mustache :token, :layout => false
108 110 end
7 app/frontend/styles/base.css.scss
@@ -97,7 +97,7 @@ a:hover {
97 97
98 98 #token{
99 99 background-color: #ffffff;
100   - padding: 10px 40px 10px 40px;
  100 + padding: 10px 40px 40px 40px;
101 101 }
102 102
103 103 #token h2{
@@ -115,6 +115,11 @@ a:hover {
115 115 color: $purple;
116 116 }
117 117
  118 +#token a{
  119 + display: block;
  120 + text-align: center;
  121 +}
  122 +
118 123
119 124 /* NOW PLAYING */
120 125
6 app/templates/token.mustache
@@ -27,6 +27,12 @@
27 27 Use this token to access Play from any of the numerous Play clients available.
28 28
29 29 <p id="user-token">{{token}}</p>
  30 +
  31 + {{#back_to}}
  32 + <a href="{{back_to}}">Back to Play &rarr;</a>
  33 + {{/back_to}}
  34 +
  35 +
30 36 </section>
31 37
32 38
4 app/views/token.rb
@@ -6,6 +6,10 @@ def token
6 6 @current_user.token
7 7 end
8 8
  9 + def back_to
  10 + @back_to
  11 + end
  12 +
9 13 end
10 14 end
11 15 end

0 comments on commit 2b7fdd7

Please sign in to comment.
Something went wrong with that request. Please try again.