Skip to content

Commit

Permalink
Remove code related to contributor agreements. Closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Stroop committed May 15, 2015
1 parent dbbeda1 commit c01e309
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 101 deletions.
15 changes: 0 additions & 15 deletions app/assets/javascripts/worthwhile/accept_contributor_agreement.js

This file was deleted.

2 changes: 0 additions & 2 deletions app/assets/javascripts/worthwhile/worthwhile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//= require worthwhile/link_groups
//= require worthwhile/proxy_rights
//= require worthwhile/facet_mine
//= require worthwhile/accept_contributor_agreement
//= require worthwhile/proxy_submission
//= require worthwhile/embargoes

Expand Down Expand Up @@ -42,4 +41,3 @@ Blacklight.onLoad(function() {
$("[data-toggle='dropdown']").dropdown();

});

7 changes: 1 addition & 6 deletions app/assets/stylesheets/worthwhile/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ legend {
font-weight:normal;
}

.redacted,
.unratified .contributor_agreement p {
.redacted {
font-family:'BLOKKNeue-Regular';
}

Expand All @@ -105,10 +104,6 @@ legend {
text-align:center;
}

.contributor_agreement.human_readable {
font-size:150%;
}

.doi {
font-size:200%;
margin:1em 0;
Expand Down
33 changes: 14 additions & 19 deletions app/controllers/concerns/worthwhile/curation_concern_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module Worthwhile::CurationConcernController
class_attribute :curation_concern_type
attr_accessor :curation_concern
helper_method :curation_concern
helper_method :contributor_agreement

respond_to :html
end
Expand All @@ -26,16 +25,12 @@ def cancan_resource_class
end
end

def contributor_agreement
@contributor_agreement ||= Worthwhile::ContributorAgreement.new(curation_concern, current_user, params)
end


def new
end

def create
return unless verify_acceptance_of_user_agreement!
# return unless verify_acceptance_of_user_agreement!
if actor.create
after_create_response
else
Expand Down Expand Up @@ -83,19 +78,19 @@ def setup_form
end
end

def verify_acceptance_of_user_agreement!
return true if contributor_agreement.is_being_accepted?
# Calling the new action to make sure we are doing our best to preserve
# the input values; Its a stretch but hopefully it'll work
self.new
respond_with(:curation_concern, curation_concern) do |wants|
wants.html {
flash.now[:error] = "You must accept the contributor agreement"
render 'new', status: :conflict
}
end
false
end
# def verify_acceptance_of_user_agreement!
# return true if contributor_agreement.is_being_accepted?
# # Calling the new action to make sure we are doing our best to preserve
# # the input values; Its a stretch but hopefully it'll work
# self.new
# respond_with(:curation_concern, curation_concern) do |wants|
# wants.html {
# flash.now[:error] = "You must accept the contributor agreement"
# render 'new', status: :conflict
# }
# end
# false
# end

def _prefixes
@_prefixes ||= super + ['curation_concern/base']
Expand Down
4 changes: 1 addition & 3 deletions app/views/curation_concern/base/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= simple_form_for [:curation_concern, curation_concern] do |f| %>
<% if f.error_notification -%>
<div class="alert alert-danger fade in">
<strong>Wait don't go!</strong> There was a problem with your submission. Please review the errors below:
Expand All @@ -11,8 +11,6 @@
<%= render 'form_supplementary_fields', curation_concern: curation_concern, f: f %>

<%= render 'form_contributor_agreement', curation_concern: curation_concern, contributor_agreement: contributor_agreement %>

<div class="row">
<div class="col-md-12 form-actions">
<%= f.submit class: 'btn btn-primary require-contributor-agreement' %>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
let(:a_work) { FactoryGirl.create(private_work_factory_name) }
it "should redirect and show unauthorized message" do
get :show, id: a_work
expect(response).to fail_redirect_and_flash(root_path, 'You are not authorized to access this page.')
expect(response).to fail_redirect_and_flash(root_path, 'You are not authorized to access this page.')
end
end

Expand Down Expand Up @@ -54,7 +54,7 @@
describe "#create" do
it "should create a work" do
expect {
post :create, accept_contributor_agreement: "accept", generic_work: { title: ["a title"] }
post :create, generic_work: { title: ["a title"] }
}.to change { GenericWork.count }.by(1)
expect(response).to redirect_to [:curation_concern, assigns[:curation_concern]]
end
Expand Down
1 change: 0 additions & 1 deletion spec/features/embargo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
it "can be created, displayed and updated" do
click_link 'New Generic Work'
fill_in 'Title', with: 'Embargo test'
check 'I have read and accept the contributor license agreement'
choose 'Embargo'
fill_in "generic_work_embargo_release_date", with: future_date
select 'Private', from: 'Restricted to'
Expand Down
1 change: 0 additions & 1 deletion spec/features/lease_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
visit '/'
click_link 'New Generic Work'
fill_in 'Title', with: 'Lease test'
check 'I have read and accept the contributor license agreement'
choose 'Lease'
fill_in "generic_work_lease_expiration_date", with: future_date
select 'Open Access', from: 'Is available for'
Expand Down
23 changes: 0 additions & 23 deletions worthwhile-models/app/models/worthwhile/contributor_agreement.rb

This file was deleted.

0 comments on commit c01e309

Please sign in to comment.