Skip to content

Commit ab316a0

Browse files
committed
[browsermedia#623] Use basic date time widget
* :date_time fields will use simple_forms date time select.
1 parent f6b831b commit ab316a0

File tree

5 files changed

+12
-28
lines changed

5 files changed

+12
-28
lines changed

app/views/cms/form_builder/_cms_datetime_select.html.erb

Lines changed: 0 additions & 11 deletions
This file was deleted.

doc/features/simple_form_refactor.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,14 @@
55

66
## Remaining Tasks:
77

8-
* Make datetime (or replace) work.
8+
* Move all the manual initializers in dummy into the engine.
9+
* Write documentation
910

1011
## Steps
1112

12-
1. Replace all existing forms for non-block code
13-
2. Replace block code
14-
3. Make sure old widgets are deprecated but still work
15-
4. Add new widgets for things like section selectors, etc.
16-
5. Document new widgets on developer manual.
17-
6. Update generators to use new simple form controls.
18-
1913
10. Move all the manual initializers in dummy into the engine.
2014
10. Ensure we don't conflict with existing simple_form implementations
2115

22-
## Widgets to Replace
23-
24-
* check_box
25-
* datetime_select
26-
27-
## Cleanup
2816

2917
## Upgrade/Documentation notes
3018

@@ -33,5 +21,4 @@
3321

3422
## Bugs
3523

36-
* EmailPagePortlet doesn't actually work when you submit the form.
3724
* Tag list does not automatically suggest tags.

features/generators/content_blocks_for_projects.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ Feature:
7070
<%= f.input :content, as: :text_editor %>
7171
"""
7272

73+
# Date times should just be standard Rails widget
74+
Scenario: Date Time
75+
When I run `rails g cms:content_block sale runs_til:datetime`
76+
Then the file "app/views/cms/sales/_form.html.erb" should contain:
77+
"""
78+
<%= f.input :runs_til %>
79+
"""
80+
7381
Scenario: With Belongs To
7482
When I run `rails g cms:content_block product size:belongs_to`
7583
Then the file "app/models/product.rb" should contain:

lib/generators/cms/content_block/templates/_form.html.erb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
"association :#{attribute.name}, collection: categories_for('#{class_name.titleize}')"
1717
when :date
1818
"input :#{attribute.name}, as: :date_picker"
19-
when :datetime
20-
"datetime_select :#{attribute.name}"
2119
when :html
2220
"input :#{attribute.name}, as: :text_editor"
2321
else

test/dummy/db/schema.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@
556556
t.string "name"
557557
t.integer "price"
558558
t.integer "category_id"
559+
t.boolean "on_special"
559560
t.datetime "created_at"
560561
t.datetime "updated_at"
561562
t.integer "original_record_id"
@@ -572,6 +573,7 @@
572573
t.string "name"
573574
t.integer "price"
574575
t.integer "category_id"
576+
t.boolean "on_special"
575577
t.datetime "created_at"
576578
t.datetime "updated_at"
577579
t.integer "version"

0 commit comments

Comments
 (0)