Skip to content

Commit

Permalink
Merge branch 'develop' into develop-no-blacklight
Browse files Browse the repository at this point in the history
* develop:
  Rename obsolete catalogues filter text to publications
  Do not allow the creation of folders of users
  In the folder filters, select only users with folders
  Fix current folder filder behaviour and create a couple more
  Allow editors to view users #1356
  Added 240m to sru
  Make id in html view clickable

# Conflicts:
#	app/admin/folder.rb
#	app/controllers/catalog_controller.rb
  • Loading branch information
xhero committed Jun 12, 2023
2 parents c2e5dc0 + 3956e53 commit b598d40
Show file tree
Hide file tree
Showing 13 changed files with 527 additions and 17 deletions.
21 changes: 18 additions & 3 deletions app/admin/folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,24 @@ def permitted_params
###########
## Index ##
###########

# Solr search all fields: "_equal"
filter :name_equals, :label => proc {I18n.t(:filter_full_name)}, :as => :string

# Solr search substring: "_cont"
filter :name_cont, :label => proc { I18n.t(:any_field_contains) },
as: :string
# Filter by the wf_owner
filter :wf_owner_equals, :label => proc { I18n.t(:filter_owner) },
as: :select,
collection: proc {
if current_user.has_any_role?(:editor, :admin)
User.find(Folder.distinct.pluck(:wf_owner)).pluck(:name, :id).sort
else
[[current_user.name, "wf_owner:#{current_user.id}"]]
end
}
# Filter by folder type
filter :folder_type, :label => proc { I18n.t(:filter_folder_type) },
as: :select,
collection: proc { Folder.distinct.pluck(:folder_type) }

filter :wf_owner, :label => proc {I18n.t(:filter_owner)}, as: :select,
collection: proc {
Expand Down
5 changes: 1 addition & 4 deletions app/admin/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ActiveAdmin.register User do
menu :parent => "admin_menu", :label => proc {I18n.t(:menu_users)}, :if => proc{ can? :manage, User }
menu :parent => "admin_menu", :label => proc {I18n.t(:menu_users)}, :if => proc{ (can? :manage, User) || current_user.has_role?(:editor)}

permit_params :preference_wf_stage, :email, :password, :password_confirmation,
:username, :name, :notifications, :notification_type, :notification_email,
Expand Down Expand Up @@ -77,9 +77,6 @@ def update
render :partial => "activeadmin/section_sidebar_index"
end

# Include the folder actions
include FolderControllerActions

##########
## Show ##
##########
Expand Down
Loading

0 comments on commit b598d40

Please sign in to comment.