iron-cms 0.2.1 → 0.4.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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -0
  3. data/app/assets/builds/iron.css +1468 -1447
  4. data/app/assets/tailwind/iron/application.css +12 -1
  5. data/app/assets/tailwind/iron/components/button.css +110 -60
  6. data/app/assets/tailwind/iron/components/input.css +11 -9
  7. data/app/assets/tailwind/iron/components/sidebar.css +13 -17
  8. data/app/helpers/iron/application_helper.rb +1 -1
  9. data/app/helpers/iron/form_builder.rb +46 -0
  10. data/app/javascript/iron/application.js +2 -0
  11. data/app/models/iron/entry/web_publishable.rb +12 -12
  12. data/app/views/iron/block_definitions/_form.html.erb +1 -1
  13. data/app/views/iron/block_definitions/index.html.erb +1 -1
  14. data/app/views/iron/block_definitions/show.html.erb +3 -3
  15. data/app/views/iron/content_types/_form.html.erb +1 -1
  16. data/app/views/iron/content_types/index.html.erb +4 -7
  17. data/app/views/iron/content_types/show.html.erb +3 -9
  18. data/app/views/iron/contents/new.html.erb +2 -2
  19. data/app/views/iron/entries/_form.html.erb +45 -37
  20. data/app/views/iron/entries/edit.html.erb +2 -12
  21. data/app/views/iron/entries/fields/_block.html.erb +3 -4
  22. data/app/views/iron/entries/fields/_block_list.html.erb +26 -17
  23. data/app/views/iron/entries/fields/_reference_item.html.erb +2 -3
  24. data/app/views/iron/entries/fields/_text_field.html.erb +1 -1
  25. data/app/views/iron/entries/index.html.erb +1 -1
  26. data/app/views/iron/field_definitions/_field_definition.html.erb +1 -2
  27. data/app/views/iron/field_definitions/edit.html.erb +1 -7
  28. data/app/views/iron/field_definitions/layouts/_form.html.erb +1 -1
  29. data/app/views/iron/first_runs/show.html.erb +1 -1
  30. data/app/views/iron/locales/_form.html.erb +1 -1
  31. data/app/views/iron/locales/_locale.html.erb +1 -1
  32. data/app/views/iron/locales/index.html.erb +1 -1
  33. data/app/views/iron/passwords/edit.html.erb +31 -6
  34. data/app/views/iron/passwords/new.html.erb +19 -18
  35. data/app/views/iron/schemas/new.html.erb +2 -2
  36. data/app/views/iron/sessions/new.html.erb +27 -26
  37. data/app/views/iron/settings/show.html.erb +3 -4
  38. data/app/views/iron/shared/_collection_select.html.erb +31 -0
  39. data/app/views/iron/users/_form.html.erb +1 -1
  40. data/app/views/iron/users/new.html.erb +1 -1
  41. data/app/views/iron/users/show.html.erb +1 -4
  42. data/app/views/layouts/iron/_mobile_header.html.erb +10 -0
  43. data/app/views/layouts/iron/_sidebar.html.erb +26 -81
  44. data/app/views/layouts/iron/_sidebar_content.html.erb +36 -0
  45. data/app/views/layouts/iron/_sidebar_item.html.erb +1 -5
  46. data/app/views/layouts/iron/_user_menu.html.erb +26 -0
  47. data/app/views/layouts/iron/application.html.erb +11 -27
  48. data/app/views/layouts/iron/authentication.html.erb +4 -21
  49. data/config/importmap.rb +1 -0
  50. data/lib/iron/test_fixtures.rb +50 -0
  51. data/lib/iron/version.rb +1 -1
  52. data/lib/iron.rb +1 -0
  53. data/lib/tasks/iron_tasks.rake +24 -0
  54. metadata +8 -3
  55. data/app/helpers/iron/components/dropdown_helper.rb +0 -161
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3dc16db2bf8c1ee5f0cca129113aed94f3064d405ae13b7a8a80cc2f601c4a4f
4
- data.tar.gz: ff04983432ca9fce51945b29625144685b082047278f6afda51a057e70040b5a
3
+ metadata.gz: 0a723695ec8ae52789c95a89025f4b3581d5e132a8a1b15bc57303c420f42eed
4
+ data.tar.gz: 1af793ed846e38b642d94616dea5681e5199807efe28396ce67aba8b39faee4a
5
5
  SHA512:
