Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Compability with simple-navigation 4.0.0#15

Open
pzgz wants to merge 3 commits into
pdf:masterfrom
pzgz:master
Open

Compability with simple-navigation 4.0.0#15
pzgz wants to merge 3 commits into
pdf:masterfrom
pzgz:master

Conversation

@pzgz

@pzgz pzgz commented Dec 4, 2015

Copy link
Copy Markdown

This fixed worked for me in a while, with simple-navigation 4, also listed in #13

I am not sure if it can work with simple-navigation prior 4.0.0 or not, so I simply forced the gemspec to work only with ver 4+.
@pzgz

pzgz commented Dec 4, 2015

Copy link
Copy Markdown
Author

@zealot128 Sure thing, just did. Thanks^_^

@webchi

webchi commented Feb 10, 2016

Copy link
Copy Markdown

Work for me with simple-navigation 4.0.3

@gltarsa

gltarsa commented Jan 11, 2017

Copy link
Copy Markdown

While this fix enabled the use of link_html wonderfully, it causes options, like icon: [fa fa-ticket] to stop working. In our app, that means code like this:

    primary.item :ticket,
      "Ticket",
      url_for('//mycompany/ticket'),
      link_html: { target: '_blank' },
      icon: ['fa fa-ticket'],
      if: -> { can? :create, Ticket }

No longer works as it did. That snippet used to render as a small ticket icon followed by the word "Ticket" now renders as just the word. No CSS for the icon is present in the view. I am investigating the problem, but cannot promise I will be able to deliver a fix.

@pdf

pdf commented Jan 11, 2017

Copy link
Copy Markdown
Owner

This project is looking for a maintainer, the reason I haven't merged this is that I have not had time to test it against all supported features.

@gltarsa

gltarsa commented Jan 12, 2017

Copy link
Copy Markdown

I understand. My ruby skills are not yet up to taking this on, though I spent some time trying to debug it. I was hoping the author of the PR might be able to look into it. FWIW, I found another gem that does something similar simple_navigation_bootstrap and let that author know about your desire to pass the torch. Unfortunately for me, that gem has the same problem. I think something changed in the 4.0.0 release with regard to renderers and the wiki has not been updated.

@gltarsa

gltarsa commented Jan 12, 2017

Copy link
Copy Markdown

I found the problem with the icon code. Apparently the icon options have moved and are no longer in li_options.

Replacing line 10 in lib/simple_navigation/rendering/renderer/bootstrap.rb (icon = li_options.delete(:icon)) with icon = item.send("options")[:icon] fixes the problem.

options is not exposed in the Item class, so the send is necessary to workaround that.

I was unable to get the tests running, or I would have added one for this. Unfortunately, I have spent much more time on this than I expected and have to get my code into production.

@pzgz, you may want to change your PR to include this.

pzgz and others added 2 commits July 29, 2018 00:22
If skip_if_empty is set, the parent item won't be rendered if there's no children in it
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants