Name
Blog

Description
Blog with rich-text post and comments

Pack
{
  "pages": [
    {
      "name": "Blog",
      "title": "Saltcorn blog",
      "layout": {
        "above": [
          {
            "type": "blank",
            "contents": "This is the blog for "
          },
          {
            "url": "https://saltcorn.com/",
            "text": "Saltcorn",
            "type": "link"
          },
          {
            "type": "blank",
            "contents": "— an open-source no-code builder for web applications"
          },
          {
            "type": "line_break"
          },
          {
            "type": "line_break"
          },
          {
            "name": "9b3f64",
            "type": "view",
            "view": "Posts",
            "state": "shared"
          }
        ]
      },
      "min_role": 10,
      "menu_label": "Posts",
      "description": "Blog for saltcorn, a no-code database application platform",
      "fixed_states": {},
      "root_page_for_roles": [
        "admin",
        "staff",
        "user",
        "public"
      ]
    },
    {
      "name": "PostPage",
      "title": "Saltcorn blog post",
      "layout": {
        "widths": [
          9,
          3
        ],
        "besides": [
          {
            "name": "7b7925",
            "type": "view",
            "view": "Full Post",
            "state": "shared"
          },
          {
            "above": [
              {
                "type": "blank",
                "contents": "Recent posts",
                "isFormula": {},
                "textStyle": "h6"
              },
              {
                "name": "1f4dfb",
                "type": "view",
                "view": "RecentPosts",
                "state": "fixed"
              }
            ]
          }
        ],
        "breakpoint": "sm"
      },
      "min_role": 10,
      "description": "",
      "fixed_states": {
        "1f4dfb": {
          "body": "",
          "title": "",
          "excerpt": "",
          "published": null
        },
        "fixed_stateforrecentpostsview": null
      },
      "root_page_for_roles": []
    }
  ],
  "views": [
    {
      "name": "Posts",
      "table": "Posts",
      "min_role": 10,
      "on_root_page": true,
      "viewtemplate": "Feed",
      "configuration": {
        "cols_lg": 1,
        "cols_md": 1,
        "cols_sm": 1,
        "cols_xl": 1,
        "in_card": false,
        "viewname": "Posts",
        "show_view": "PeekPost",
        "descending": true,
        "order_field": "published",
        "view_to_create": "EditPost"
      },
      "default_render_page": null
    },
    {
      "name": "CommentFeed",
      "table": "Comments",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "Feed",
      "configuration": {
        "cols_lg": 1,
        "cols_md": 1,
        "cols_sm": 1,
        "cols_xl": 1,
        "in_card": false,
        "viewname": "CommentFeed",
        "show_view": "ShowComment",
        "descending": false,
        "order_field": "written",
        "view_to_create": "EditComment"
      },
      "default_render_page": null
    },
    {
      "name": "ShowPost",
      "table": "Posts",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "Show",
      "configuration": {
        "layout": {
          "above": [
            {
              "type": "field",
              "fieldview": "as_header",
              "field_name": "title"
            },
            {
              "type": "field",
              "block": true,
              "fieldview": "showDay",
              "field_name": "published"
            },
            {
              "type": "field",
              "block": true,
              "fieldview": "showAll",
              "field_name": "body"
            },
            {
              "type": "view_link",
              "view": "Own:EditPost",
              "minRole": "4",
              "isFormula": {},
              "view_label": "Edit"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "as_header",
            "field_name": "title"
          },
          {
            "type": "Field",
            "fieldview": "showDay",
            "field_name": "published"
          },
          {
            "type": "Field",
            "fieldview": "showAll",
            "field_name": "body"
          },
          {
            "type": "ViewLink",
            "view": "Own:EditPost",
            "minRole": "4"
          }
        ],
        "viewname": "ShowPost",
        "page_title": "title",
        "page_title_formula": true
      },
      "default_render_page": ""
    },
    {
      "name": "ShowComment",
      "table": "Comments",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "Show",
      "configuration": {
        "layout": {
          "above": [
            {
              "type": "field",
              "block": false,
              "fieldview": "as_text",
              "textStyle": "small",
              "field_name": "name"
            },
            {
              "type": "field",
              "block": true,
              "fieldview": "relative",
              "textStyle": "small",
              "field_name": "written"
            },
            {
              "type": "field",
              "block": false,
              "fieldview": "as_text",
              "textStyle": "",
              "field_name": "comment"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "as_text",
            "field_name": "name"
          },
          {
            "type": "Field",
            "fieldview": "relative",
            "field_name": "written"
          },
          {
            "type": "Field",
            "fieldview": "as_text",
            "field_name": "comment"
          }
        ],
        "viewname": "ShowComment"
      },
      "default_render_page": null
    },
    {
      "name": "EditComment",
      "table": "Comments",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "Edit",
      "configuration": {
        "fixed": {
          "written": null,
          "preset_written": "Now"
        },
        "layout": {
          "above": [
            {
              "aligns": [
                "left",
                "left"
              ],
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Your name",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "edit",
                      "textStyle": "",
                      "field_name": "name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "aligns": [
                "left",
                "left"
              ],
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Comment",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "Summernote",
                      "textStyle": "",
                      "field_name": "comment"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "type": "field",
              "block": true,
              "fieldview": "edit",
              "textStyle": "",
              "field_name": "post"
            },
            {
              "type": "action",
              "block": false,
              "minRole": 10,
              "action_name": "Save"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "edit",
            "field_name": "name"
          },
          {
            "type": "Field",
            "fieldview": "Summernote",
            "field_name": "comment"
          },
          {
            "type": "Field",
            "fieldview": "edit",
            "field_name": "post"
          },
          {
            "type": "Action",
            "minRole": 10,
            "action_name": "Save"
          }
        ],
        "viewname": "EditComment",
        "view_when_done": "Posts"
      },
      "default_render_page": null
    },
    {
      "name": "Full Post",
      "table": "Posts",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "ListShowList",
      "configuration": {
        "viewname": "Full Post",
        "list_view": "",
        "show_view": "ShowPost",
        "subtables": {
          "ChildList:CommentFeed.Comments.post": true,
          "ChildList:EditComment.Comments.post": false
        }
      },
      "default_render_page": "PostPage"
    },
    {
      "name": "PeekPost",
      "table": "Posts",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "Show",
      "configuration": {
        "layout": {
          "above": [
            {
              "type": "line_break"
            },
            {
              "url": "'https://blog.saltcorn.com/view/Full%20Post?title='+title",
              "text": "title",
              "type": "link",
              "isFormula": {
                "url": true,
                "text": true
              },
              "textStyle": "h3"
            },
            {
              "type": "field",
              "block": true,
              "fieldview": "relative",
              "field_name": "published"
            },
            {
              "type": "field",
              "block": true,
              "fieldview": "showAll",
              "field_name": "excerpt"
            },
            {
              "stat": "Count",
              "type": "aggregation",
              "agg_field": "name",
              "textStyle": "small",
              "agg_relation": "Comments.post"
            },
            {
              "type": "blank",
              "contents": " comments",
              "isFormula": {},
              "textStyle": "small"
            },
            {
              "type": "view_link",
              "view": "Own:Full Post",
              "block": true,
              "minRole": 10,
              "view_label": "Read full post..."
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "relative",
            "field_name": "published"
          },
          {
            "type": "Field",
            "fieldview": "showAll",
            "field_name": "excerpt"
          },
          {
            "stat": "Count",
            "type": "Aggregation",
            "agg_field": "name",
            "agg_relation": "Comments.post"
          },
          {
            "type": "ViewLink",
            "view": "Own:Full Post",
            "minRole": 10
          }
        ],
        "viewname": "PeekPost"
      },
      "default_render_page": null
    },
    {
      "name": "EditPost",
      "table": "Posts",
      "min_role": 8,
      "on_root_page": false,
      "viewtemplate": "Edit",
      "configuration": {
        "fixed": {
          "published": null,
          "preset_published": "Now"
        },
        "layout": {
          "above": [
            {
              "aligns": [
                "left",
                "left"
              ],
              "widths": [
                12
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Title",
                      "textStyle": ""
                    },
                    {
                      "type": "line_break"
                    },
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "edit",
                      "textStyle": "",
                      "field_name": "title"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "aligns": [
                "left",
                "left"
              ],
              "widths": [
                12
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Excerpt",
                      "textStyle": ""
                    },
                    {
                      "type": "line_break"
                    },
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "Summernote",
                      "textStyle": "",
                      "field_name": "excerpt"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "aligns": [
                "left",
                "left"
              ],
              "widths": [
                12
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Body",
                      "textStyle": ""
                    },
                    {
                      "type": "line_break"
                    },
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "Summernote",
                      "textStyle": "",
                      "field_name": "body"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "type": "action",
              "block": false,
              "minRole": 10,
              "action_name": "Save"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "edit",
            "field_name": "title"
          },
          {
            "type": "Field",
            "fieldview": "Summernote",
            "field_name": "excerpt"
          },
          {
            "type": "Field",
            "fieldview": "Summernote",
            "field_name": "body"
          },
          {
            "type": "Action",
            "minRole": 10,
            "action_name": "Save"
          }
        ],
        "viewname": "EditPost",
        "view_when_done": "ShowPost"
      },
      "default_render_page": null
    },
    {
      "name": "ShortPostPeek",
      "table": "Posts",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "Show",
      "configuration": {
        "layout": {
          "above": [
            {
              "type": "view_link",
              "view": "Own:Full Post",
              "block": true,
              "minRole": 10,
              "isFormula": {
                "label": true
              },
              "view_label": "title"
            },
            {
              "type": "field",
              "block": true,
              "fieldview": "relative",
              "field_name": "published"
            },
            {
              "type": "line_break"
            }
          ]
        },
        "columns": [
          {
            "type": "ViewLink",
            "view": "Own:Full Post",
            "minRole": 10
          },
          {
            "type": "Field",
            "fieldview": "relative",
            "field_name": "published"
          }
        ],
        "viewname": "ShortPostPeek"
      },
      "default_render_page": ""
    },
    {
      "name": "RecentPosts",
      "table": "Posts",
      "min_role": 10,
      "on_root_page": false,
      "viewtemplate": "Feed",
      "configuration": {
        "cols_lg": 1,
        "cols_md": 1,
        "cols_sm": 1,
        "cols_xl": 1,
        "in_card": false,
        "viewname": "RecentPosts",
        "show_view": "ShortPostPeek",
        "descending": true,
        "order_field": "published",
        "rows_per_page": 5,
        "view_to_create": "",
        "hide_pagination": true,
        "create_view_display": "Link"
      },
      "default_render_page": ""
    }
  ],
  "tables": [
    {
      "name": "Comments",
      "fields": [
        {
          "name": "name",
          "type": "String",
          "label": "Your name",
          "stored": false,
          "required": false,
          "is_unique": false,
          "attributes": {
            "match": "",
            "options": ""
          },
          "calculated": false,
          "expression": null
        },
        {
          "name": "comment",
          "type": "HTML",
          "label": "Comment",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {},
          "calculated": false,
          "expression": null
        },
        {
          "name": "written",
          "type": "Date",
          "label": "Written",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {},
          "calculated": false,
          "expression": null
        },
        {
          "name": "post",
          "type": "Key",
          "label": "Post",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {
            "summary_field": "title"
          },
          "calculated": false,
          "expression": null,
          "reftable_name": "Posts"
        }
      ],
      "triggers": [],
      "versioned": false,
      "constraints": [],
      "min_role_read": 10,
      "min_role_write": 10
    },
    {
      "name": "Posts",
      "fields": [
        {
          "name": "title",
          "type": "String",
          "label": "Title",
          "stored": false,
          "required": true,
          "is_unique": true,
          "attributes": {
            "options": ""
          },
          "calculated": false,
          "expression": null
        },
        {
          "name": "body",
          "type": "HTML",
          "label": "Body",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {},
          "calculated": false,
          "expression": null
        },
        {
          "name": "published",
          "type": "Date",
          "label": "Published",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {},
          "calculated": false,
          "expression": null
        },
        {
          "name": "excerpt",
          "type": "HTML",
          "label": "Excerpt",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {
            "default": " \r\n"
          },
          "calculated": false,
          "expression": null
        }
      ],
      "triggers": [],
      "versioned": false,
      "constraints": [],
      "min_role_read": 10,
      "min_role_write": 1
    }
  ],
  "plugins": [
    {
      "name": "blog-bootstrap-theme",
      "source": "npm",
      "location": "@saltcorn/blog-bootstrap-theme",
      "configuration": null
    },
    {
      "name": "@saltcorn/html",
      "source": "npm",
      "location": "@saltcorn/html",
      "configuration": null
    },
    {
      "name": "summernote",
      "source": "npm",
      "location": "@saltcorn/summernote",
      "configuration": null
    }
  ]
}