rivet_cms 0.1.2.pre → 0.3.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/COPYING +674 -0
  4. data/COPYING.LESSER +165 -0
  5. data/README.md +173 -10
  6. data/app/assets/builds/rivet_cms.css +2 -2
  7. data/app/assets/builds/rivet_cms.js +395 -9505
  8. data/app/assets/stylesheets/rivet_cms/application.tailwind.css +145 -22
  9. data/app/controllers/concerns/rivet_cms/inertia_props.rb +239 -0
  10. data/app/controllers/rivet_cms/api_docs_controller.rb +47 -0
  11. data/app/controllers/rivet_cms/api_tokens_controller.rb +43 -0
  12. data/app/controllers/rivet_cms/application_controller.rb +220 -2
  13. data/app/controllers/rivet_cms/auth_controller.rb +28 -0
  14. data/app/controllers/rivet_cms/components_controller.rb +93 -2
  15. data/app/controllers/rivet_cms/content_controller.rb +105 -0
  16. data/app/controllers/rivet_cms/content_manager_controller.rb +32 -0
  17. data/app/controllers/rivet_cms/content_types_controller.rb +118 -26
  18. data/app/controllers/rivet_cms/dashboard_controller.rb +55 -5
  19. data/app/controllers/rivet_cms/documents_controller.rb +204 -0
  20. data/app/controllers/rivet_cms/fields_controller.rb +77 -74
  21. data/app/controllers/rivet_cms/invitations_controller.rb +36 -0
  22. data/app/controllers/rivet_cms/media_assets_controller.rb +76 -0
  23. data/app/controllers/rivet_cms/sessions_controller.rb +122 -0
  24. data/app/controllers/rivet_cms/setup_controller.rb +60 -0
  25. data/app/controllers/rivet_cms/trash_controller.rb +68 -0
  26. data/app/controllers/rivet_cms/users_controller.rb +117 -0
  27. data/app/helpers/rivet_cms/application_helper.rb +13 -3
  28. data/app/helpers/rivet_cms/components_helper.rb +4 -0
  29. data/app/helpers/rivet_cms/content_types_helper.rb +4 -0
  30. data/app/helpers/rivet_cms/dashboard_helper.rb +4 -0
  31. data/app/jobs/rivet_cms/webhook_delivery_job.rb +35 -0
  32. data/app/models/concerns/rivet_cms/has_fields.rb +31 -0
  33. data/app/models/concerns/rivet_cms/organization_scoped.rb +17 -0
  34. data/app/models/concerns/rivet_cms/revision_owned.rb +36 -0
  35. data/app/models/concerns/rivet_cms/sluggable.rb +38 -0
  36. data/app/models/concerns/rivet_cms/soft_deletable.rb +42 -0
  37. data/app/models/concerns/rivet_cms/typed_value.rb +51 -0
  38. data/app/models/rivet_cms/api_token.rb +64 -0
  39. data/app/models/rivet_cms/category.rb +20 -0
  40. data/app/models/rivet_cms/component.rb +10 -0
  41. data/app/models/rivet_cms/component_instance.rb +27 -0
  42. data/app/models/rivet_cms/content_type.rb +36 -23
  43. data/app/models/rivet_cms/content_value.rb +19 -0
  44. data/app/models/rivet_cms/current.rb +6 -0
  45. data/app/models/rivet_cms/document.rb +71 -0
  46. data/app/models/rivet_cms/document_revision.rb +128 -0
  47. data/app/models/rivet_cms/entry.rb +73 -0
  48. data/app/models/rivet_cms/entry_collection.rb +41 -0
  49. data/app/models/rivet_cms/field.rb +203 -61
  50. data/app/models/rivet_cms/media_asset.rb +109 -0
  51. data/app/models/rivet_cms/organization.rb +46 -0
  52. data/app/models/rivet_cms/relation.rb +23 -0
  53. data/app/models/rivet_cms/user.rb +61 -0
  54. data/app/serializers/rivet_cms/revision_preloader.rb +146 -0
  55. data/app/serializers/rivet_cms/revision_serializer.rb +123 -0
  56. data/app/services/rivet_cms/content_query.rb +158 -0
  57. data/app/services/rivet_cms/content_validator.rb +150 -0
  58. data/app/services/rivet_cms/draft_writer.rb +74 -0
  59. data/app/services/rivet_cms/open_api_generator.rb +173 -221
  60. data/app/services/rivet_cms/revision_pruner.rb +64 -0
  61. data/app/services/rivet_cms/webhooks.rb +61 -0
  62. data/app/views/layouts/rivet_cms/application.html.erb +35 -42
  63. data/config/routes.rb +68 -45
  64. data/db/migrate/20251119193607_create_rivet_cms_organizations.rb +17 -0
  65. data/db/migrate/20251120050818_create_rivet_cms_content_types.rb +14 -0
  66. data/db/migrate/20251121020625_create_rivet_cms_components.rb +14 -0
  67. data/db/migrate/20251121040115_create_rivet_cms_categories.rb +14 -0
  68. data/db/migrate/20260119185946_create_content_system_tables.rb +95 -0
  69. data/db/migrate/20260722000001_create_rivet_cms_media_assets.rb +15 -0
  70. data/db/migrate/20260722000002_create_rivet_cms_api_tokens.rb +16 -0
  71. data/db/migrate/20260806000001_add_title_and_alt_to_rivet_cms_media_assets.rb +7 -0
  72. data/db/migrate/20260806000002_add_deleted_at_to_rivet_cms_content_types.rb +6 -0
  73. data/db/migrate/20260807000001_add_deleted_at_to_rivet_cms_documents.rb +6 -0
  74. data/db/migrate/20260808000001_create_rivet_cms_users.rb +15 -0
  75. data/db/seeds/README.md +70 -0
  76. data/db/seeds/templates/blog.rb +39 -0
  77. data/db/seeds/templates/events.rb +12 -0
  78. data/db/seeds/templates/faq.rb +9 -0
  79. data/db/seeds/templates/pages.rb +35 -0
  80. data/db/seeds/templates/site_settings.rb +22 -0
  81. data/db/seeds/templates/team.rb +11 -0
  82. data/db/seeds/templates/testimonials.rb +11 -0
  83. data/lib/generators/rivet_cms/install/install_generator.rb +13 -0
  84. data/lib/generators/rivet_cms/install/templates/initializer.rb +77 -0
  85. data/lib/rivet_cms/access_check.rb +12 -0
  86. data/lib/rivet_cms/audit.rb +43 -0
  87. data/lib/rivet_cms/engine.rb +28 -22
  88. data/lib/rivet_cms/hooks.rb +106 -0
  89. data/lib/rivet_cms/navigation.rb +111 -0
  90. data/lib/rivet_cms/safe_pattern.rb +40 -0
  91. data/lib/rivet_cms/seeds.rb +264 -0
  92. data/lib/rivet_cms/version.rb +1 -1
  93. data/lib/rivet_cms.rb +289 -32
  94. data/lib/tasks/rivet_cms_tasks.rake +18 -4
  95. metadata +138 -98
  96. data/MIT-LICENSE +0 -20
  97. data/app/assets/builds/rivet_cms.js.map +0 -7
  98. data/app/assets/stylesheets/rivet_cms/brand_colors.css +0 -168
  99. data/app/controllers/rivet_cms/api/docs_controller.rb +0 -38
  100. data/app/helpers/rivet_cms/brand_color_helper.rb +0 -71
  101. data/app/helpers/rivet_cms/flash_helper.rb +0 -37
  102. data/app/helpers/rivet_cms/sign_out_helper.rb +0 -11
  103. data/app/javascript/controllers/content_type_form_controller.js +0 -53
  104. data/app/javascript/controllers/field_layout_controller.js +0 -709
  105. data/app/javascript/rivet_cms.js +0 -29
  106. data/app/models/rivet_cms/content.rb +0 -4
  107. data/app/models/rivet_cms/field_values/base.rb +0 -11
  108. data/app/models/rivet_cms/field_values/boolean.rb +0 -4
  109. data/app/models/rivet_cms/field_values/integer.rb +0 -4
  110. data/app/models/rivet_cms/field_values/string.rb +0 -4
  111. data/app/models/rivet_cms/field_values/text.rb +0 -4
  112. data/app/views/rivet_cms/api/docs/show.html.erb +0 -47
  113. data/app/views/rivet_cms/content_types/_form.html.erb +0 -98
  114. data/app/views/rivet_cms/content_types/edit.html.erb +0 -27
  115. data/app/views/rivet_cms/content_types/index.html.erb +0 -151
  116. data/app/views/rivet_cms/content_types/new.html.erb +0 -19
  117. data/app/views/rivet_cms/content_types/show.html.erb +0 -147
  118. data/app/views/rivet_cms/dashboard/index.html.erb +0 -263
  119. data/app/views/rivet_cms/fields/_form.html.erb +0 -111
  120. data/app/views/rivet_cms/fields/edit.html.erb +0 -25
  121. data/app/views/rivet_cms/fields/index.html.erb +0 -126
  122. data/app/views/rivet_cms/fields/new.html.erb +0 -25
  123. data/app/views/rivet_cms/shared/_navigation.html.erb +0 -153
  124. data/config/i18n-tasks.yml +0 -178
  125. data/config/locales/en.yml +0 -14
  126. data/db/migrate/20250317194359_create_core_tables.rb +0 -90
  127. data/lib/rivet_cms/routes.rb +0 -49
