ucpengine 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e52fd2b30b8d7e1ef6ab976da29823517cd29482
4
- data.tar.gz: a6f4c5cfffea73f93bfdeea02184653b100ae54c
3
+ metadata.gz: 6e80372e147506899f07433ae9ad5ec08ccdfbb0
4
+ data.tar.gz: bf42b5bca40a8cea7390cba9aac03fe9a1e59c54
5
5
  SHA512:
6
- metadata.gz: 2c1dd3299389f9bdbb319eba9def22e06b62f7a48bc08078e1aff1fcb802bd146e428094a3442db1332680bce5802e93e4435b83e75905b1e194db8b1e8ddb81
7
- data.tar.gz: d06c66ac2bb3a900153a418e2bd7af171375c69ddc2ec37597321bd0177b79817451a0d27393697ac0ee1b5f9167990df48f7d015143a965f074bb133e9bd26d
6
+ metadata.gz: 8eb6c96c555132761a7e007e7d0e32f3b680ebd0940b8f9340bd5cdf3fc887ff427d55262ac451be7dfe4f111258d636043f7c0af0787abdd32a4dc34e78156d
7
+ data.tar.gz: 73f5e64026809668d8be75424484f45339966ce35f9a0809ee235e4d1ff53e03da1a9b92e2d46bab3f652c3c493c2da6397185e5cc8cf300db86c2ef8d103eea
@@ -13,3 +13,12 @@
13
13
  //= require jquery
14
14
  //= require jquery_ujs
15
15
  //= require_tree .
16
+
17
+ $(document).ready(function() {
18
+ $('select').material_select();
19
+ $('.datepicker').pickadate({
20
+ selectMonths: true, // Creates a dropdown to control month
21
+ selectYears: 15 // Creates a dropdown of 15 years to control year
22
+ });
23
+ $('ul.tabs').tabs();
24
+ });
@@ -25,11 +25,47 @@ nav {
25
25
  }
