forked from fixin.me/fixin.me
Do not display application menu links with current url
Add "Recover password" link
This commit is contained in:
parent
3f2a92a6e5
commit
17e3f2e100
1
app/assets/images/pictograms/lock-reset.svg
Normal file
1
app/assets/images/pictograms/lock-reset.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" id="icon" viewBox="0 0 24 24"><path d="M12.63,2C18.16,2 22.64,6.5 22.64,12C22.64,17.5 18.16,22 12.63,22C9.12,22 6.05,20.18 4.26,17.43L5.84,16.18C7.25,18.47 9.76,20 12.64,20A8,8 0 0,0 20.64,12A8,8 0 0,0 12.64,4C8.56,4 5.2,7.06 4.71,11H7.47L3.73,14.73L0,11H2.69C3.19,5.95 7.45,2 12.63,2M15.59,10.24C16.09,10.25 16.5,10.65 16.5,11.16V15.77C16.5,16.27 16.09,16.69 15.58,16.69H10.05C9.54,16.69 9.13,16.27 9.13,15.77V11.16C9.13,10.65 9.54,10.25 10.04,10.24V9.23C10.04,7.7 11.29,6.46 12.81,6.46C14.34,6.46 15.59,7.7 15.59,9.23V10.24M12.81,7.86C12.06,7.86 11.44,8.47 11.44,9.23V10.24H14.19V9.23C14.19,8.47 13.57,7.86 12.81,7.86Z" /></svg>
|
After Width: | Height: | Size: 671 B |
@ -32,12 +32,9 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def image_link_to(name, image = nil, options = nil, html_options = nil)
|
def image_link_to(name, image = nil, options = nil, html_options = nil)
|
||||||
|
return "" if html_options.delete(:unless_current) && (url_for(options) == request.path)
|
||||||
|
|
||||||
name = svg_tag("pictograms/#{image}.svg#icon") + name if image
|
name = svg_tag("pictograms/#{image}.svg#icon") + name if image
|
||||||
if html_options.delete(:hide)
|
|
||||||
# NOTE: current_path? does not work for POST
|
|
||||||
visibility = (url_for(options) == request.path) ? 'hidden' : 'visible'
|
|
||||||
html_options.merge!(style: "visibility: #{visibility}") { |k, v1, v2| v1 + v2 }
|
|
||||||
end
|
|
||||||
link_to name, options, html_options
|
link_to name, options, html_options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -16,9 +16,11 @@
|
|||||||
<%= image_link_to t(:sign_out), "logout", destroy_user_session_path,
|
<%= image_link_to t(:sign_out), "logout", destroy_user_session_path,
|
||||||
data: { turbo_method: :delete } %>
|
data: { turbo_method: :delete } %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= image_link_to t(:sign_in), "login", new_user_session_path, hide: true %>
|
|
||||||
<%= image_link_to t(:register), "account-plus-outline", new_user_registration_path,
|
<%= image_link_to t(:register), "account-plus-outline", new_user_registration_path,
|
||||||
hide: true %>
|
unless_current: true %>
|
||||||
|
<%= image_link_to t(:recover_password), "lock-reset", new_user_password_path,
|
||||||
|
unless_current: true %>
|
||||||
|
<%= image_link_to t(:sign_in), "login", new_user_session_path, unless_current: true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
|
||||||
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
||||||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -11,3 +11,4 @@ en:
|
|||||||
register: "Register"
|
register: "Register"
|
||||||
sign_in: "Sign in"
|
sign_in: "Sign in"
|
||||||
sign_out: "Sign out"
|
sign_out: "Sign out"
|
||||||
|
recover_password: "Recover password"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user