SpinaCMS / Spina

Spina CMS
http://www.spinacms.com
Other
2.19k stars 405 forks source link

Nested repeater bugs in 2.0.0.beta #608

Closed mtomov closed 3 years ago

mtomov commented 4 years ago

Hi,

I have started using the 2.0.beta version of Spina. I like the updated UI and the jsonb column to store everything. Thanks for that!

I'm trying to use the new "repeater" in "repeater" mode, but I think the JS is not up to date to support it.

I've tried to capture some of the issues:

nested-repeater-bugs

Configurationwise, this is it:

  # config/initializers/themes/default.rb

  theme.parts = [
    {
      name: "text",
      title: "Text",
      part_type: "Spina::Parts::Text"
    },
    {
      name: "name",
      title: "Name",
      part_type: "Spina::Parts::Line"
    },
    {
      name: "title",
      title: "Title",
      part_type: "Spina::Parts::Line"
    },
    {
      name: "description",
      title: "Description",
      part_type: "Spina::Parts::Text"
    },
    {
      name: "modules",
      title: "Modules",
      part_type: "Spina::Parts::Repeater",
      parts: ["name", "description", "lessons"]
    },
    {
      name: "lessons",
      title: "Lessons",
      part_type: "Spina::Parts::Repeater",
      parts: ["name", "description"]
    }
  ]

  theme.view_templates = [
    {
      name: "course",
      title: "Course",
      description: "A Full Course",
      usage: "Use to create a course with lessons",
      parts: ["title", "description", "modules"]
    }
  ]

Thank you!

Bramjetten commented 4 years ago

You're trying to nest repeater within repeaters. That's not supported by the current UI.