26
26
  .row{
27
27
  height:1200px;
28
- .col{
29
- padding:0 !important;
28
+ }
29
+ .ucp-inner-content{
30
+ padding:0 !important;
31
+ .inner-content-table{
32
+ padding-top:40px;
33
+ }
34
+ }
35
+ .ucp-inner-content-header{
36
+ border-bottom: 1px solid rgba(128, 128, 128, 0.15);
37
+ //height:40px;
38
+ padding:15px !important;
39
+ background:#FAFAFA;
40
+ .btn {
41
+ font-size:0.8em;
42
+ letter-spacing:2px;
43
+ height:25px;
44
+ line-height:25px;
45
+ float:right;
30
46
  }
31
47
  }
48
+ .tabs {
49
+ .tab{
50
+ a{
51
+ letter-spacing:1px;
52
+ font-size:0.8em !important;
53
+ color:rgba(32, 44, 49, 0.57) !important;
54
+ }
55
+ a.active{
56
+ color:#202c31 !important;
57
+ }
58
+ }
59
+ }
60
+ .indicator{
61
+ bottom:4px;
62
+ background-color:rgba(32, 44, 49, 0.57) !important;
63
+ }
64
+ .badge{
65
+ background-color:#81a6a6 !important;
66
+ }
32
67
  .ucp-sidenav{
68
+ padding:0 !important;
33
69
  height:100%;
34
70
  background:#ececec ;
35
71
  }
@@ -6,6 +6,9 @@ module Ucpengine
6
6
 
7
7
  def index
8
8
  @entries = Entry.where(type: content_class)
9
+ @terms_of_use = Entry.where(service_type: 'Terms of Use')
10
+ @third_party_terms_of_use = Entry.where(service_type: 'Third Party Terms of Use')
11
+ @privacy_policy = Entry.where(service_type: 'Privacy_policy')
9
12
  end
10
13
 
11
14
  def show
@@ -49,7 +52,7 @@ module Ucpengine
49
52
  end
50
53
 
51
54
  def entry_params
52
- allowed_attrs = %i(id type termsofservice version slug published_at)
55
+ allowed_attrs = %i(id type service_body service_type version slug published_at)
53
56
  .concat(content_class.constantize.content_attributes.keys)
54
57
 
55
58
  params.require(:entry).permit(*allowed_attrs)
@@ -25,13 +25,13 @@
25
25
  <ul class="collection">
26
26
  <% Ucpengine.configuration.content_classes.each do |class_name| %>
27
27
  <li class="collection-item sidenav-item">
28
- <%= link_to 'Terms of Service Dashboard', entries_path(content_class: class_name.tableize) %>
28
+ <%= link_to 'Service Dashboard', entries_path(content_class: class_name.tableize) %>
29
29
  </li>
30
30
  <% end %>
31
31
  </ul>
32
32
  </div>
33
33
 
34
- <div class="col s9">
34
+ <div class="col s9 ucp-inner-content">
35
35
 
36
36
  <%= yield %>
37
37
  </div>
@@ -1,3 +1,3 @@
1
1
  <div class="container dashboard-welcome">
2
- <p>Welcome to the UCP cms dashboard. Easily create and manage multiple Terms of Service versions.</p>
2
+ <p>Welcome to the UCP cms dashboard. Easily create and manage multiple Service types and versions.</p>
3
3
  </div>
@@ -1,22 +1,21 @@
1
1
  <div class="row tos-form">
2
2
  <div class="col s6">
3
- <%= form_for(@entry, as: :entry, url: @entry.persisted? ? content_entry_path(@entry) : entries_path) do |f| %>
3
+ <%= simple_form_for(@entry, as: :entry, url: @entry.persisted? ? content_entry_path(@entry) : entries_path) do |f| %>
4
4
  <%= f.hidden_field :type, value: @entry.type %>
5
5
 
6
- <%= f.label :version %>
7
- <%= f.text_field :version %>
8
-
6
+ <%= f.datetime_field :version %>
7
+ <%= f.input :service_type, collection: ['Terms of Use', 'Third Party Terms of Use', 'Privacy Policy', 'GLBA Privacy Policy'], prompt: 'Select Service Type' %>
9
8
  <!--
10
9
  <%= f.label :published_at %>
11
10
  <%= f.text_field :published_at %>
12
11
  -->
13
12
  <div class="input-field col s12">
14
13
  <% @entry.class.content_attributes.each do |attr_name, attr_type| %>
15
- <%= f.text_area attr_name, as: attr_type, class: 'materialize-textarea', placeholder: 'Terms of Service' %>
14
+ <%= f.text_area attr_name, as: attr_type, class: 'materialize-textarea', placeholder: 'New Service Agreement' %>
16
15
  <% end %>
17
16
  </div>
18
17
 
19
- <%= f.submit "Create and Save", class: 'btn' %>
18
+ <%= f.button :submit %>
20
19
  <% end %>
21
20
  </div>
22
21
  <div class="col s5">
@@ -1,20 +1,97 @@
1
+ <div class="row">
2
+ <div class="col s12 ucp-inner-content-header">
3
+ <%= link_to "New Service Post", new_content_entry_path, class: 'btn' %>
4
+ </div>
5
+ <div class="col s12">
1
6
 
2
- <table class="highlight">
3
- <%= link_to "New #{content_class.titleize}", new_content_entry_path %>
4
- <thead>
5
- <tr>
6
- <th>Version</th>
7
- <th>Created</td>
8
- <th>Options</th>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <% @entries.each do |entry| %>
13
- <tr>
14
- <td><%= link_to entry.version, content_entry_path(entry) %></td>
15
- <td><%= time_ago_in_words entry.created_at %> ago</td>
16
- <td><%= link_to 'Edit', edit_content_entry_path(entry) %>
17
- <%= link_to 'Destroy', content_entry_path(entry), method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
- </tr>
19
- <% end %>
20
- </table>
7
+ <ul class="tabs">
8
+ <li class="tab col s3"><a href="#terms_of_use">Terms of Use <span class="new badge"><%= @terms_of_use.count %></span></a></li>
9
+ <li class="tab col s3"><a href="#third_party_terms_of_use">Third Party Terms of Use <span class="new badge"><%= @terms_of_use.count %></a></li>
10
+ <li class="tab col s3"><a href="#privacy_policy">Privacy Policy <span class="new badge"><%= @terms_of_use.count %></a></li>
11
+ <li class="tab col s3"><a href="#glba_privacy_policy">GLBA Privacy Policy <span class="new badge"><%= @terms_of_use.count %></a></li>
12
+ </ul>
13
+ </div>
14
+ <div id="terms_of_use" class="col s12 inner-content-table">
15
+ <table class="highlight">
16
+ <thead>
17
+ <tr>
18
+ <th>Version</th>
19
+ <th>Created</td>
20
+ <th>Options</th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ <% @terms_of_use.each do |entry| %>
25
+ <tr>
26
+ <td><%= link_to entry.version, content_entry_path(entry) %></td>
27
+ <td><%= time_ago_in_words entry.created_at %> ago</td>
28
+ <td><%= link_to 'Edit', edit_content_entry_path(entry) %>
29
+ <%= link_to 'Destroy', content_entry_path(entry), method: :delete, data: { confirm: 'Are you sure?' } %></td>
30
+ </tr>
31
+ <% end %>
32
+ </table>
33
+ </div>
34
+ <div id="third_party_terms_of_use" class="col s12">
35
+ <table class="highlight">
36
+ <thead>
37
+ <tr>
38
+ <th>Version</th>
39
+ <th>Created</td>
40
+ <th>Options</th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ <%= @third_party_terms_of_use.count %>
45
+ <% @third_party_terms_of_use.each do |entry| %>
46
+ <tr>
47
+ <td><%= link_to entry.version, content_entry_path(entry) %></td>
48
+ <td><%= time_ago_in_words entry.created_at %> ago</td>
49
+ <td><%= link_to 'Edit', edit_content_entry_path(entry) %>
50
+ <%= link_to 'Destroy', content_entry_path(entry), method: :delete, data: { confirm: 'Are you sure?' } %></td>
51
+ </tr>
52
+ <% end %>
53
+ </table>
54
+ </div>
55
+ <div id="privacy_policy" class="col s12">
56
+ <table class="highlight">
57
+ <thead>
58
+ <tr>
59
+ <th>Version</th>
60
+ <th>Created</td>
61
+ <th>Options</th>
62
+ </tr>
63
+ </thead>
64
+ <tbody>
65
+ <%= @privacy_policy.count %>
66
+ <% @privacy_policy.each do |entry| %>
67
+ <tr>
68
+ <td><%= link_to entry.version, content_entry_path(entry) %></td>
69
+ <td><%= time_ago_in_words entry.created_at %> ago</td>
70
+ <td><%= link_to 'Edit', edit_content_entry_path(entry) %>
71
+ <%= link_to 'Destroy', content_entry_path(entry), method: :delete, data: { confirm: 'Are you sure?' } %></td>
72
+ </tr>
73
+ <% end %>
74
+ </table>
75
+ </div>
76
+ <div id="glba_privacy_policy" class="col s12">
77
+ <table class="highlight">
78
+ <thead>
79
+ <tr>
80
+ <th>Version</th>
81
+ <th>Created</td>
82
+ <th>Options</th>
83
+ </tr>
84
+ </thead>
85
+ <tbody>
86
+ <%= @privacy_policy.count %>
87
+ <% @privacy_policy.each do |entry| %>
88
+ <tr>
89
+ <td><%= link_to entry.version, content_entry_path(entry) %></td>
90
+ <td><%= time_ago_in_words entry.created_at %> ago</td>
91
+ <td><%= link_to 'Edit', edit_content_entry_path(entry) %>
92
+ <%= link_to 'Destroy', content_entry_path(entry), method: :delete, data: { confirm: 'Are you sure?' } %></td>
93
+ </tr>
94
+ <% end %>
95
+ </table>
96
+ </div>
97
+ </div>
@@ -5,7 +5,7 @@
5
5
 
6
6
  <p>
7
7
  <strong>Terms of Service:</strong>
8
- <%= @entry.termsofservice %>
8
+ <%= @entry.service_body %>
9
9
  </p>
10
10
 
11
11
 
@@ -0,0 +1,165 @@
1
+ # Use this setup block to configure all options available in SimpleForm.
2
+ SimpleForm.setup do |config|
3
+ # Wrappers are used by the form builder to generate a
4
+ # complete input. You can remove any component from the
5
+ # wrapper, change the order or even add your own to the
6
+ # stack. The options given below are used to wrap the
7
+ # whole input.
8
+ config.wrappers :default, class: :input,
9
+ hint_class: :field_with_hint, error_class: :field_with_errors do |b|
10
+ ## Extensions enabled by default
11
+ # Any of these extensions can be disabled for a
12
+ # given input by passing: `f.input EXTENSION_NAME => false`.
13
+ # You can make any of these extensions optional by
14
+ # renaming `b.use` to `b.optional`.
15
+
16
+ # Determines whether to use HTML5 (:email, :url, ...)
17
+ # and required attributes
18
+ b.use :html5
19
+
20
+ # Calculates placeholders automatically from I18n
21
+ # You can also pass a string as f.input placeholder: "Placeholder"
22
+ b.use :placeholder
23
+
24
+ ## Optional extensions
25
+ # They are disabled unless you pass `f.input EXTENSION_NAME => true`
26
+ # to the input. If so, they will retrieve the values from the model
27
+ # if any exists. If you want to enable any of those
28
+ # extensions by default, you can change `b.optional` to `b.use`.
29
+
30
+ # Calculates maxlength from length validations for string inputs
31
+ b.optional :maxlength
32
+
33
+ # Calculates pattern from format validations for string inputs
34
+ b.optional :pattern
35
+
36
+ # Calculates min and max from length validations for numeric inputs
37
+ b.optional :min_max
38
+
39
+ # Calculates readonly automatically from readonly attributes
40
+ b.optional :readonly
41
+
42
+ ## Inputs
43
+ b.use :label_input
44
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
45
+ b.use :error, wrap_with: { tag: :span, class: :error }
46
+
47
+ ## full_messages_for
48
+ # If you want to display the full error message for the attribute, you can
49
+ # use the component :full_error, like:
50
+ #
51
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
52
+ end
53
+
54
+ # The default wrapper to be used by the FormBuilder.
55
+ config.default_wrapper = :default
56
+
57
+ # Define the way to render check boxes / radio buttons with labels.
58
+ # Defaults to :nested for bootstrap config.
59
+ # inline: input + label
60
+ # nested: label > input
61
+ config.boolean_style = :nested
62
+
63
+ # Default class for buttons
64
+ config.button_class = 'btn'
65
+
66
+ # Method used to tidy up errors. Specify any Rails Array method.
67
+ # :first lists the first message for each field.
68
+ # Use :to_sentence to list all errors for each field.
69
+ # config.error_method = :first
70
+
71
+ # Default tag used for error notification helper.
72
+ config.error_notification_tag = :div
73
+
74
+ # CSS class to add for error notification helper.
75
+ config.error_notification_class = 'error_notification'
76
+
77
+ # ID to add for error notification helper.
78
+ # config.error_notification_id = nil
79
+
80
+ # Series of attempts to detect a default label method for collection.
81
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
82
+
83
+ # Series of attempts to detect a default value method for collection.
84
+ # config.collection_value_methods = [ :id, :to_s ]
85
+
86
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
87
+ # config.collection_wrapper_tag = nil
88
+
89
+ # You can define the class to use on all collection wrappers. Defaulting to none.
90
+ # config.collection_wrapper_class = nil
91
+
92
+ # You can wrap each item in a collection of radio/check boxes with a tag,
93
+ # defaulting to :span.
94
+ # config.item_wrapper_tag = :span
95
+
96
+ # You can define a class to use in all item wrappers. Defaulting to none.
97
+ # config.item_wrapper_class = nil
98
+
99
+ # How the label text should be generated altogether with the required text.
100
+ # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
101
+
102
+ # You can define the class to use on all labels. Default is nil.
103
+ # config.label_class = nil
104
+
105
+ # You can define the default class to be used on forms. Can be overriden
106
+ # with `html: { :class }`. Defaulting to none.
107
+ # config.default_form_class = nil
108
+
109
+ # You can define which elements should obtain additional classes
110
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
111
+
112
+ # Whether attributes are required by default (or not). Default is true.
113
+ # config.required_by_default = true
114
+
115
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
116
+ # These validations are enabled in SimpleForm's internal config but disabled by default
117
+ # in this configuration, which is recommended due to some quirks from different browsers.
118
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
119
+ # change this configuration to true.
120
+ config.browser_validations = false
121
+
122
+ # Collection of methods to detect if a file type was given.
123
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
124
+
125
+ # Custom mappings for input types. This should be a hash containing a regexp
126
+ # to match as key, and the input type that will be used when the field name
127
+ # matches the regexp as value.
128
+ # config.input_mappings = { /count/ => :integer }
129
+
130
+ # Custom wrappers for input types. This should be a hash containing an input
131
+ # type as key and the wrapper that will be used for all inputs with specified type.
132
+ # config.wrapper_mappings = { string: :prepend }
133
+
134
+ # Namespaces where SimpleForm should look for custom input classes that
135
+ # override default inputs.
136
+ # config.custom_inputs_namespaces << "CustomInputs"
137
+
138
+ # Default priority for time_zone inputs.
139
+ # config.time_zone_priority = nil
140
+
141
+ # Default priority for country inputs.
142
+ # config.country_priority = nil
143
+
144
+ # When false, do not use translations for labels.
145
+ # config.translate_labels = true
146
+
147
+ # Automatically discover new inputs in Rails' autoload path.
148
+ # config.inputs_discovery = true
149
+
150
+ # Cache SimpleForm inputs discovery
151
+ # config.cache_discovery = !Rails.env.development?
152
+
153
+ # Default class for inputs
154
+ # config.input_class = nil
155
+
156
+ # Define the default class of the input wrapper of the boolean input.
157
+ config.boolean_label_class = 'checkbox'
158
+
159
+ # Defines if the default input wrapper class should be included in radio
160
+ # collection wrappers.
161
+ # config.include_default_input_wrapper_class = true
162
+
163
+ # Defines which i18n scope will be used in Simple Form.
164
+ # config.i18n_scope = 'simple_form'
165
+ end
@@ -0,0 +1,9 @@
1
+ class RenameTermsofserviceToServiceBodyInUcpengineEntries < ActiveRecord::Migration
2
+ def up
3
+ rename_column :ucpengine_entries, :termsofservice, :service_body
4
+ end
5
+
6
+ def down
7
+ rename_column :ucpengine_entries, :service_body, :termsofservice
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class RemoveVersionFromUcpengineEntries < ActiveRecord::Migration
2
+ def change
3
+ remove_column :ucpengine_entries, :version, :decimal
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddVersionNewToUcpengineEntries < ActiveRecord::Migration
2
+ def change
3
+ add_column :ucpengine_entries, :version, :datetime
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddServiceTypeToUcpengineEntries < ActiveRecord::Migration
2
+ def change
3
+ add_column :ucpengine_entries, :service_type, :string
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Ucpengine
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucpengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2016-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -211,12 +211,17 @@ files:
211
211
  - app/views/ucpengine/entries/new.html.erb
212
212
  - app/views/ucpengine/entries/show.html.erb
213
213
  - app/views/ucpengine/previews/show.html.erb
214
+ - config/initializers/simple_form.rb
214
215
  - config/locales/simple_form.en.yml
215
216
  - config/routes.rb
216
217
  - db/migrate/20161028170915_create_ucpengine_entries.rb
217
218
  - db/migrate/20161028204606_create_ucpengine_entry_search_data.rb
218
219
  - db/migrate/20161102192430_add_slug_to_ucpengine_entries.rb
219
220
  - db/migrate/20161102192856_add_published_at_to_ucpengine_entries.rb
221
+ - db/migrate/20161118184506_rename_termsofservice_to_service_body_in_ucpengine_entries.rb
222
+ - db/migrate/20161118184650_remove_version_from_ucpengine_entries.rb
223
+ - db/migrate/20161118184744_add_version_new_to_ucpengine_entries.rb
224
+ - db/migrate/20161118190004_add_service_type_to_ucpengine_entries.rb
220
225
  - lib/tasks/ucpengine_tasks.rake
221
226
  - lib/templates/erb/scaffold/_form.html.erb
222
227
  - lib/ucpengine.rb
@@ -286,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
291
  version: '0'
287
292
  requirements: []
288
293
  rubyforge_project:
289
- rubygems_version: 2.4.7
294
+ rubygems_version: 2.5.1
290
295
  signing_key:
291
296
  specification_version: 4
292
297
  summary: Summary of Ucpengine.