moved section subsection templetes down

This commit is contained in:
Torsten 2022-11-26 11:15:56 +02:00
parent 738bfe01a5
commit 27aea8e5ab
19 changed files with 84 additions and 13 deletions

View File

@ -0,0 +1,4 @@
module Cms
class SectionsController < CmsController
end
end

View File

@ -0,0 +1,2 @@
module Cms::SectionHelper
end

View File

@ -15,10 +15,10 @@
%button.mt-4.rounded-lg.bg-yellow-500.p-4
=link_to "Down" , "/index"
%button.mt-4.rounded-lg.bg-blue-400.p-4
=link_to "Edit" , "/index"
=link_to "Edit" , cms_page_section_path(@page.name , 1234)
%button.mt-4.rounded-lg.bg-cyan-400.p-4
=link_to "New" , "/index"
%button.mt-4.rounded-lg.bg-red-400.p-4
=link_to "Delete" , "/index"
-section.content.each do |key , value|
= render "cms/sections/#{key}", section: section , key: key , value: value
= render "cms/sections/data/#{key}", section: section , key: key , value: value

View File

@ -0,0 +1,10 @@
= form_for @cms_section do |f|
- if @cms_section.errors.any?
#error_explanation
%h2= "#{pluralize(@cms_section.errors.count, "error")} prohibited this cms_section from being saved:"
%ul
- @cms_section.errors.full_messages.each do |message|
%li= message
.actions
= f.submit 'Save'

View File

@ -0,0 +1,7 @@
%h1 Editing cms_section
= render 'form'
= link_to 'Show', @cms_section
\|
= link_to 'Back', cms_sections_path

View File

@ -0,0 +1,19 @@
%h1 Listing cms_sections
%table
%thead
%tr
%th
%th
%th
%tbody
- @cms_sections.each do |cms_section|
%tr
%td= link_to 'Show', cms_section
%td= link_to 'Edit', edit_cms_section_path(cms_section)
%td= link_to 'Destroy', cms_section, method: :delete, data: { confirm: 'Are you sure?' }
%br
= link_to 'New Section', new_cms_section_path

View File

@ -0,0 +1,5 @@
%h1 New cms_section
= render 'form'
= link_to 'Back', cms_sections_path

View File

@ -0,0 +1,6 @@
%p#notice= notice
= #link_to 'Edit', edit_cms_section_path(@cms_section)
\|
= #link_to 'Back', cms_sections_path

View File

@ -29,17 +29,11 @@
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => cms_images_path}
Images
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
History
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/cms/styles"}
Styles
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
Services
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
Projects
%li
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/"}
Blog
%a.text-gray-500.transition{:class => "hover:text-gray-500/75", :href => "/changes"}
Changes
.flex.items-center.gap-4
.sm:flex.sm:gap-4
%a.rounded-md.bg-teal-600.px-5.text-sm.font-medium.text-white.shadow{:class => "py-2.5", :href => "/"}

View File

@ -1,7 +1,9 @@
Rails.application.routes.draw do
namespace :cms do
resources :pages
resources :pages do
resources :sections
end
resources :images
end

View File

@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the Cms::SectionHelper. For example:
#
# describe Cms::SectionHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe Cms::SectionHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@ -0,0 +1,7 @@
require 'rails_helper'
RSpec.describe "Cms::Sections", type: :request do
describe "GET /index" do
pending "add some examples (or delete) #{__FILE__}"
end
end