Skip to content

Commit

Permalink
Fix menu matches on some plugins and fix reordering of backend menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Jun 29, 2010
1 parent f64277f commit c65799c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
Expand Up @@ -20,7 +20,7 @@ def self.up
when "Settings"
"refinery_settings"
when "Resources"
"refinery_resources"
"refinery_files"
else
plugin.name
end)
Expand Down Expand Up @@ -48,7 +48,7 @@ def self.down
"Refinery"
when "refinery_settings"
"Settings"
when "refinery_resources"
when "refinery_files"
"Resources"
else
plugin.name
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/refinery/admin.js
Expand Up @@ -115,7 +115,7 @@ init_sortable_menu = function(){
axis: 'x',
cursor: 'crosshair',
update: function(){
var ser = $menu.sortable('serialize', {key: 'menu[]'}),
var ser = $menu.sortable('serialize', {key: 'menu[]', expression: /plugin_([\w]*)$/}),
token = escape($('#admin_authenticity_token').val());

$.get('/refinery/update_menu_positions?' + ser, {authenticity_token: token});
Expand Down
3 changes: 2 additions & 1 deletion vendor/plugins/dashboard/rails/init.rb
@@ -1,6 +1,7 @@
Refinery::Plugin.register do |plugin|
plugin.title = "Dashboard"
plugin.name = "dashboard"
plugin.name = "refinery_dashboard"
plugin.menu_match = /(admin|refinery)\/(refinery_)?dashboard$/
plugin.description = "Gives an overview of activity in Refinery"
plugin.directory = "dashboard"
plugin.version = 1.0
Expand Down
@@ -1,9 +1,9 @@
class Admin::RefineryCoreController < Admin::BaseController

def update_plugin_positions
params[:menu].each do |plugin_name|
params[:menu].each_with_index do |plugin_name, index|
if (plugin = current_user.plugins.find_by_name(plugin_name))
plugin.update_attribute(:position, params[:menu].index(plugin_name))
plugin.update_attribute(:position, index)
end
end
render :nothing => true
Expand Down
2 changes: 1 addition & 1 deletion vendor/plugins/refinery/app/views/admin/_menu.html.erb
Expand Up @@ -2,7 +2,7 @@
<% Refinery::Plugins.active.in_menu.each do |plugin| -%>
<%= link_to plugin.title, plugin.url,
:class => (plugin.highlighted?(params) ? "active" : ""),
:id => "plugin_#{plugin.title}" %>
:id => "plugin_#{plugin.name}" %>
<% end -%>
<% if Refinery::Plugins.active.in_menu.many? and RefinerySetting.find_or_set(:refinery_enable_backend_reordering, true) -%>
<%= link_to refinery_icon_tag('arrow_switch.png'), "",
Expand Down
2 changes: 1 addition & 1 deletion vendor/plugins/resources/rails/init.rb
@@ -1,7 +1,7 @@
Refinery::Plugin.register do |plugin|
plugin.title = "Files"
plugin.name = "refinery_files"
plugin.menu_match = /(refinery|admin)\/resources$/
plugin.menu_match = /(refinery|admin)\/(refinery_)?(files|resources)$/
plugin.description = "Upload and link to files"
plugin.version = 1.0
plugin.activity = {
Expand Down

0 comments on commit c65799c

Please sign in to comment.