Skip to content

Commit

Permalink
Finish removing dead Featured Researcher code
Browse files Browse the repository at this point in the history
Follows #997.
  • Loading branch information
mjgiarlo committed May 23, 2017
1 parent d7d701e commit e47bf71
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 179 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/hyrax.js
Expand Up @@ -47,7 +47,6 @@
//= require hyrax/trophy
//= require hyrax/facets
//= require hyrax/featured_works
//= require hyrax/featured_researcher
//= require hyrax/batch_select_all
//= require hyrax/browse_everything
//= require hyrax/search
Expand Down
14 changes: 0 additions & 14 deletions app/assets/javascripts/hyrax/featured_researcher.js

This file was deleted.

3 changes: 1 addition & 2 deletions app/controllers/hyrax/content_blocks_controller.rb
@@ -1,7 +1,6 @@
module Hyrax
class ContentBlocksController < ApplicationController
load_and_authorize_resource except: :index
authorize_resource only: :index
load_and_authorize_resource
layout 'dashboard'

def edit
Expand Down
14 changes: 0 additions & 14 deletions app/controllers/hyrax/tinymce_assets_controller.rb

This file was deleted.

28 changes: 0 additions & 28 deletions app/helpers/hyrax/content_block_helper_behavior.rb
Expand Up @@ -8,33 +8,5 @@ def displayable_content_block(content_block, **options)
def display_content_block?(content_block)
content_block.value.present?
end

def edit_button(content_block)
button_tag "Edit", class: 'btn btn-primary', data: { behavior: 'reveal-editor', target: '#' + dom_id(content_block, 'edit') }
end

def new_button(_content_block)
button_tag "New", class: 'btn btn-primary', data: { behavior: 'reveal-editor', target: '#' + 'new_content_block' }
end

def edit_form(content_block, editing_field_id = nil)
editing_field_id ||= "text_area_#{content_block.name}"
form_for([hyrax, content_block], html: { class: 'tinymce-form' }) do |f|
concat hidden_field_tag 'content_block[name]', content_block.name
concat f.text_area :value, id: editing_field_id, class: "tinymce", rows: 20, cols: 120
concat f.label :external_key, content_block.external_key_name
concat f.text_field :external_key, class: key_field_class(content_block.name)
concat content_tag(:div) { f.submit 'Save', class: "btn btn-primary" }
end
end

def key_field_class(content_block_type)
content_block_type == ContentBlock::RESEARCHER ? 'select2-user' : ''
end

def new_form(name)
content_block = ContentBlock.new(name: name)
edit_form(content_block, "new_#{name}_text_area")
end
end
end
3 changes: 1 addition & 2 deletions app/models/concerns/hyrax/ability.rb
Expand Up @@ -111,8 +111,7 @@ def editor_abilities
return unless admin?

can :read, :admin_dashboard
can :create, TinymceAsset
can [:create, :update], ContentBlock
can :update, ContentBlock
can :edit, ::SolrDocument
end

Expand Down
3 changes: 0 additions & 3 deletions app/models/tinymce_asset.rb

This file was deleted.

45 changes: 0 additions & 45 deletions app/uploaders/tinymce_asset_uploader.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/hyrax/content_blocks/_featured_researcher.html.erb

This file was deleted.

7 changes: 0 additions & 7 deletions app/views/hyrax/content_blocks/index.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion config/locales/hyrax.en.yml
Expand Up @@ -500,7 +500,6 @@ en:
missing: 'No researchers have been featured.'
tab_label: 'Featured Researcher'
title: 'Featured Researcher'
view_more: 'View other featured researchers'
featured_works:
drag: 'Drag'
no_works: 'No works have been featured'
Expand Down
1 change: 0 additions & 1 deletion config/locales/hyrax.es.yml
Expand Up @@ -500,7 +500,6 @@ es:
missing: 'No se han presentado investigadores.'
tab_label: 'Investigador destacado'
title: 'Investigador destacado'
view_more: 'Ver otros investigadores destacados'
featured_works:
drag: 'Arrastrar'
no_works: 'No hay trabajos destacados'
Expand Down
1 change: 0 additions & 1 deletion config/locales/hyrax.zh.yml
Expand Up @@ -500,7 +500,6 @@ zh:
missing: '没有研究人员被特色。'
tab_label: '特色研究者'
title: '特色研究者'
view_more: '阅览其他特色研究者'
featured_works:
drag: ''
no_works: '没有特色作品'
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Expand Up @@ -207,7 +207,6 @@
get :edit
end
end
post '/tinymce_assets' => 'tinymce_assets#create'
get 'about' => 'pages#show', id: 'about_page'
get 'help' => 'pages#show', id: 'help_page'

