jbox-web / simple_navigation_bootstrap Goto Github PK
View Code? Open in Web Editor NEWA Ruby gem that adds Bootstrap renderers for SimpleNavigation
License: MIT License
A Ruby gem that adds Bootstrap renderers for SimpleNavigation
License: MIT License
I am trying to move our app away from the simple-navigation-bootstrap
gem to this one and have managed to get everything working, but I have one problem: when I click on a primary item in the nav bar, I need to click it a second time to see the menu.
Is this expected behavior? Is there a way to configure it to display the menu on the first click?
Thanks for developing this package. A similar package, simple-navigation-bootstrap is looking for a maintainer. You should consider taking it over. Your code seems better organized.
I am running into a problem where options, like icon: [fa fa-ticket] to disappear when our app uses this package. 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 }
Now appears to ignore the icon: ['fa fa-ticket']
option. That snippet used to render as a small ticket icon followed by the word "Ticket" now renders as just "Ticket" with no icon. 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.
For some reason I haven't been able to find, the Bootstrap4 renderer is not registering in my app. To try and figure this out, I added a test for the renderer registers for Bootstrap4 and got the same:
"Uninitialized constant "SimpleNavigationBootstrap::Bootstrap4"
I have tried my best to figure out why the Boostrap4 renderer isn't registering but no luck so far. I'm sure I'm overlooking something simple and will keep trying but thought I'd go ahead and report it.
We use this gem in our production app and recently I noticed that every time the nav bar gets rendered a series of log messages of the form:
------------ #prepare_name: {:text=>"Inventory", :icon=>"fa fa-cube"}
------------ and is a Hash
------------ content_tag: <i class="fa fa-cube"></i> Inventory
------------ #prepare_name: Movements
------------ #prepare_name: Movements
...
I don't see this statement in the repo, but I did find it in the installed gem:
$ ack '#prepare_name'
.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/simple_navigation_bootstrap-1.0.1/lib/simple_navigation_bootstrap/bootstrap_base.rb
70: Rails.logger.info "------------ #prepare_name: #{name}"
I am assuming it is debugging code that somehow escaped into the wild?
Hi
I've got this error...
Could not find gem 'simple-navigation-bootstrap' in https://github.com/jbox-web/simple_navigation_bootstrap.git (at master@52625c4).
The source does not contain any versions of 'simple-navigation-bootstrap'
gem 'simple-navigation-bootstrap',git: 'https://github.com/jbox-web/simple_navigation_bootstrap.git'
and if I don't put the "git url" it's the 1.0.0 version which is installed, I don't understand why.
Thank for your help
I'm splitting my navigation into two seperate divs. One at the top and one as a sidebar.
simple-navigation provides a :level
setting to archive this functionality (docs)
Using the Bootstrap3 renderer, the second menu is hidden (display: none;
) as it is rendered like a dropdown menu.
View:
= render_navigation expand_all: true, level: 2
Navigation settings:
navigation.renderer = SimpleNavigationBootstrap::Bootstrap3
navigation.items do |primary|
primary.item :main, 'Main', main_url do |sub_nav|
sub_nav.item :sub, 'Sub', sub_url
end
end
Level 2 should be rendered like level 1, level 3 like level 2 and so on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.