In Redmine how to add my custom plugin inside Project Menu Bar? - ruby-on-rails

I'm trying to add my Plugin inside a project's menu eg. I want to use my plugin as: https://redmine-site/projects/test-project/my-plugin
Like in this image i want to link my plugin after SPENT TIME in the menu.

You can add link to your custom controller (or any other place) in project menu. use this code in your init.rb
menu :project_menu, :plugin_example, { controller: :example, action: :say_hello}, caption: :label_sample, after: :time_entries, :param => :project_id

You have to add the link to your custom controller and add the permissions otherwise its not shown.
permission :performancedetail, { :performance => [:index, :vote] }, :public => true
menu :project_menu, :performancedetail, { controller: 'performance', action: 'index' }, caption: 'Performance'

Related

How can i change confirm message button delete in Active Admin

this my app/admin/author- enter image description here
How can i change delete button in admin/authors (index)
I need change only confirm message
How can i do this?
I try:
actions :all, :except => [:destroy] and then add custom actions default: true and create custon button, and its work i get custom message, but i can't destroy some author, because when i actions :all, :except => [:destroy], this delete route for deleting author
If relying on jquery does not bother you, add this to app/assets/javascripts/active_admin.js
$(document).ready(function () {
$('a.delete_link').data('confirm', 'is this what you really want?');
/* narrow down with selector for specificity */
$('table#index_table_authors a.delete_link').data('confirm', 'must this author really be destroyed?');
});
Or

How to add a custom button on the ActiveAdmin show view?

Here's where I'd like to add a new button:
I'd like to add a new button on the upper right, pointing to a custom URL based on some properties in the user the page is referring to.
I couldn't find the right options here.
They call them action items:
action_item :import_demo, only: :show do
link_to 'Import Demo', '#'
end

how to change the text of navbar link in activeadmin

How can I replace the Link text on active-admin navbar for a model?
I have a model: OpportunityConsultantPairing, which I'm registering in active-admin as follow:
ActiveAdmin.register OpportunityConsultantPairing do
controller do
before_filter { #page_title = "Project Pairings" }
end
end
setting #page_title only changes the Title, what I want to do however is to change both the title, as well as the navbar-link text as shown below:
How can one go about this? thank you.
Try this
ActiveAdmin.register OpportunityConsultantPairing do
menu label: "Project Pairings"
controller do
before_filter { #page_title = "Project Pairings" }
end
end
for more info check here:- http://activeadmin.info/docs/2-resource-customization.html
Try this
ActiveAdmin.register AdminUser, as: 'User' do
# code...
end
Navigation label will be changes as 'user/users' instead of 'admin_users'
routes will be configured automatically as '.../admin/users' instead of '.../admin/admin_users'.

How can i set the default menus for Rhomobile Application?

Currently on going for menu, it shows some options like sync, close, home.
Since i don't have any such functionality of sync, so i just need to be able to manage them. Or if i could able to add my own custom menu it would be quite well for me.
Please help.
You can handle the default menu on the application.rb file. You can set the required default menu like below,
# default options menu
#default_menu = {
"Home" => :home,
"Refresh" => :refresh,
"Close" => :close
}
Even you can set the custom menu as like this,
# default options menu
#default_menu = {
"Home" => :home,
"Refresh" => :refresh,
"Close" => :close,
"Custom" => '/app/MyModel'
}
Check here http://docs.rhomobile.com/rhodes/ui#application-menu

how to add a new tab in spree admin panel?

I created a controller under Spree::Admin module and also I have mentioned in
routes.rb
match '/admin/new_tab => 'spree/admin/new_controller#index'
but this is working in front end.
How can I move this page to admin panel with new tab?
To make this controller work only if admin is signed in (like the other controllers in Admin namespace), it should inherit from Admin::BaseController.
To make the new tab, you should probably create Deface, something like this:
Deface::Override.new(:virtual_path => "spree/layouts/admin",
:name => "admin_content_admin_tab_parser",
:insert_bottom => "[data-hook='admin_tabs']",
:text => "<%= tab :new_tab, :url => 'admin/new_tab', :icon => 'icon-th-large' %>",
:disabled => false)

Resources