6
- metadata.gz: 8f1b195f43f04b198e29f18c8bae4dde22424dd869435db76c1e1ea644f8756e67ca0f0cd6f81b4b83410687c664e14952448b599125630c12a13dc547f744a8
7
- data.tar.gz: c3c3fa9ae10cb698dac50abdac3f36fd6d0342f2ca7800e8d42445330fdb7863faab8a562b57d2d432a71e50ba7a12138d90592b77557a455e55a0899bfb5fba
6
+ metadata.gz: e5ecdb0c99b50e96bd357fb954119c443f6e2d1654adf2de467fd3f3e27d22b8d852bd65f7372ea61bfdab3e5ab87acdef6f22bed85d09289d9fcda8ffffdcb2
7
+ data.tar.gz: 2e9296551ecd8cfbd3229257fea50c69bf34f1a3df96bb915d370167fb0c98b6408b6caed649c600ada0b4bf6477b97055be420e4c76c4e810ab0d997ed9f6f6
data/README.md CHANGED
@@ -9,6 +9,7 @@ Iron is a flexible CMS engine for Rails apps
9
9
  Iron CMS allows you to publish content types to your website. To set this up:
10
10
 
11
11
  1. **Install the pages controller** in your application:
12
+
12
13
  ```bash
13
14
  bin/rails g iron:pages
14
15
  ```
@@ -19,6 +20,7 @@ Iron CMS allows you to publish content types to your website. To set this up:
19
20
  - Create a default view template
20
21
 
21
22
  2. **Create custom templates** for your content types:
23
+
22
24
  ```bash
23
25
  bin/rails g iron:template article
24
26
  ```
@@ -60,6 +62,7 @@ Use `iron_picture_tag` for optimal image delivery:
60
62
  ```
61
63
 
62
64
  This automatically:
65
+
63
66
  - Generates responsive variants (150w, 320w, 640w, 1024w, 1920w)
64
67
  - Serves modern formats (AVIF, WebP) with automatic fallback
65
68
  - Adds proper dimensions to prevent layout shift
@@ -93,6 +96,38 @@ For cases where you need a basic responsive image without format optimization:
93
96
 
94
97
  This generates a standard `<img>` with srcset but without modern format variants.
95
98
 
99
+ ### Testing
100
+
101
+ Iron provides test fixtures to populate your test database with CMS schema and content, eliminating the need to stub the SDK in your tests.
102
+
103
+ #### Generating Fixtures
104
+
105
+ Generate test fixtures from your development database (or production if you prefer):
106
+
107
+ ```bash
108
+ bin/rails iron:fixtures:generate
109
+ ```
110
+
111
+ This creates two files in `test/fixtures/iron/`:
112
+
113
+ - `schema.tar.gz` - Content types, field definitions, and block definitions
114
+ - `content.tar.gz` - All entries and their field data
115
+
116
+ Regenerate these fixtures whenever you make changes to your CMS schema or content that you want reflected in tests.
117
+
118
+ #### Using Fixtures in Tests
119
+
120
+ Load the fixtures in your `test/test_helper.rb`:
121
+
122
+ ```ruby
123
+ class ActiveSupport::TestCase
124
+ fixtures :all
125
+ Iron::TestFixtures.load
126
+ end
127
+ ```
128
+
129
+ The fixtures are loaded once at the start of your test suite. Rails' transactional tests provide test isolation by rolling back changes after each test.
130
+
96
131
  ## Installation
97
132
 
98
133
  Add this line to your application's Gemfile:
@@ -174,6 +209,7 @@ To release a new version of the Iron gem:
174
209
  - Update `CHANGELOG.md` with the changes for the new version
175
210
 
176
211
  2. **Commit and tag the release:**
212
+
177
213
  ```bash
178
214
  git add -A
179
215
  git commit -m "chore: release version X.Y.Z"
@@ -181,11 +217,13 @@ To release a new version of the Iron gem:
181
217
  ```
182
218
 
183
219
  3. **Push to GitHub:**
220
+
184
221
  ```bash
185
222
  git push origin main --tags
186
223
  ```
187
224
 
188
225
  4. **Build and publish the gem:**
226
+
189
227
  ```bash
190
228
  gem build iron.gemspec
191
229
  gem push iron-X.Y.Z.gem