Skip to content

Commit c012c87

Browse files
committed
rewrite css and restricted login message
1 parent bc63056 commit c012c87

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

app/assets/stylesheets/includes/main.scss

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ section {
226226
}
227227
}
228228

229-
a, button.calnet_login {
229+
a {
230230
&:hover {
231231
box-shadow: inset 0 -4px 0 $color-anchor-highlight;
232232
}
@@ -257,23 +257,26 @@ section {
257257
}
258258

259259
&.restricted {
260-
form {
261-
button.calnet_login {
262-
box-shadow: inset 0 -4pxq 0 $color-anchor-highlight;
260+
form.auth {
261+
margin-right: auto;
262+
margin-bottom: 0.25rem;
263263

264-
&:hover {
265-
background: $color-anchor-highlight;
266-
border: 1px solid $color-anchor-highlight;
264+
div.access_methods {
265+
button.calnet_login {
266+
box-shadow: inset 0 -4px 0 $color-anchor-highlight;
267+
268+
&:hover {
269+
background: $color-anchor-highlight;
270+
border: 1px solid $color-anchor-highlight;
271+
}
267272
}
268-
}
269-
}
270-
p {
271-
a {
272-
box-shadow: inset 0 -4px 0 $color-anchor-highlight;
273+
a {
274+
box-shadow: inset 0 -4px 0 $color-anchor-highlight;
273275

274-
&:hover {
275-
background: $color-anchor-highlight;
276-
border: 1px solid $color-anchor-highlight;
276+
&:hover {
277+
background: $color-anchor-highlight;
278+
border: 1px solid $color-anchor-highlight;
279+
}
277280
}
278281
}
279282
}
@@ -412,9 +415,8 @@ span {
412415
button.calnet_login {
413416
background: inherit;
414417
margin: inherit;
415-
border: none;
416-
line-height: inherit;
417-
font-family: inherit;
418-
font-size: inherit;
419-
text-decoration: inherit;
418+
padding: inherit;
419+
border: inherit;
420+
font: inherit;
421+
display: inline;
420422
}

app/helpers/application_helper.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ def logout_link(text = 'CalNet Logout')
99

1010
def login_link(text = 'CalNet Login')
1111
form_tag('/auth/calnet', url: request.original_url, method: 'post', data: { turbo: false }) do
12-
button_tag text, class: 'calnet_login'
12+
login_button text
1313
end
1414
end
1515

16+
def login_button(text = 'CalNet Login')
17+
button_tag text, class: 'calnet_login', role: 'link'
18+
end
19+
1620
def vpn_link
1721
link_to('use the bSecure VPN', 'https://www.lib.berkeley.edu/using-the-libraries/vpn')
1822
end

app/views/player/access_restricted.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22
<%
33
calnet_only = record&.calnet_only?
44
access_methods = [].tap do |mm|
5-
mm << login_link('Log in with CalNet') unless authenticated?
5+
mm << login_button('log in with CalNet') unless authenticated?
66
mm << vpn_link unless calnet_only || ucb_request?
77
end
88
%>
99
<section class="record restricted">
1010
<h1>Access to this record is restricted</h1>
1111

12-
<p>
12+
<%= form_tag('/auth/calnet', url: request.original_url, method: 'post', data: { turbo: false }, class: 'auth') do %>
13+
<div class="access_methods">
1314
The specified record is available to UC Berkeley users only.
1415
<% unless access_methods.empty? # should never happen %>
1516
For full access, <%= access_methods.join(', or ').html_safe %>.
1617
<% end %>
17-
</p>
18+
</div>
19+
<% end %>
1820
1921
<table>
2022
<thead>

config/routes.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# Omniauth automatically handles requests to /auth/:provider. We need only
55
# implement the callback.
6-
get '/login', to: 'sessions#new', as: :login
76
get '/logout', to: 'sessions#destroy', as: :logout
87
get '/auth/:provider/callback', to: 'sessions#callback', as: :omniauth_callback
98
get '/auth/failure', to: 'sessions#failure'

spec/support/authz_shared_examples.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
expect(page).to have_content(collection)
2828
expect(page).to have_content(record_id)
2929

30-
show_url = player_url(collection:, record_id:)
30+
# show_url = player_url(collection:, record_id:)
3131
expect(page).to have_css('button.calnet_login')
3232
end
3333
end

0 commit comments

Comments
 (0)