@@ -1,263 +0,0 @@
1
- <div>
2
- <div class="bg-white rounded-lg shadow-sm border border-gray-200 mb-8 p-6">
3
- <h1 class="text-2xl font-semibold text-gray-900">Welcome to RivetCMS</h1>
4
- <p class="mt-2 text-gray-500">Your headless CMS for structured content</p>
5
-
6
- <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mt-6">
7
- <div class="bg-white rounded-lg p-4 border border-gray-200 shadow-sm">
8
- <div class="flex items-center">
9
- <div class="p-2 rounded-md bg-brand-50 text-brand-600 border border-brand-100">
10
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layers">
11
- <polygon points="12 2 2 7 12 12 22 7 12 2" />
12
- <polyline points="2 17 12 22 22 17" />
13
- <polyline points="2 12 12 17 22 12" />
14
- </svg>
15
- </div>
16
- <div class="ml-4">
17
- <p class="text-sm text-gray-500">Content Types</p>
18
- <p class="text-xl font-medium text-gray-900"><%= @content_types.count %></p>
19
- </div>
20
- </div>
21
- </div>
22
-
23
- <div class="bg-white rounded-lg p-4 border border-gray-200 shadow-sm">
24
- <div class="flex items-center">
25
- <div class="p-2 rounded-md bg-brand-50 text-brand-600 border border-brand-100">
26
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text">
27
- <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
28
- <polyline points="14 2 14 8 20 8" />
29
- <line x1="16" x2="8" y1="13" y2="13" />
30
- <line x1="16" x2="8" y1="17" y2="17" />
31
- <line x1="10" x2="8" y1="9" y2="9" />
32
- </svg>
33
- </div>
34
- <div class="ml-4">
35
- <p class="text-sm text-gray-500">Content Items</p>
36
- <p class="text-xl font-medium text-gray-900"><%= @recent_contents.count %></p>
37
- </div>
38
- </div>
39
- </div>
40
-
41
- <div class="bg-white rounded-lg p-4 border border-gray-200 shadow-sm">
42
- <div class="flex items-center">
43
- <div class="p-2 rounded-md bg-brand-50 text-brand-600 border border-brand-100">
44
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-grid">
45
- <rect width="7" height="7" x="3" y="3" rx="1" />
46
- <rect width="7" height="7" x="14" y="3" rx="1" />
47
- <rect width="7" height="7" x="14" y="14" rx="1" />
48
- <rect width="7" height="7" x="3" y="14" rx="1" />
49
- </svg>
50
- </div>
51
- <div class="ml-4">
52
- <p class="text-sm text-gray-500">Components</p>
53
- <p class="text-xl font-medium text-gray-900"><%= @components.count %></p>
54
- </div>
55
- </div>
56
- </div>
57
- </div>
58
- </div>
59
-
60
- <div class="mt-6 grid grid-cols-1 gap-6 lg:grid-cols-2">
61
- <!-- Content Types Card -->
62
- <div class="bg-white overflow-hidden shadow-sm rounded-lg border border-gray-200">
63
- <div class="px-4 py-5 sm:px-6 flex justify-between items-center">
64
- <h2 class="text-lg font-medium text-gray-900 flex items-center">
65
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layers mr-2 text-brand-600">
66
- <polygon points="12 2 2 7 12 12 22 7 12 2" />
67
- <polyline points="2 17 12 22 22 17" />
68
- <polyline points="2 12 12 17 22 12" />
69
- </svg>
70
- Content Types
71
- </h2>
72
- <%= link_to new_content_type_path, class: "inline-flex items-center rounded-md bg-brand-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-brand-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-600" do %>
73
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus mr-1">
74
- <path d="M5 12h14" />
75
- <path d="M12 5v14" />
76
- </svg>
77
- New
78
- <% end %>
79
- </div>
80
- <div class="border-t border-gray-200 px-4 py-5 sm:p-6">
81
- <% if @content_types.any? %>
82
- <div class="flow-root">
83
- <ul role="list" class="-my-5 divide-y divide-gray-200">
84
- <% @content_types.each do |content_type| %>
85
- <li class="py-4 hover:bg-gray-50 rounded-md px-2">
86
- <div class="flex items-center space-x-4">
87
- <div class="flex-shrink-0">
88
- <span class="inline-flex h-10 w-10 items-center justify-center rounded-md bg-brand-50 text-brand-600 border border-brand-100">
89
- <% if content_type.is_single %>
90
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text">
91
- <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
92
- <polyline points="14 2 14 8 20 8" />
93
- <line x1="16" x2="8" y1="13" y2="13" />
94
- <line x1="16" x2="8" y1="17" y2="17" />
95
- <line x1="10" x2="8" y1="9" y2="9" />
96
- </svg>
97
- <% else %>
98
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layers">
99
- <polygon points="12 2 2 7 12 12 22 7 12 2" />
100
- <polyline points="2 17 12 22 22 17" />
101
- <polyline points="2 12 12 17 22 12" />
102
- </svg>
103
- <% end %>
104
- </span>
105
- </div>
106
- <div class="min-w-0 flex-1">
107
- <p class="truncate text-sm font-medium text-gray-900"><%= content_type.name %></p>
108
- <p class="truncate text-sm text-gray-500"><%= content_type.is_single ? "Single Type" : "Collection" %> • <%= content_type.contents.count %> items</p>
109
- </div>
110
- <div>
111
- <%= link_to content_type_path(content_type), class: "inline-flex items-center rounded-md bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50" do %>
112
- <% if content_type.is_single %>
113
- Edit
114
- <% else %>
115
- View All
116
- <% end %>
117
- <% end %>
118
- </div>
119
- </div>
120
- </li>
121
- <% end %>
122
- </ul>
123
- </div>
124
- <% else %>
125
- <div class="text-center py-6">
126
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-plus mx-auto h-12 w-12 text-gray-400">
127
- <path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z" />
128
- <line x1="12" x2="12" y1="10" y2="16" />
129
- <line x1="9" x2="15" y1="13" y2="13" />
130
- </svg>
131
- <h3 class="mt-2 text-sm font-semibold text-gray-900">No content types</h3>
132
- <p class="mt-1 text-sm text-gray-500">Get started by creating a new content type.</p>
133
- <div class="mt-6">
134
- <%= link_to new_content_type_path, class: "inline-flex items-center rounded-md bg-brand-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-brand-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-600" do %>
135
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus mr-2">
136
- <path d="M5 12h14" />
137
- <path d="M12 5v14" />
138
- </svg>
139
- New Content Type
140
- <% end %>
141
- </div>
142
- </div>
143
- <% end %>
144
- </div>
145
- </div>
146
-
147
- <!-- Recent Content Card -->
148
- <div class="bg-white overflow-hidden shadow-sm rounded-lg border border-gray-200">
149
- <div class="px-4 py-5 sm:px-6 flex justify-between items-center">
150
- <h2 class="text-lg font-medium text-gray-900 flex items-center">
151
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text mr-2 text-brand-600">
152
- <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
153
- <polyline points="14 2 14 8 20 8" />
154
- <line x1="16" x2="8" y1="13" y2="13" />
155
- <line x1="16" x2="8" y1="17" y2="17" />
156
- <line x1="10" x2="8" y1="9" y2="9" />
157
- </svg>
158
- Recent Content
159
- </h2>
160
- </div>
161
- <div class="border-t border-gray-200 px-4 py-5 sm:p-6">
162
- <% if @recent_contents.any? %>
163
- <div class="flow-root">
164
- <ul role="list" class="-my-5 divide-y divide-gray-200">
165
- <% @recent_contents.each do |content| %>
166
- <li class="py-4 hover:bg-gray-50 rounded-md px-2">
167
- <div class="flex items-center space-x-4">
168
- <div class="flex-shrink-0">
169
- <span class="inline-flex h-10 w-10 items-center justify-center rounded-md bg-brand-50 text-brand-600 border border-brand-100">
170
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file">
171
- <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
172
- <polyline points="14 2 14 8 20 8" />
173
- </svg>
174
- </span>
175
- </div>
176
- <div class="min-w-0 flex-1">
177
- <p class="truncate text-sm font-medium text-gray-900"><%= content.title %></p>
178
- <p class="truncate text-sm text-gray-500">
179
- <%= content.content_type.name %> •
180
- <span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium <%= content.status == 'published' ? 'bg-green-100 text-green-800 border border-green-200' : 'bg-yellow-100 text-yellow-800 border border-yellow-200' %>">
181
- <% if content.status == 'published' %>
182
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check mr-1"><polyline points="20 6 9 17 4 12"/></svg>
183
- <% else %>
184
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pencil mr-1"><path d="M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>
185
- <% end %>
186
- <%= content.status.capitalize %>
187
- </span>
188
- </p>
189
- </div>
190
- <div>
191
- <%= link_to "Edit", content_type_path(content.content_type), class: "inline-flex items-center rounded-md bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50" %>
192
- </div>
193
- </div>
194
- </li>
195
- <% end %>
196
- </ul>
197
- </div>
198
- <% else %>
199
- <div class="text-center py-6">
200
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text mx-auto h-12 w-12 text-gray-400">
201
- <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
202
- <polyline points="14 2 14 8 20 8" />
203
- <line x1="16" x2="8" y1="13" y2="13" />
204
- <line x1="16" x2="8" y1="17" y2="17" />
205
- <line x1="10" x2="8" y1="9" y2="9" />
206
- </svg>
207
- <h3 class="mt-2 text-sm font-semibold text-gray-900">No content</h3>
208
- <p class="mt-1 text-sm text-gray-500">Start creating content for your content types.</p>
209
- </div>
210
- <% end %>
211
- </div>
212
- </div>
213
- </div>
214
-
215
- <!-- API Information Card -->
216
- <div class="mt-6 bg-white overflow-hidden shadow-sm rounded-lg border border-gray-200">
217
- <div class="px-4 py-5 sm:px-6 flex items-center">
218
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code mr-2 text-brand-600">
219
- <polyline points="16 18 22 12 16 6" />
220
- <polyline points="8 6 2 12 8 18" />
221
- </svg>
222
- <h2 class="text-lg font-medium text-gray-900">API Endpoints</h2>
223
- </div>
224
- <div class="border-t border-gray-200 px-4 py-5 sm:p-6">
225
- <div class="prose pbrand-sm max-w-none">
226
- <div class="flex items-center mb-4">
227
- <p class="text-gray-700">Your content is accessible through the following API endpoints:</p>
228
- <%= link_to api_docs_path, class: "ml-4 inline-flex items-center text-sm text-brand-600 hover:text-brand-800 font-medium", target: "_blank" do %>
229
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-external-link mr-1"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" x2="21" y1="14" y2="3"/></svg>
230
- View API Docs
231
- <% end %>
232
- </div>
233
-
234
- <h3 class="font-medium text-gray-900 py-2 flex items-center">
235
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layers mr-2 text-brand-600">
236
- <polygon points="12 2 2 7 12 12 22 7 12 2" />
237
- <polyline points="2 17 12 22 22 17" />
238
- <polyline points="2 12 12 17 22 12" />
239
- </svg>
240
- Collection Types
241
- </h3>
242
- <pre class="bg-gray-50 p-3 rounded-md text-sm border border-gray-200 overflow-x-auto"><code class="text-gray-800">GET /api/v1/:slug</code> <span class="text-gray-500">- List all items</span></pre>
243
- <pre class="bg-gray-50 p-3 rounded-md text-sm border border-gray-200 overflow-x-auto"><code class="text-gray-800">GET /api/v1/:slug/:id</code> <span class="text-gray-500">- Get a specific item</span></pre>
244
- <pre class="bg-gray-50 p-3 rounded-md text-sm border border-gray-200 overflow-x-auto"><code class="text-gray-800">POST /api/v1/:slug</code> <span class="text-gray-500">- Create a new item</span></pre>
245
- <pre class="bg-gray-50 p-3 rounded-md text-sm border border-gray-200 overflow-x-auto"><code class="text-gray-800">PUT/PATCH /api/v1/:slug/:id</code> <span class="text-gray-500">- Update an item</span></pre>
246
- <pre class="bg-gray-50 p-3 rounded-md text-sm border border-gray-200 overflow-x-auto"><code class="text-gray-800">DELETE /api/v1/:slug/:id</code> <span class="text-gray-500">- Delete an item</span></pre>
247
-
248
- <h3 class="font-medium text-gray-900 py-2 flex items-center mt-4">
249
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text mr-2 text-brand-600">
250
- <path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
251
- <polyline points="14 2 14 8 20 8" />
252
- <line x1="16" x2="8" y1="13" y2="13" />
253
- <line x1="16" x2="8" y1="17" y2="17" />
254
- <line x1="10" x2="8" y1="9" y2="9" />
255
- </svg>
256
- Single Types
257
- </h3>
258
- <pre class="bg-gray-50 p-3 rounded-md text-sm border border-gray-200 overflow-x-auto"><code class="text-gray-800">GET /api/v1/:slug</code> <span class="text-gray-500">- Get the single item</span></pre>
259
- <pre class="bg-gray-50 p-3 rounded-md text-sm border border-gray-200 overflow-x-auto"><code class="text-gray-800">PUT/PATCH/POST /api/v1/:slug</code> <span class="text-gray-500">- Update the single item</span></pre>
260
- </div>
261
- </div>
262
- </div>
263
- </div>
@@ -1,111 +0,0 @@
1
- <%= form_with(model: [content_type, field],
2
- id: "field_form",
3
- class: "space-y-8",
4
- data: {
5
- controller: "field-form"
6
- }) do |form| %>
7
- <% if field.errors.any? %>
8
- <div class="rounded-md bg-red-50 p-4 mb-6 border border-red-100">
9
- <div class="flex">
10
- <div class="flex-shrink-0">
11
- <svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
12
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
13
- </svg>
14
- </div>
15
- <div class="ml-3">
16
- <h3 class="text-sm font-medium text-red-800">There were <%= pluralize(field.errors.count, "error") %> with this field:</h3>
17
- <div class="mt-2 text-sm text-red-700">
18
- <ul class="list-disc pl-5 space-y-1">
19
- <% field.errors.full_messages.each do |message| %>
20
- <li><%= message %></li>
21
- <% end %>
22
- </ul>
23
- </div>
24
- </div>
25
- </div>
26
- </div>
27
- <% end %>
28
-
29
- <div class="bg-white shadow-md rounded-lg overflow-hidden border border-gray-100">
30
- <div class="px-6 py-5 border-b border-gray-200 bg-gray-50">
31
- <h3 class="text-lg font-medium leading-6 text-gray-900"><%= field.new_record? ? "Add Field" : "Edit Field" %></h3>
32
- <p class="mt-1 text-sm text-gray-500">
33
- <%= field.new_record? ? "Configure the properties of your new field." : "Update the properties of this field." %>
34
- </p>
35
- </div>
36
-
37
- <div class="px-6 py-6 space-y-8">
38
- <div>
39
- <%= form.label :name, class: "block text-sm font-medium text-gray-700 mb-1" %>
40
- <div class="relative mt-1 group">
41
- <%= form.text_field :name,
42
- class: "block w-full pl-10 px-4 py-3 rounded-md border-gray-300 shadow-sm focus:ring-brand-500 focus:border-brand-500 sm:text-sm transition-all duration-200 group-hover:border-brand-300",
43
- placeholder: "e.g. Title, Description, Image",
44
- data: { field_form_target: "name" } %>
45
- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
46
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400 group-hover:text-brand-500 transition-colors duration-200" viewBox="0 0 20 20" fill="currentColor">
47
- <path d="M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z" />
48
- <path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z" clip-rule="evenodd" />
49
- </svg>
50
- </div>
51
- </div>
52
- <p class="mt-2 text-sm text-gray-500">The display name of the field.</p>
53
- </div>
54
-
55
- <div>
56
- <%= form.label :field_type, class: "block text-sm font-medium text-gray-700 mb-1" %>
57
- <div class="relative mt-1 group">
58
- <%= form.select :field_type,
59
- RivetCms::Field.field_types_for_select,
60
- {},
61
- class: "block w-full pl-10 px-4 py-3 rounded-md border-gray-300 shadow-sm focus:ring-brand-500 focus:border-brand-500 sm:text-sm transition-all duration-200 group-hover:border-brand-300" %>
62
- <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
63
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400 group-hover:text-brand-500 transition-colors duration-200" viewBox="0 0 20 20" fill="currentColor">
64
- <path fill-rule="evenodd" d="M3 5a2 2 0 012-2h10a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V5zm11 1H6v8l4-2 4 2V6z" clip-rule="evenodd" />
65
- </svg>
66
- </div>
67
- </div>
68
- <p class="mt-2 text-sm text-gray-500">The type of data this field will store.</p>
69
- </div>
70
-
71
- <div>
72
- <%= form.label :description, class: "block text-sm font-medium text-gray-700 mb-1" %>
73
- <div class="relative mt-1 group">
74
- <%= form.text_area :description,
75
- rows: 3,
76
- class: "block w-full pl-10 px-4 py-3 rounded-md border-gray-300 shadow-sm focus:ring-brand-500 focus:border-brand-500 sm:text-sm transition-all duration-200 group-hover:border-brand-300",
77
- placeholder: "Optional description of this field" %>
78
- <div class="absolute top-3 left-0 pl-3 flex items-start pointer-events-none">
79
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400 group-hover:text-brand-500 transition-colors duration-200" viewBox="0 0 20 20" fill="currentColor">
80
- <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
81
- </svg>
82
- </div>
83
- </div>
84
- <p class="mt-2 text-sm text-gray-500">A helpful description for content editors.</p>
85
- </div>
86
-
87
- <div class="pt-2">
88
- <div class="relative flex items-start">
89
- <div class="flex items-center h-5">
90
- <%= form.check_box :required,
91
- class: "h-5 w-5 rounded border-gray-300 text-brand-600 focus:ring-brand-500 transition-all duration-200",
92
- data: { field_form_target: "required" } %>
93
- </div>
94
- <div class="ml-3 text-sm">
95
- <%= form.label :required, "Required Field", class: "font-medium text-gray-700" %>
96
- <p class="text-gray-500">Make this field mandatory when creating or editing content.</p>
97
- </div>
98
- </div>
99
- </div>
100
- </div>
101
- </div>
102
-
103
- <div class="flex justify-end pt-4 space-x-3">
104
- <%= link_to content_type_fields_path(content_type),
105
- class: "cursor-pointer rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2 transition-all duration-200" do %>
106
- Cancel
107
- <% end %>
108
- <%= form.submit field.new_record? ? "Create Field" : "Update Field",
109
- class: "cursor-pointer inline-flex justify-center rounded-md border border-transparent bg-brand-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2 transition-all duration-200" %>
110
- </div>
111
- <% end %>
@@ -1,25 +0,0 @@
1
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-8">
2
- <div class="sm:flex sm:items-center">
3
- <div class="sm:flex-auto">
4
- <div class="flex items-center">
5
- <h1 class="text-2xl font-bold text-gray-900">Edit Field: <%= @field.name %></h1>
6
- <span class="ml-3 inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium <%= @content_type.is_single ? 'bg-amber-100 text-amber-800 border border-amber-200' : 'bg-teal-100 text-teal-800 border border-teal-200' %>">
7
- <%= @content_type.is_single ? "Single Type" : "Collection" %>
8
- </span>
9
- </div>
10
- <p class="mt-2 text-sm text-gray-700">
11
- Modify the properties of this field.
12
- </p>
13
- </div>
14
- <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
15
- <%= link_to content_type_fields_path(@content_type), class: "inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2" do %>
16
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2 -ml-1 text-gray-500" viewBox="0 0 20 20" fill="currentColor">
17
- <path fill-rule="evenodd" d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z" clip-rule="evenodd" />
18
- </svg>
19
- Back
20
- <% end %>
21
- </div>
22
- </div>
23
-
24
- <%= render 'form', content_type: @content_type, field: @field %>
25
- </div>
@@ -1,126 +0,0 @@
1
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6 space-y-6">
2
- <div class="sm:flex sm:items-center">
3
- <div class="sm:flex-auto">
4
- <div class="flex items-center">
5
- <h1 class="text-2xl font-bold text-gray-900">Structure: <%= @content_type.name %></h1>
6
- <span class="ml-3 inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium <%= @content_type.is_single ? 'bg-amber-100 text-amber-800 border border-amber-200' : 'bg-teal-100 text-teal-800 border border-teal-200' %>">
7
- <%= @content_type.is_single ? "Single Type" : "Collection" %>
8
- </span>
9
- </div>
10
- <p class="mt-2 text-sm text-gray-700">
11
- Define the structure of your content type by adding and arranging fields.
12
- </p>
13
- </div>
14
- <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
15
- <%= link_to new_content_type_field_path(@content_type), class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500 transition-all duration-200" do %>
16
- <svg xmlns="http://www.w3.org/2000/svg" class="-ml-1 mr-2 h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
17
- <path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd" />
18
- </svg>
19
- Add Field
20
- <% end %>
21
- <%= link_to content_type_path(@content_type), class: "ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray- focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2" do %>
22
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2 -ml-1 text-gray-500" viewBox="0 0 20 20" fill="currentColor">
23
- <path fill-rule="evenodd" d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z" clip-rule="evenodd" />
24
- </svg>
25
- Back
26
- <% end %>
27
- </div>
28
- </div>
29
-
30
- <div class="mt-6 bg-white shadow-md rounded-lg overflow-hidden border border-gray-100">
31
- <div class="px-4 py-4 border-b border-gray-200 bg-gray-50">
32
- <h3 class="text-lg font-medium leading-6 text-gray-900">Fields</h3>
33
- <p class="mt-1 text-sm text-gray-500">
34
- Drag and drop to reorder fields. Click on a field to edit its properties.
35
- <span class="block mt-1">To stack half-width fields, drag the second field slightly lower than the first. To place them side by side, make sure they're at the same vertical position.</span>
36
- </p>
37
- </div>
38
-
39
- <% if @fields.any? %>
40
- <div id="sortable-fields"
41
- data-controller="field-layout"
42
- data-field-layout-target="fieldContainer"
43
- data-field-layout-content-type-id-value="<%= @content_type.to_param %>"
44
- data-update-positions-path="<%= update_positions_content_type_fields_path(@content_type) %>"
45
- data-content-type-id="<%= @content_type.to_param %>"
46
- class="p-4 grid gap-3">
47
- <% @fields.order(:position).each do |field| %>
48
- <div class="field-item"
49
- data-field-layout-target="field"
50
- data-field-id="<%= field.to_param %>"
51
- data-width="<%= field.width || 'full' %>"
52
- data-row-group="<%= field.row_group || field.position %>"
53
- data-position="<%= field.position %>"
54
- data-update-width-path="<%= update_width_content_type_field_path(@content_type, field) %>">
55
- <div class="flex items-center justify-between h-12 rounded-lg">
56
- <div class="flex items-center flex-1">
57
- <div class="cursor-move mr-3 text-gray-400 hover:text-gray-600">
58
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
59
- <path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
60
- </svg>
61
- </div>
62
- <div class="min-w-0 flex-1">
63
- <h4 class="text-sm font-medium text-gray-900 truncate"><%= field.name %></h4>
64
- <div class="flex items-center">
65
- <span class="inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-800">
66
- <%= field.field_type_name %>
67
- </span>
68
- <% if field.required %>
69
- <span class="ml-2 inline-flex items-center rounded-full bg-red-100 px-2 py-0.5 text-xs font-medium text-red-800">
70
- Required
71
- </span>
72
- <% end %>
73
- </div>
74
- </div>
75
- </div>
76
- <div class="flex items-center space-x-2">
77
- <button type="button"
78
- class="toggle-width-button text-gray-500 hover:text-gray-700 transition-colors duration-150 p-1 hover:bg-gray-200 rounded-full"
79
- data-action="click->field-layout#toggleWidth">
80
- <span class="sr-only">Toggle width</span>
81
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-5 w-5">
82
- <% if field.width == 'full' %>
83
- <path d="m15 15 6 6m-6-6v4.8m0-4.8h4.8"/><path d="M9 19.8V15m0 0H4.2M9 15l-6 6"/><path d="M15 9l6-6m-6 6V4.2m0 4.8h4.8"/><path d="M9 4.2V9m0 0H4.2M9 9 3 3"/>
84
- <% else %>
85
- <path d="m21 21-6-6m6 6v-4.8m0 4.8h-4.8"/><path d="M3 16.2V21m0 0h4.8M3 21l6-6"/><path d="M21 7.8V3m0 0h-4.8M21 3l-6 6"/><path d="M3 7.8V3m0 0h4.8M3 3l6 6"/>
86
- <% end %>
87
- </svg>
88
- </button>
89
- <%= link_to edit_content_type_field_path(@content_type, field), class: "text-amber-500 hover:text-amber-700 transition-colors duration-150 p-1 hover:bg-amber-100 rounded-full" do %>
90
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
91
- <path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z" />
92
- </svg>
93
- <% end %>
94
- <%= button_to content_type_field_path(@content_type, field),
95
- method: :delete,
96
- class: "text-red-500 hover:text-red-700 transition-colors duration-150 p-1 hover:bg-red-100 rounded-full",
97
- form_class: "flex items-center",
98
- data: { confirm: "Are you sure you want to delete this field? This will also delete all associated data." } do %>
99
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
100
- <path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd" />
101
- </svg>
102
- <% end %>
103
- </div>
104
- </div>
105
- </div>
106
- <% end %>
107
- </div>
108
- <% else %>
109
- <div class="px-4 py-8 text-center">
110
- <svg xmlns="http://www.w3.org/2000/svg" class="mx-auto h-12 w-12 text-gray-300" fill="none" viewBox="0 0 24 24" stroke="currentColor">
111
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
112
- </svg>
113
- <h3 class="mt-2 text-sm font-medium text-gray-900">No fields</h3>
114
- <p class="mt-1 text-sm text-gray-500">Get started by creating a new field.</p>
115
- <div class="mt-6">
116
- <%= link_to new_content_type_field_path(@content_type), class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500 transition-all duration-200" do %>
117
- <svg xmlns="http://www.w3.org/2000/svg" class="-ml-1 mr-2 h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
118
- <path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd" />
119
- </svg>
120
- Add Field
121
- <% end %>
122
- </div>
123
- </div>
124
- <% end %>
125
- </div>
126
- </div>
@@ -1,25 +0,0 @@
1
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-8">
2
- <div class="sm:flex sm:items-center">
3
- <div class="sm:flex-auto">
4
- <div class="flex items-center">
5
- <h1 class="text-2xl font-bold text-gray-900">Add Field: <%= @content_type.name %></h1>
6
- <span class="ml-3 inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium <%= @content_type.is_single ? 'bg-amber-100 text-amber-800 border border-amber-200' : 'bg-teal-100 text-teal-800 border border-teal-200' %>">
7
- <%= @content_type.is_single ? "Single Type" : "Collection" %>
8
- </span>
9
- </div>
10
- <p class="mt-2 text-sm text-gray-700">
11
- Add a new field to your content type structure.
12
- </p>
13
- </div>
14
- <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
15
- <%= link_to content_type_fields_path(@content_type), class: "inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2" do %>
16
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2 -ml-1 text-gray-500" viewBox="0 0 20 20" fill="currentColor">
17
- <path fill-rule="evenodd" d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z" clip-rule="evenodd" />
18
- </svg>
19
- Back
20
- <% end %>
21
- </div>
22
- </div>
23
-
24
- <%= render 'form', content_type: @content_type, field: @field %>
25
- </div>