fine_print 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +74 -45
- data/Rakefile +9 -9
- data/app/assets/javascripts/application.js~ +16 -0
- data/app/assets/javascripts/fine_print/application.js +8 -2
- data/app/controllers/fine_print/application_controller.rb +9 -7
- data/app/controllers/fine_print/application_controller.rb~ +9 -7
- data/app/controllers/fine_print/contracts_controller.rb +79 -0
- data/app/controllers/fine_print/contracts_controller.rb~ +79 -0
- data/app/controllers/fine_print/home_controller.rb +1 -11
- data/app/controllers/fine_print/home_controller.rb~ +2 -11
- data/app/controllers/fine_print/signatures_controller.rb +14 -0
- data/app/controllers/fine_print/signatures_controller.rb~ +14 -0
- data/app/helpers/fine_print/application_helper.rb +7 -0
- data/app/helpers/fine_print/application_helper.rb~ +7 -0
- data/app/helpers/fine_print/contracts_helper.rb~ +7 -0
- data/app/models/fine_print/contract.rb +96 -0
- data/app/models/fine_print/contract.rb~ +100 -0
- data/app/models/fine_print/signature.rb +25 -0
- data/app/models/fine_print/signature.rb~ +25 -0
- data/app/views/fine_print/contracts/_form.html.erb +35 -0
- data/app/views/fine_print/contracts/_form.html.erb~ +35 -0
- data/app/views/fine_print/contracts/edit.html.erb +10 -0
- data/app/views/fine_print/contracts/index.html.erb +43 -0
- data/app/views/fine_print/contracts/index.html.erb~ +43 -0
- data/app/views/fine_print/contracts/new.html.erb +9 -0
- data/app/views/fine_print/contracts/new_version.html.erb +9 -0
- data/app/views/fine_print/contracts/show.html.erb +33 -0
- data/app/views/fine_print/contracts/show.html.erb~ +35 -0
- data/app/views/fine_print/home/index.html.erb +15 -6
- data/app/views/fine_print/home/index.html.erb~ +12 -4
- data/app/views/fine_print/signatures/index.html.erb +36 -0
- data/app/views/fine_print/signatures/index.html.erb~ +32 -0
- data/app/views/layouts/fine_print/application.html.erb +6 -0
- data/app/views/layouts/fine_print/application.html.erb~ +20 -0
- data/config/initializers/fine_print.rb +27 -44
- data/config/initializers/fine_print.rb~ +23 -40
- data/config/routes.rb +9 -3
- data/config/routes.rb~ +9 -4
- data/db/migrate/0_install_fine_print.rb +26 -0
- data/db/migrate/0_install_fine_print.rb~ +26 -0
- data/lib/fine_print/controller_additions.rb +69 -0
- data/lib/fine_print/controller_additions.rb~ +69 -0
- data/lib/fine_print/engine.rb +8 -0
- data/lib/fine_print/security_transgression.rb +1 -2
- data/lib/fine_print/utilities.rb~ +26 -0
- data/lib/fine_print/version.rb +1 -1
- data/lib/fine_print.rb +89 -42
- data/lib/fine_print.rb~ +89 -41
- data/lib/tasks/fine_print_tasks.rake +11 -8
- data/spec/controllers/contracts_controller_spec.rb +222 -0
- data/spec/controllers/contracts_controller_spec.rb~ +224 -0
- data/spec/controllers/home_controller_spec.rb +25 -0
- data/spec/controllers/home_controller_spec.rb~ +25 -0
- data/spec/controllers/signatures_controller_spec.rb +46 -0
- data/spec/controllers/signatures_controller_spec.rb~ +46 -0
- data/spec/dummy/README.md +1 -1
- data/spec/dummy/app/controllers/dummy_models_controller.rb +2 -0
- data/spec/dummy/app/controllers/dummy_models_controller.rb~ +29 -0
- data/spec/dummy/app/helpers/application_helper.rb +13 -0
- data/spec/dummy/app/models/dummy_user.rb +3 -0
- data/spec/dummy/app/models/dummy_user.rb~ +4 -0
- data/spec/dummy/app/models/user.rb~ +78 -0
- data/spec/dummy/config/application.rb +2 -2
- data/spec/dummy/config/application.rb~ +60 -0
- data/spec/dummy/config/initializers/fine_print.rb +36 -0
- data/spec/dummy/config/initializers/fine_print.rb~ +36 -0
- data/spec/dummy/config/initializers/session_store.rb +1 -1
- data/spec/dummy/config/initializers/session_store.rb~ +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +1 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb~ +14 -0
- data/spec/dummy/config/routes.rb +1 -2
- data/spec/dummy/config/routes.rb~ +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/1_create_dummy_users.rb +9 -0
- data/spec/dummy/db/migrate/1_create_dummy_users.rb~ +8 -0
- data/spec/dummy/db/schema.rb +20 -12
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1635 -0
- data/spec/dummy/log/test.log +46188 -0
- data/spec/factories/contract.rb +25 -0
- data/spec/factories/contract.rb~ +26 -0
- data/spec/factories/dummy_user.rb +4 -0
- data/spec/factories/dummy_user.rb~ +6 -0
- data/spec/factories/signature.rb +6 -0
- data/spec/factories/signature.rb~ +8 -0
- data/spec/factories/user.rb~ +6 -0
- data/spec/fine_print_spec.rb~ +15 -4
- data/spec/lib/fine_print/controller_additions_spec.rb +20 -0
- data/spec/lib/fine_print/controller_additions_spec.rb~ +20 -0
- data/spec/lib/fine_print_spec.rb +47 -0
- data/spec/lib/fine_print_spec.rb~ +47 -0
- data/spec/models/contract_spec.rb +79 -0
- data/spec/models/contract_spec.rb~ +80 -0
- data/spec/models/signature_spec.rb +28 -0
- data/spec/models/signature_spec.rb~ +28 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/spec_helper.rb~ +32 -0
- data/spec/test_helper.rb~ +15 -0
- metadata +153 -91
- data/app/assets/javascripts/fine_print/agreements.js +0 -19
- data/app/assets/javascripts/fine_print/agreements.js~ +0 -19
- data/app/assets/javascripts/fine_print/application.js~ +0 -5
- data/app/assets/javascripts/fine_print/dialog.js +0 -2
- data/app/assets/javascripts/fine_print/dialog.js~ +0 -2
- data/app/assets/javascripts/fine_print/user_agreements.js +0 -20
- data/app/assets/javascripts/fine_print/user_agreements.js~ +0 -20
- data/app/assets/stylesheets/fine_print/agreements.css +0 -11
- data/app/assets/stylesheets/fine_print/agreements.css~ +0 -11
- data/app/assets/stylesheets/fine_print/application.css~ +0 -60
- data/app/assets/stylesheets/fine_print/user_agreements.css~ +0 -3
- data/app/assets/stylesheets/scaffold.css~ +0 -56
- data/app/controllers/fine_print/agreements_controller.rb +0 -114
- data/app/controllers/fine_print/agreements_controller.rb~ +0 -113
- data/app/controllers/fine_print/user_agreements_controller.rb +0 -63
- data/app/controllers/fine_print/user_agreements_controller.rb~ +0 -63
- data/app/models/fine_print/agreement.rb +0 -50
- data/app/models/fine_print/agreement.rb~ +0 -50
- data/app/models/fine_print/user_agreement.rb +0 -19
- data/app/models/fine_print/user_agreement.rb~ +0 -21
- data/app/views/fine_print/agreements/_agreement.html.erb +0 -77
- data/app/views/fine_print/agreements/_agreement.html.erb~ +0 -77
- data/app/views/fine_print/agreements/_dialog.html.erb +0 -27
- data/app/views/fine_print/agreements/_dialog.html.erb~ +0 -27
- data/app/views/fine_print/agreements/_form.html.erb +0 -51
- data/app/views/fine_print/agreements/_form.html.erb~ +0 -51
- data/app/views/fine_print/agreements/edit.html.erb +0 -8
- data/app/views/fine_print/agreements/edit.html.erb~ +0 -8
- data/app/views/fine_print/agreements/index.html.erb +0 -32
- data/app/views/fine_print/agreements/index.html.erb~ +0 -32
- data/app/views/fine_print/agreements/new.html.erb +0 -7
- data/app/views/fine_print/agreements/new.html.erb~ +0 -7
- data/app/views/fine_print/agreements/new_version.html.erb +0 -7
- data/app/views/fine_print/agreements/new_version.html.erb~ +0 -7
- data/app/views/fine_print/agreements/show.html.erb +0 -15
- data/app/views/fine_print/agreements/show.html.erb~ +0 -14
- data/app/views/fine_print/user_agreements/cancel.js.erb +0 -1
- data/app/views/fine_print/user_agreements/cancel.js.erb~ +0 -2
- data/app/views/fine_print/user_agreements/create.js.erb +0 -2
- data/app/views/fine_print/user_agreements/create.js.erb~ +0 -2
- data/app/views/fine_print/user_agreements/index.html.erb +0 -25
- data/app/views/fine_print/user_agreements/index.html.erb~ +0 -25
- data/db/migrate/0_create_fine_print_agreements.rb~ +0 -22
- data/db/migrate/0_install.rb +0 -28
- data/db/migrate/0_install.rb~ +0 -28
- data/lib/fine_print/agreements_helper.rb +0 -13
- data/lib/fine_print/agreements_helper.rb~ +0 -11
- data/lib/fine_print/fine_print_agreement.rb +0 -26
- data/lib/fine_print/fine_print_agreement.rb~ +0 -26
- data/lib/fine_print/require_agreement.rb~ +0 -22
- data/lib/fine_print/security_transgression.rb~ +0 -3
- data/lib/fine_print/version.rb~ +0 -3
- data/lib/tasks/fine_print_tasks.rake~ +0 -42
- data/spec/dummy/README.md~ +0 -3
- data/spec/fine_print_spec.rb +0 -7
- data/spec/minitest_helper.rb +0 -12
@@ -1,27 +0,0 @@
|
|
1
|
-
<% # Clients of this partial must supply the following variables:
|
2
|
-
# agreements
|
3
|
-
# user
|
4
|
-
# notice
|
5
|
-
#
|
6
|
-
# Additionally, they can override the following variables:
|
7
|
-
width ||= 640
|
8
|
-
height ||= 480 %>
|
9
|
-
|
10
|
-
<%= stylesheet_link_tag 'fine_print/application' %>
|
11
|
-
<%= javascript_include_tag 'fine_print/dialog' %>
|
12
|
-
|
13
|
-
<% agreements.each_with_index do |agreement, index| %>
|
14
|
-
<div id="<%= "fine_print_dialog_#{index}" %>" title="<%= agreement.name %>" class="fine_print agreement dialog">
|
15
|
-
<%= render :partial => 'fine_print/agreements/agreement', :locals => {
|
16
|
-
:agreement => agreement,
|
17
|
-
:index => index,
|
18
|
-
:user => user,
|
19
|
-
:notice => notice,
|
20
|
-
:remote => true } %>
|
21
|
-
</div>
|
22
|
-
|
23
|
-
<script>
|
24
|
-
fine_print_init_dialog(<%= index %>, width, height);
|
25
|
-
</script>
|
26
|
-
<% end %>
|
27
|
-
|
@@ -1,51 +0,0 @@
|
|
1
|
-
<%= form_for(@agreement) do |f| %>
|
2
|
-
<% if @agreement.errors.any? %>
|
3
|
-
<div id="error_explanation" class="fine_print errors">
|
4
|
-
<h2 class="fine_print heading"><%= pluralize(@agreement.errors.count, "error") %> prohibited this agreement from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% @agreement.errors.full_messages.each do |msg| %>
|
8
|
-
<li><%= msg %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div class="field">
|
15
|
-
<%= f.label :name, :class => "fine_print label" %><br/>
|
16
|
-
<%= f.text_field :name, :size => 40, :class => "fine_print text_field" %><br/>
|
17
|
-
(e.g., "Terms of Use"; changing this will reset the version count)<br/><br/>
|
18
|
-
</div>
|
19
|
-
<div class="field">
|
20
|
-
<%= f.label :content, :class => "fine_print label" %><br/>
|
21
|
-
<%= f.text_area :content, :cols => 56, :class => "fine_print text_area" %><br/><br/>
|
22
|
-
</div>
|
23
|
-
<div class="field">
|
24
|
-
<%= f.label :confirmation_text, :class => "fine_print label" %><br/>
|
25
|
-
<%= f.text_field :confirmation_text, :size => 40, :class => "fine_print text_field" %><br/>
|
26
|
-
(e.g., "I have read and agree to the terms and conditions above")<br/><br/>
|
27
|
-
</div>
|
28
|
-
<div class="field">
|
29
|
-
<%= f.label :ready, "Display the agreement's name to users as a heading?", :class => "fine_print label" %>
|
30
|
-
<%= f.check_box :display_name, :class => "fine_print checkbox" %><br/><br/>
|
31
|
-
</div>
|
32
|
-
<div class="field">
|
33
|
-
<%= f.label :ready, "Display the agreement's version to users?", :class => "fine_print label" %>
|
34
|
-
<%= f.check_box :display_version, :class => "fine_print checkbox" %><br/><br/>
|
35
|
-
</div>
|
36
|
-
<div class="field">
|
37
|
-
<%= f.label :ready, "Display the agreement's last updated date to users?", :class => "fine_print label" %>
|
38
|
-
<%= f.check_box :display_updated, :class => "fine_print checkbox" %><br/><br/>
|
39
|
-
</div>
|
40
|
-
<div class="field">
|
41
|
-
<%= f.label :ready, "Display a confirmation checkbox that users have to click?", :class => "fine_print label" %>
|
42
|
-
<%= f.check_box :display_confirmation, :class => "fine_print checkbox" %><br/><br/>
|
43
|
-
</div>
|
44
|
-
<div class="field">
|
45
|
-
<%= f.label :ready, "Ready to be used?", :class => "fine_print label" %>
|
46
|
-
<%= f.check_box :ready, :class => "fine_print checkbox" %><br/><br/>
|
47
|
-
</div>
|
48
|
-
<div class="actions">
|
49
|
-
<%= f.submit nil, :class => "fine_print submit" %>
|
50
|
-
</div>
|
51
|
-
<% end %>
|
@@ -1,51 +0,0 @@
|
|
1
|
-
<%= form_for(@agreement) do |f| %>
|
2
|
-
<% if @agreement.errors.any? %>
|
3
|
-
<div id="error_explanation" class="fine_print errors">
|
4
|
-
<h2 class="fine_print heading"><%= pluralize(@agreement.errors.count, "error") %> prohibited this agreement from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% @agreement.errors.full_messages.each do |msg| %>
|
8
|
-
<li><%= msg %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div class="field">
|
15
|
-
<%= f.label :name, :class => "fine_print label" %><br/>
|
16
|
-
<%= f.text_field :name, :size => 40, :class => "fine_print text_field" %><br/>
|
17
|
-
(e.g., "Terms of Use"; changing this will reset the version count)<br/><br/>
|
18
|
-
</div>
|
19
|
-
<div class="field">
|
20
|
-
<%= f.label :content, :class => "fine_print label" %><br/>
|
21
|
-
<%= f.text_area :content, :cols => 56, :class => "fine_print text_area" %><br/><br/>
|
22
|
-
</div>
|
23
|
-
<div class="field">
|
24
|
-
<%= f.label :confirmation_text, :class => "fine_print label" %><br/>
|
25
|
-
<%= f.text_field :confirmation_text, :size => 40, :class => "fine_print text_field" %><br/>
|
26
|
-
(e.g., "I have read and agree to the terms and conditions above")<br/><br/>
|
27
|
-
</div>
|
28
|
-
<div class="field">
|
29
|
-
<%= f.label :ready, "Display the agreement's name to users (as a heading)?", :class => "fine_print label" %>
|
30
|
-
<%= f.check_box :display_name, :class => "fine_print checkbox" %><br/><br/>
|
31
|
-
</div>
|
32
|
-
<div class="field">
|
33
|
-
<%= f.label :ready, "Display the agreement's version to users?", :class => "fine_print label" %>
|
34
|
-
<%= f.check_box :display_version, :class => "fine_print checkbox" %><br/><br/>
|
35
|
-
</div>
|
36
|
-
<div class="field">
|
37
|
-
<%= f.label :ready, "Display the agreement's last updated date to users?", :class => "fine_print label" %>
|
38
|
-
<%= f.check_box :display_updated, :class => "fine_print checkbox" %><br/><br/>
|
39
|
-
</div>
|
40
|
-
<div class="field">
|
41
|
-
<%= f.label :ready, "Display a confirmation checkbox that users have to click?", :class => "fine_print label" %>
|
42
|
-
<%= f.check_box :display_confirmation, :class => "fine_print checkbox" %><br/><br/>
|
43
|
-
</div>
|
44
|
-
<div class="field">
|
45
|
-
<%= f.label :ready, "Ready to be used?", :class => "fine_print label" %>
|
46
|
-
<%= f.check_box :ready, :class => "fine_print checkbox" %><br/><br/>
|
47
|
-
</div>
|
48
|
-
<div class="actions">
|
49
|
-
<%= f.submit nil, :class => "fine_print submit" %>
|
50
|
-
</div>
|
51
|
-
<% end %>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<h1 class="fine_print heading">FinePrint agreements</h1>
|
2
|
-
|
3
|
-
<table class="fine_print index">
|
4
|
-
<tr>
|
5
|
-
<th>Name</th>
|
6
|
-
<th>Version</th>
|
7
|
-
<th></th>
|
8
|
-
<th></th>
|
9
|
-
<th></th>
|
10
|
-
</tr>
|
11
|
-
|
12
|
-
<% @agreements.each do |agreement| %>
|
13
|
-
<tr>
|
14
|
-
<td><%= agreement.name %></td>
|
15
|
-
<td><%= agreement.version %></td>
|
16
|
-
<td><%= link_to 'Show', agreement, :class => "fine_print link" %></td>
|
17
|
-
<td><% if agreement.can_be_edited_by?(@user) %>
|
18
|
-
<%= link_to 'Edit', edit_agreement_path(agreement), :class => "fine_print link" %>
|
19
|
-
<% else %>
|
20
|
-
<%= link_to 'New version', agreement_new_version_path(agreement), :class => "fine_print link" %>
|
21
|
-
<% end %></td>
|
22
|
-
<td><% if agreement.can_be_destroyed_by?(@user) %>
|
23
|
-
<%= link_to 'Delete', agreement, method: :delete, data: { confirm: 'Are you sure you wish to delete this agreement?' }, :class => "fine_print link" %>
|
24
|
-
<% end %></td>
|
25
|
-
</tr>
|
26
|
-
<% end %>
|
27
|
-
</table>
|
28
|
-
|
29
|
-
<br />
|
30
|
-
|
31
|
-
<%= link_to 'New Agreement', new_agreement_path, :class => "fine_print link" %> |
|
32
|
-
<%= link_to 'Back', root_path, :class => "fine_print link" %>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<h1 class="fine_print heading">FinePrint agreements</h1>
|
2
|
-
|
3
|
-
<table class="fine_print index">
|
4
|
-
<tr>
|
5
|
-
<th>Name</th>
|
6
|
-
<th>Version</th>
|
7
|
-
<th></th>
|
8
|
-
<th></th>
|
9
|
-
<th></th>
|
10
|
-
</tr>
|
11
|
-
|
12
|
-
<% @agreements.each do |agreement| %>
|
13
|
-
<tr>
|
14
|
-
<td><%= agreement.name %></td>
|
15
|
-
<td><%= agreement.version %></td>
|
16
|
-
<td><%= link_to 'Show', agreement, :class => "fine_print link" %></td>
|
17
|
-
<td><% if agreement.can_be_edited_by?(@user) %>
|
18
|
-
<%= link_to 'Edit', edit_agreement_path(agreement), :class => "fine_print link" %>
|
19
|
-
<% else %>
|
20
|
-
<%= link_to 'New version', agreement_new_version_path(agreement), :class => "fine_print link" %>
|
21
|
-
<% end %></td>
|
22
|
-
<td><% if agreement.can_be_destroyed_by?(@user) %>
|
23
|
-
<%= link_to 'Delete', agreement, method: :delete, data: { confirm: 'Are you sure?' }, :class => "fine_print link" %>
|
24
|
-
<% end %></td>
|
25
|
-
</tr>
|
26
|
-
<% end %>
|
27
|
-
</table>
|
28
|
-
|
29
|
-
<br />
|
30
|
-
|
31
|
-
<%= link_to 'New Agreement', new_agreement_path, :class => "fine_print link" %> |
|
32
|
-
<%= link_to 'Back', root_path, :class => "fine_print link" %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<%= render :partial => 'agreement', :locals => {
|
2
|
-
:agreement => @agreement,
|
3
|
-
:user => @user,
|
4
|
-
:notice => @notice,
|
5
|
-
:accept_path => @accept_path,
|
6
|
-
:cancel_path => @cancel_path,
|
7
|
-
:url => @url,
|
8
|
-
:ref => @ref } %>
|
9
|
-
|
10
|
-
<br/>
|
11
|
-
|
12
|
-
<% if @agreement.can_be_edited_by?(@user) %>
|
13
|
-
<%= link_to 'Edit', edit_agreement_path(@agreement), :class => "fine_print link" %> |
|
14
|
-
<%= link_to 'Back', agreements_path, :class => "fine_print link" %>
|
15
|
-
<% end %>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%= render :partial => 'agreement', :locals => {
|
2
|
-
:agreement => @agreement,
|
3
|
-
:user => @user,
|
4
|
-
:notice => @notice,
|
5
|
-
:accept_path => @accept_path,
|
6
|
-
:url => @url,
|
7
|
-
:ref => @ref } %>
|
8
|
-
|
9
|
-
<br/>
|
10
|
-
|
11
|
-
<% if @agreement.can_be_edited_by?(@user) %>
|
12
|
-
<%= link_to 'Edit', edit_agreement_path(@agreement), :class => "fine_print link" %> |
|
13
|
-
<%= link_to 'Back', agreements_path, :class => "fine_print link" %>
|
14
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
window.history.back();
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<h1 class="fine_print heading">Accepted FinePrint agreements</h1>
|
2
|
-
|
3
|
-
<table class="fine_print index">
|
4
|
-
<tr>
|
5
|
-
<th>User ID</th>
|
6
|
-
<th>Agreement name</th>
|
7
|
-
<th>Agreement version</th>
|
8
|
-
<th>Date accepted</th>
|
9
|
-
<th></th>
|
10
|
-
</tr>
|
11
|
-
|
12
|
-
<% @user_agreements.each do |user_agreement| %>
|
13
|
-
<tr>
|
14
|
-
<td><%= user_agreement.user.id %></td>
|
15
|
-
<td><%= user_agreement.agreement.name %></td>
|
16
|
-
<td><%= user_agreement.agreement.version %></td>
|
17
|
-
<td><%= user_agreement.created_at %></td>
|
18
|
-
<td><%= link_to 'Terminate', user_agreement, method: :delete, data: { confirm: 'User will be asked to accept the agreement again. Are you sure?' }, :class => "fine_print link" %></td>
|
19
|
-
</tr>
|
20
|
-
<% end %>
|
21
|
-
</table>
|
22
|
-
|
23
|
-
<br />
|
24
|
-
|
25
|
-
<%= link_to 'Back', root_path, :class => "fine_print link" %>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<h1 class="fine_print heading">Accepted FinePrint agreements</h1>
|
2
|
-
|
3
|
-
<table class="fine_print index">
|
4
|
-
<tr>
|
5
|
-
<th>User ID</th>
|
6
|
-
<th>Agreement name</th>
|
7
|
-
<th>Agreement version</th>
|
8
|
-
<th>Date accepted</th>
|
9
|
-
<th></th>
|
10
|
-
</tr>
|
11
|
-
|
12
|
-
<% @user_agreements.each do |user_agreement| %>
|
13
|
-
<tr>
|
14
|
-
<td><%= user_agreement.user.id %></td>
|
15
|
-
<td><%= user_agreement.agreement.name %></td>
|
16
|
-
<td><%= user_agreement.agreement.version %></td>
|
17
|
-
<td><%= user_agreement.created_at %></td>
|
18
|
-
<td><%= link_to 'Terminate', user_agreement, method: :delete, data: { confirm: 'Are you sure? User will be asked to accept the agreement again.' }, :class => "fine_print link" %></td>
|
19
|
-
</tr>
|
20
|
-
<% end %>
|
21
|
-
</table>
|
22
|
-
|
23
|
-
<br />
|
24
|
-
|
25
|
-
<%= link_to 'Back', root_path, :class => "fine_print link" %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
class CreateFinePrintAgreements < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :fine_print_agreements do |t|
|
4
|
-
t.string :name
|
5
|
-
t.text :content
|
6
|
-
t.integer :version
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
|
11
|
-
create_table :fine_print_user_agreements do |t|
|
12
|
-
t.integer :user_id
|
13
|
-
t.integer :agreement_id
|
14
|
-
|
15
|
-
t.timestamps
|
16
|
-
end
|
17
|
-
|
18
|
-
add_index :fine_print_agreements, [:name, :version]
|
19
|
-
add_index :fine_print_user_agreements, [:user_id, :agreement_id]
|
20
|
-
add_index :fine_print_user_agreements, :agreement_id
|
21
|
-
end
|
22
|
-
end
|
data/db/migrate/0_install.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
class Install < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :fine_print_agreements do |t|
|
4
|
-
t.string :name, :null => false
|
5
|
-
t.integer :version, :null => false
|
6
|
-
t.text :content, :null => false
|
7
|
-
t.string :confirmation_text, :default => 'I have read and agree to the terms and conditions above', :null => false
|
8
|
-
t.boolean :display_name, :default => true
|
9
|
-
t.boolean :display_version, :default => false
|
10
|
-
t.boolean :display_updated, :default => false
|
11
|
-
t.boolean :display_confirmation, :default => true
|
12
|
-
t.boolean :ready, :default => false
|
13
|
-
|
14
|
-
t.timestamps
|
15
|
-
end
|
16
|
-
|
17
|
-
create_table :fine_print_user_agreements do |t|
|
18
|
-
t.integer :agreement_id, :null => false
|
19
|
-
t.references :user, :polymorphic => true, :null => false
|
20
|
-
|
21
|
-
t.timestamps
|
22
|
-
end
|
23
|
-
|
24
|
-
add_index :fine_print_agreements, [:name, :version]
|
25
|
-
add_index :fine_print_user_agreements, :agreement_id
|
26
|
-
add_index :fine_print_user_agreements, [:user_id, :user_type, :agreement_id], :name => 'index_fine_print_u_a_on_u_id_and_u_type_and_a_id'
|
27
|
-
end
|
28
|
-
end
|
data/db/migrate/0_install.rb~
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
class Install < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :fine_print_agreements do |t|
|
4
|
-
t.string :name, :null => false
|
5
|
-
t.integer :version, :null => false
|
6
|
-
t.text :content, :null => false
|
7
|
-
t.string :confirmation_text, :default => 'I have read and agree to the terms and conditions above', :null => false
|
8
|
-
t.boolean :display_name, :default => true
|
9
|
-
t.boolean :display_version, :default => false
|
10
|
-
t.boolean :display_updated, :default => false
|
11
|
-
t.boolean :display_confirmation, :default => true
|
12
|
-
t.boolean :ready, :default => false
|
13
|
-
|
14
|
-
t.timestamps
|
15
|
-
end
|
16
|
-
|
17
|
-
create_table :fine_print_user_agreements do |t|
|
18
|
-
t.integer :agreement_id, :null => false
|
19
|
-
t.references :user, :polymorphic => true
|
20
|
-
|
21
|
-
t.timestamps
|
22
|
-
end
|
23
|
-
|
24
|
-
add_index :fine_print_agreements, [:name, :version]
|
25
|
-
add_index :fine_print_user_agreements, :agreement_id
|
26
|
-
add_index :fine_print_user_agreements, [:user_id, :user_type, :agreement_id], :name => 'index_fine_print_u_a_on_u_id_and_u_type_and_a_id'
|
27
|
-
end
|
28
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module FinePrint
|
2
|
-
module AgreementsHelper
|
3
|
-
def fine_print_dialog(options = {})
|
4
|
-
render :partial => 'fine_print/agreements/dialog',
|
5
|
-
:locals => {:agreements => @fine_print_dialog_agreements,
|
6
|
-
:user => @fine_print_user,
|
7
|
-
:notice => @fine_print_dialog_notice,
|
8
|
-
:width => options[:width],
|
9
|
-
:height => options[:height]} \
|
10
|
-
unless @fine_print_dialog_agreements.blank?
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module FinePrint
|
2
|
-
module AgreementsHelper
|
3
|
-
def fine_print_dialog(options = {})
|
4
|
-
render :partial => 'fine_print/agreements/dialog',
|
5
|
-
:locals => {:agreements => @fine_print_dialog_agreements,
|
6
|
-
:user => @fine_print_user,
|
7
|
-
:notice => @fine_print_dialog_notice} \
|
8
|
-
unless @fine_print_dialog_agreements.blank?
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'fine_print/agreements_helper'
|
2
|
-
|
3
|
-
module FinePrint
|
4
|
-
module FinePrintAgreement
|
5
|
-
def self.included(base)
|
6
|
-
base.helper FinePrint::AgreementsHelper
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
|
-
def fine_print_agreement(*args)
|
12
|
-
options = args.last.is_a?(Hash) ? args.pop : {}
|
13
|
-
class_eval do
|
14
|
-
before_filter(options.except(*FinePrint::AGREEMENT_OPTIONS)) do |controller|
|
15
|
-
FinePrint.require_agreements(controller, args, options.slice(*FinePrint::AGREEMENT_OPTIONS))
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
alias_method :fine_print_agreements, :fine_print_agreement
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
ActionController::Base.send :include, FinePrint::FinePrintAgreement
|
26
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'fine_print/agreements_helper'
|
2
|
-
|
3
|
-
module FinePrint
|
4
|
-
module FinePrintAgreement
|
5
|
-
def self.included(base)
|
6
|
-
base.helper FinePrint::AgreementHelper
|
7
|
-
base.extend(ClassMethods)
|
8
|
-
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
|
-
def fine_print_agreement(*args)
|
12
|
-
options = args.last.is_a?(Hash) ? args.pop : {}
|
13
|
-
class_eval do
|
14
|
-
before_filter(options.except(*FinePrint::AGREEMENT_OPTIONS)) do |controller|
|
15
|
-
FinePrint.require_agreements(controller, args, options.slice(*FinePrint::AGREEMENT_OPTIONS))
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
alias_method :fine_print_agreements, :fine_print_agreement
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
ActionController::Base.send :include, FinePrint::FinePrintAgreement
|
26
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module FinePrint
|
2
|
-
module FinePrintAgreement
|
3
|
-
def self.included(base)
|
4
|
-
base.extend(ClassMethods)
|
5
|
-
end
|
6
|
-
|
7
|
-
module ClassMethods
|
8
|
-
def fine_print_agreement(*args)
|
9
|
-
options = args.last.is_a?(Hash) ? args.pop : {}
|
10
|
-
class_eval do
|
11
|
-
before_filter(options) { |c| FinePrint.require_agreements(c, args) }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
alias_method :fine_print, :fine_print_agreement
|
16
|
-
alias_method :fine_print_agreements, :fine_print_agreement
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
ActionController::Base.send :include, FinePrint::RequireAgreement
|
22
|
-
|
data/lib/fine_print/version.rb~
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
COPY_TASKS = ['assets/stylesheets', 'assets/javascripts', 'views/layouts', 'views', 'controllers']
|
2
|
-
|
3
|
-
namespace :fine_print do
|
4
|
-
namespace :install do
|
5
|
-
desc "Copy initializers from fine_print to application"
|
6
|
-
task :initializers do
|
7
|
-
Dir.glob(File.expand_path('../../../config/initializers/*.rb', __FILE__)) do |file|
|
8
|
-
if File.exists?(File.expand_path(File.basename(file), 'config/initializers'))
|
9
|
-
print "NOTE: Initializer #{File.basename(file)} from fine_print has been skipped. Initializer with the same name already exists.\n"
|
10
|
-
else
|
11
|
-
cp file, 'config/initializers', :verbose => false
|
12
|
-
print "Copied initializer #{File.basename(file)} from fine_print\n"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
namespace :copy do
|
19
|
-
COPY_TASKS.each do |path|
|
20
|
-
name = File.basename(path)
|
21
|
-
desc "Copy #{name} from fine_print to application"
|
22
|
-
task name.to_sym do
|
23
|
-
cp_r File.expand_path("../../../app/#{path}/fine_print", __FILE__), "app/#{path}", :verbose => false
|
24
|
-
print "Copied #{name} from fine_print\n"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Copy migrations from fine_print to application"
|
30
|
-
task :install do
|
31
|
-
Rake::Task["fine_print:install:initializers"].invoke
|
32
|
-
Rake::Task["fine_print:install:migrations"].invoke
|
33
|
-
end
|
34
|
-
|
35
|
-
desc "Copy assets, layouts, views, and controllers from fine_print to application"
|
36
|
-
task :copy do
|
37
|
-
COPY_TASKS.each do |path|
|
38
|
-
Rake::Task["fine_print:copy:#{File.basename(path)}"].invoke
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
data/spec/dummy/README.md~
DELETED
data/spec/fine_print_spec.rb
DELETED
data/spec/minitest_helper.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# Configure Rails Environment
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
3
|
-
|
4
|
-
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
-
|
6
|
-
require "minitest/autorun"
|
7
|
-
require "minitest/rails"
|
8
|
-
|
9
|
-
require "minitest/rails/capybara"
|
10
|
-
|
11
|
-
Rails.backtrace_cleaner.remove_silencers!
|
12
|
-
|