Using active_link_to if defined (falling back to link_to)#22
Using active_link_to if defined (falling back to link_to)#22johanandre wants to merge 14 commits intomasterfrom
Conversation
- Cleaning up concat of html (no longer need html_safe on generated output) - Removing inline html (except the icon chevron) - When a block is passed to sidebar_item (for generating a dropdown), an random id is created
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: {toggle: 'collapse'})) | ||
| concat(content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do |
| content_tag :li do | ||
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: {toggle: 'collapse'})) |
There was a problem hiding this comment.
Line is too long. [116/80]
Space inside { missing.
Space inside } missing.
| def sidebar_item(title, url, &block) | ||
| def sidebar_item(title, url = nil, &block) | ||
| if block_given? | ||
| url = "##{(0...20).map { ('a'..'z').to_a[rand(26)] }.join}" unless url.present? |
| end | ||
|
|
||
| def sidebar_item(title, url, &block) | ||
| def sidebar_item(title, url = nil, &block) |
There was a problem hiding this comment.
Assignment Branch Condition size for sidebar_item is too high. [16.16/15]
Method has too many lines. [13/10]
Unused method argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
| content_tag :li do | ||
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{title} #{dropdown_arrow_icon}".html_safe, url, data: { toggle: 'collapse' })) |
| def sidebar_item(title, url, &block) | ||
| def sidebar_item(title, url = nil, &block) | ||
| if block_given? | ||
| url = "##{(0...20).map { ('a'..'z').to_a.sample }.join }" unless url.present? |
There was a problem hiding this comment.
Space inside string interpolation detected.
Line is too long. [85/80]
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{title} #{dropdown_arrow_icon}".html_safe, url, data: {toggle: 'collapse'})) | ||
| concat(content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do |
| content_tag :li do | ||
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{title} #{dropdown_arrow_icon}".html_safe, url, data: {toggle: 'collapse'})) |
There was a problem hiding this comment.
Line is too long. [103/80]
Space inside { missing.
Space inside } missing.
| end | ||
|
|
||
| def sidebar_item(title, url, &block) | ||
| def sidebar_item(title, url = nil, &block) |
There was a problem hiding this comment.
Method has too many lines. [11/10]
Unused method argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
| content_tag :li do | ||
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{ title } #{ dropdown_arrow_icon }".html_safe, url, data: { toggle: 'collapse' })) |
There was a problem hiding this comment.
Space inside string interpolation detected.
Line is too long. [109/80]
| concat( | ||
| link_to("#{ title } #{ dropdown_arrow_icon }".html_safe, url, data: {toggle: 'collapse'}) | ||
| ) | ||
| concat(content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do |
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat( | ||
| link_to("#{ title } #{ dropdown_arrow_icon }".html_safe, url, data: {toggle: 'collapse'}) |
There was a problem hiding this comment.
Indent the first parameter one step more than the start of the previous line.
Space inside string interpolation detected.
Line is too long. [103/80]
Space inside { missing.
Space inside } missing.
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat( | ||
| link_to("#{ title } #{ dropdown_arrow_icon }".html_safe, url, data: {toggle: 'collapse'}) |
There was a problem hiding this comment.
Space inside string interpolation detected.
Line is too long. [101/80]
Space inside { missing.
Space inside } missing.
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat( | ||
| link_to("#{ title } #{ arrow_icon }".html_safe, url, data: {toggle: 'collapse'}) |
There was a problem hiding this comment.
Space inside string interpolation detected.
Space inside { missing.
Line is too long. [92/80]
Space inside } missing.
| link_to("#{ title } #{ arrow_icon }".html_safe, | ||
| url, data: { toggle: 'collapse' }) | ||
| ) | ||
| concat(content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do |
| end | ||
|
|
||
| def sidebar_item(title, url, &block) | ||
| def sidebar_item(title, url = nil, &block) |
There was a problem hiding this comment.
Method has too many lines. [14/10]
Unused method argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
| ) | ||
| concat( | ||
| content_tag(:ul, class: 'submenu collapse', | ||
| id: url.delete('#')) do |
There was a problem hiding this comment.
Align the elements of a hash literal if they span more than one line.
| end | ||
| html.html_safe | ||
| concat( | ||
| link_to("#{ title } #{ arrow_icon }".html_safe, |
There was a problem hiding this comment.
Space inside string interpolation detected.
| end | ||
|
|
||
| def sidebar_item(title, url, &block) | ||
| def sidebar_item(title, url = nil, &block) |
There was a problem hiding this comment.
Method has too many lines. [17/10]
Unused method argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{ title } #{ arrow_icon }".html_safe, url, data: { toggle: 'collapse' })) | ||
| concat(content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do |
| content_tag :li do | ||
| html = link_to("#{title} <i class='fa fa-chevron-right'></i>".html_safe, url, data: { toggle: 'collapse' }) | ||
| html << content_tag(:ul, class: 'submenu collapse', id: url.delete('#')) do | ||
| concat(link_to("#{ title } #{ arrow_icon }".html_safe, url, data: { toggle: 'collapse' })) |
There was a problem hiding this comment.
Space inside string interpolation detected.
Line is too long. [100/80]
| content_tag :div, id: 'sidebar-wrapper' do | ||
| html = link_to '', options[:brand_url], class: 'sidebar-brand hidden-sm-down' | ||
| html << content_tag(:ul, class: 'sidebar-nav') do | ||
| concat(link_to '', options[:brand_url], class: 'sidebar-brand hidden-sm-down') |
There was a problem hiding this comment.
Add parentheses to nested method call link_to '', options[:brand_url], class: 'sidebar-brand hidden-sm-down'.
Line is too long. [88/80]
|
I fiddled around to please Hound but ended up in some shitty looking code, thats why there is a bunch of commits changing stuff back and forth... :) |
AnteWall
left a comment
There was a problem hiding this comment.
Its better then it was before, however the biggest problem we had before is that we can't customize it. It would be nice if we could modify the classes that its append. (i.e the nav-link etc...)
Perhaps change them completely by sending in our own class.
|
Well, since it moves the sidebar helpers to a working state (from not working that great), although not adding everything, I think we should merge it anyway. Of course I'm open for solving the customization in a later pull request. |
closes #10