Open lnussel opened 7 years ago
@lnussel could you make an example of how you would like to add tabs?
I have no clue about rails, so don't ask me about the how :) There's for example the dashboard engine (https://github.com/openSUSE/obs_factory) which may want to add a tab for itself for projects it cares for.
There is no non-hackish way to do that. Only nasty ways like conditional rendering of tab entries based on if an engine is there or not...
maybe something like
<% @extra_tabs.each do |args| %> <%= tab args %> <% end %>
where the arguments for @extra_tabs could be populated by an engine during init?
actually if a loop works there the logic what to put in the array could be moved from the view to the controller.
that's not the challenge - the challenge is how to give the engine a way to change the data
The project view shows a number of tabs as can be seen here: https://build.opensuse.org/project/show/openSUSE:Factory
The available tabs are hardcoded in https://github.com/openSUSE/open-build-service/blob/master/src/api/app/views/webui/project/_tabs.html.erb so plugable engines like the Factory dashboard can't add more.
Please provide hooks to allow adding tabs via engine