Expand Down
1 change: 0 additions & 1 deletion hyrax.gemspec
Expand Up @@ -33,7 +33,6 @@ EOF
spec.add_dependency 'blacklight', '~> 6.9'
spec.add_dependency 'blacklight-gallery', '~> 0.7'
spec.add_dependency 'tinymce-rails', '~> 4.1'
spec.add_dependency 'tinymce-rails-imageupload', '~> 4.0.17.beta'
spec.add_dependency 'font-awesome-rails', '~> 4.2'
spec.add_dependency 'select2-rails', '~> 3.5.9'
spec.add_dependency 'json-schema' # for Arkivio
Expand Down
11 changes: 0 additions & 11 deletions lib/generators/hyrax/install_generator.rb
Expand Up @@ -25,7 +25,6 @@ class Install < Rails::Generators::Base
15. Installs Blacklight gallery (and removes it's scss)
16. Install jquery-datatables
17. Initializes the active-fedora_noid database-backed minter
18. Adds configuration to config/application.rb to fix tinymce asset compiling
"""

def run_required_generators
Expand Down Expand Up @@ -165,15 +164,5 @@ def datatables
def af_noid_database_minter_initialize
generate 'active_fedora:noid:install'
end

def inject_tinymce_fix
file_path = "config/application.rb"
insert_into_file file_path, after: /Rails::Application\s*\n/ do
"\n # The compile method (default in tinymce-rails 4.5.2) doesn't work when also" \
"\n # using tinymce-rails-imageupload, so revert to the :copy method" \
"\n # https://github.com/spohlenz/tinymce-rails/issues/183" \
"\n config.tinymce.install = :copy\n"
end
end
end
end
1 change: 0 additions & 1 deletion lib/hyrax.rb
Expand Up @@ -6,7 +6,6 @@
require 'rails_autolink'
require 'font-awesome-rails'
require 'tinymce-rails'
require 'tinymce-rails-imageupload'
require 'blacklight'
require 'blacklight/gallery'
require 'active_fedora/noid'
Expand Down
6 changes: 0 additions & 6 deletions spec/abilities/ability_spec.rb
Expand Up @@ -80,8 +80,6 @@

describe "a user with no roles" do
let(:user) { nil }
it { is_expected.not_to be_able_to(:create, TinymceAsset) }
it { is_expected.not_to be_able_to(:create, ContentBlock) }
it { is_expected.not_to be_able_to(:update, ContentBlock) }
it { is_expected.not_to be_able_to(:create, AdminSet) }
it { is_expected.to be_able_to(:read, ContentBlock) }
Expand All @@ -92,8 +90,6 @@

describe "a registered user" do
let(:user) { create(:user) }
it { is_expected.not_to be_able_to(:create, TinymceAsset) }
it { is_expected.not_to be_able_to(:create, ContentBlock) }
it { is_expected.not_to be_able_to(:update, ContentBlock) }
it { is_expected.to be_able_to(:read, ContentBlock) }
it { is_expected.not_to be_able_to(:read, Hyrax::Statistics) }
Expand All @@ -105,8 +101,6 @@
describe "a user in the admin group" do
let(:user) { create(:user) }
before { allow(user).to receive_messages(groups: ['admin', 'registered']) }
it { is_expected.to be_able_to(:create, TinymceAsset) }
it { is_expected.to be_able_to(:create, ContentBlock) }
it { is_expected.to be_able_to(:update, ContentBlock) }
it { is_expected.to be_able_to(:read, ContentBlock) }
it { is_expected.to be_able_to(:read, Hyrax::Statistics) }
Expand Down
37 changes: 0 additions & 37 deletions spec/controllers/hyrax/tinymce_assets_controller_spec.rb

This file was deleted.

0 comments on commit e47bf71

Please sign in to comment.