Removed the bundle which shouldn't be in the repository; Added the basic view that was referenced in the database still; Added custom classes that now work to the CKEditor.

This commit is contained in:
2021-01-14 09:43:14 -08:00
parent 9b8760fd34
commit d16c76afb4
11 changed files with 80 additions and 84 deletions

View File

@@ -1,54 +0,0 @@
# Apostrophe Boilerplate v2.x
Apostrophe Boilerplate is a minimal starting point for [Apostrophe 2](https://github.com/apostrophecms/apostrophe) projects.
To get started, we recommend taking a look at [our guide to creating your first project](http://apostrophecms.org/docs/tutorials/getting-started/creating-your-first-project.html). You could also take a look at [Apostrophe's CLI](https://github.com/apostrophecms/apostrophe) or simply fork this repository.
Once you have a local copy of this project to work from, make sure to install its dependencies with `npm install`. With Apostrophe installed, the first thing to do create an admin user account so you're able to log into the CMS. Run the following command (this will prompt you for a password).
```bash
node app.js apostrophe-users:add admin admin
```
Now you're all set! Just run `node app.js` to start up the local server and head to `localhost:3000` in your web browser.
---------------
For more documentation on Apostrophe, visit the [A2 documentation site](http://apostrophecms.com).
## Getting started with Docker
If you prefer, you can run Apostrophe inside a Docker container with the provided configuration in `Dockerfile` and `docker-compose.yml`.
**These aren't meant to be perfect for all situations.** As written, they are well-suited to running Apostrophe and MongoDB under docker in a single-server environment. For a development environment, you would probably want the entire folder to be in a mounted volume so that your code changes are visible as you go along, and you would probably want to work `nodemon`, `webpack` or `apostrophe-monitor` into the mix for automatic reloading.
1. Install Docker on your computer, of course. On MacOS you must install the official Docker Desktop, not homebrew, as the latter relies on virtualbox and virtualbox file sharing is not compatible with persisting a MongoDB database in a container. If this is your first time, **Be sure to actually launch Docker Desktop** before running the commands that follow.
2. Type:
```bash
docker-compose up
```
3. When you see:
```
Listening at http://localhost:3000
```
You can connect normally in your browser by going to that address.
4. You will note there is no `admin` account in the database yet. Let's fix that. We'll execute an Apostrophe command line task inside the container:
```
docker-compose exec apostrophe node app apostrophe-users:add admin admin
```
You can shut Apostrophe down at any time with:
```bash
docker-compose stop
```
When you start it up again, your uploaded files and your database will still be there.

23
app.js
View File

@@ -1,6 +1,6 @@
var path = require('path');
let path = require('path');
var apos = require('apostrophe')({
let apos = require('apostrophe')({
// Export for apostrophe-monitor which manages restarting the apostrophe system (not the whole nodeJS process) when changes are made.
// See https://github.com/apostrophecms/apostrophe-monitor
root: module,
@@ -39,14 +39,17 @@ var apos = require('apostrophe')({
'apostrophe-db': {
uri: process.env.MONGO_URL
},
sanitizeHtml: {
allowedAttributes: {
'p': ['apos-indent1', 'apos-indent2']
},
allowedClasses: {
'p': ['apos-indent1', 'apos-indent2']
}
}
// 'apostrophe-rich-text-widgets': {
// sanitizeHtml: {
// allowedAttributes: {
// 'p': ['apos-indent1', 'apos-indent2']
// },
// allowedClasses: {
// 'p': ['apos-indent1', 'apos-indent2'],
// 'p': ['testClass']
// }
// }
// }
// Was having some issues with overlaying menus.
//'apostrophe-tiptap-rich-text-widgets': {}
}

Binary file not shown.

View File

@@ -34,7 +34,7 @@ h5 {
}
.highlighted {
background: #c7c6c6;
background: rgba(170, 122, 82, 0.3);
margin: 1rem 6rem;
padding: 1rem 1rem;
font-size: 1.8rem;
@@ -42,6 +42,13 @@ h5 {
-webkit-box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.61);
-moz-box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.61);
box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.61);
color: Green;
}
ul.bulletLevel2 {
text-indent: 1rem;
list-style-type: circle;
list-style-position: inside;
}
@media only screen and (max-width: 1100px) {

View File

@@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["main.sass"],"names":[],"mappings":"AACA;EACC;EACA;EACA;;;AAED;EACC;EACA;EACA;EACA;;;AAED;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;;;AAED;EACC;;;AAED;EACC;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAMD;EACC;IACC;;;AAEF;EACC;IACC;;;AAEF;EACC;IACC;;;AAEF;EACC;IACC","file":"main.css"}
{"version":3,"sourceRoot":"","sources":["main.sass"],"names":[],"mappings":"AACA;EACC;EACA;EACA;;;AAED;EACC;EACA;EACA;EACA;;;AAED;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;;;AAED;EACC;;;AAED;EACC;;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAED;EACC;EACA;EACA;;;AAMD;EACC;IACC;;;AAEF;EACC;IACC;;;AAEF;EACC;IACC;;;AAEF;EACC;IACC","file":"main.css"}

View File

@@ -29,7 +29,7 @@ h5
//.apos-rich-text > div //This was a work around to the rich text widget 'class' property not working in the style.
.highlighted
background: #c7c6c6
background: rgba(170, 122, 82, 0.3)
margin: 1rem 6rem
padding: 1rem 1rem
font-size: 1.8rem
@@ -37,6 +37,12 @@ h5
-webkit-box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.61)
-moz-box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.61)
box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.61)
color: Green
ul.bulletLevel2
text-indent: 1rem
list-style-type: circle
list-style-position: inside
//
// Everything scales off of the HTML tag font sizes since the whole site uses REM units.

View File

@@ -14,6 +14,10 @@ module.exports = {
{
name: 'aves',
label: 'Elementary School Page'
},
{
name: 'basic',
label: 'basic'
}
// Add more page types here, but make sure you create a corresponding

View File

@@ -0,0 +1,24 @@
{% extends "layout.html" %}
{% block main %}
<div class="container" style="margin-top: 3rem">
{{ apos.area(data.page, "body", {
widgets: {
'apostrophe-images': {size: 'original'},
'apostrophe-rich-text': {
toolbar: ['Styles', 'Bold', 'Italic', 'Link', 'Unlink', 'Indent', 'Outdent', 'Anchor', 'Table', 'BulletedList', 'Blockquote', 'Strike', 'Subscript', 'Superscript', 'Split'],
styles: [
{name: 'Paragraph', element: 'p'},
{name: 'highlighted', element: 'p', attributes: [{'class': 'highlighted'}]},
{name: 'Heading 2', element: 'h2'},
{name: 'Heading 3', element: 'h3'},
{name: 'Heading 4', element: 'h4'},
{name: 'Heading 5', element: 'h5'}
]
},
'apostrophe-files': {},
'two-column': {}
}
}) }}
</div>
{% endblock %}

View File

@@ -8,12 +8,13 @@
'apostrophe-rich-text': {
toolbar: ['Styles', 'Bold', 'Italic', 'Link', 'Unlink', 'Indent', 'Outdent', 'Anchor', 'Table', 'BulletedList', 'Blockquote', 'Strike', 'Subscript', 'Superscript', 'Split'],
styles: [
{name: 'Paragraph', element: 'p'},
{name: 'highlighted', element: 'p', attributes: [{'class': 'highlighted'}]},
{name: 'Heading 2', element: 'h2'},
{name: 'Heading 3', element: 'h3'},
{name: 'Heading 4', element: 'h4'},
{name: 'Heading 5', element: 'h5'}
{name: 'Paragraph', element: 'p', attributes: {class: "p"} },
{name: 'Heading 2', element: 'h2', attributes: {class: "h2"} },
{name: 'Heading 3', element: 'h3', attributes: {class: "h3"} },
{name: 'Heading 4', element: 'h4', attributes: {class: "h4"} },
{name: 'Heading 5', element: 'h5', attributes: {class: "h5"} },
{name: 'highlighted', element: 'div', attributes: {class: "highlighted"} },
{name: 'bullet2', element: 'div', attributes: {class: "bulletLevel2"} }
]
},
'apostrophe-files': {},

View File

@@ -11,14 +11,17 @@ module.exports = {
'sup', 'sub', 'span'
],
allowedClasses: {
'p': ['highlighted'],
'div': ['highlighted']
'p': ['highlighted','apos-indent1', 'apos-indent2', 'bulletLevel2'],
'ul': ['bulletLevel2'],
'div': ['highlighted', "bulletLevel2"],
'*': ['highlighted', 'bulletLevel2', 'test', '*']
},
allowedAttributes: {
'*': ['style', 'class'],
p: ['class'],
ul: ['class', 'style'],
p: ['class', 'style'],
div: ['class', 'style'],
a: [ 'href', 'name', 'target' ],
a: [ 'href', 'name', 'target', 'class', 'style'],
// We don't currently allow img itself by default, but this
// would make sense if we did
img: [ 'src' ]

View File

@@ -128,27 +128,29 @@ This block outputs its contents in the HTML document's <head>.
<div class="col-lg-4">
<h2>School</h2>
<a href="/aves">Home</a>
<a href="/aves/staff">Staff</a>
<a href="/aves/directions">Directions</a>
<a href="/aves/contact-information">Contact Information</a>
<a href="/aves/mission">Mission</a>
<a href="/aves/sarc">SARC</a>
<h2>News &amp; Info</h2>
<a href="/aves/lice">Lice</a>
<a href="/aves/safe-school-plan">Safe School Plan</a>
<a href="/aves/single-school-plan">Single School Plan (SSC)</a>
<a href="/aves/common-core">Common Core Standards</a>
<h2>Kindergarten</h2>
<a href="/aves/kindergarten/regulations">Regulations</a>
<a href="/aves/kindergarten/enrollment">Enrollment</a>
</div>
<div class="col-lg-4">
<h2>Staff</h2>
<a href="/aves/staff/support-staff">Support Staff</a>
<a href="/aves/staff/teachers">Teachers</a>
<a href="/aves/staff/office-staff">Office Staff</a>
<h2>Family Resources</h2>
<a href="/aves/grades">Grades</a>
<a href="/aves/parenting-en">Parenting Classes (English)</a>
<a href="/aves/parenting-es">Parenting Classes (Spanish)</a>
<a href="/aves/pip">PIP</a>
<a href="/aves/asp">ASP</a>
<a href="/aves/schedule">Bell Schedules</a>
<a href="/aves/immunizations">Immunizations</a>
<a href="/aves/attendance">Attendance</a>
<a href="/aves/second-chance-breakfast">Second Chance Breakfast</a>
<a href="/aves/menus">Menus</a>
</div>
<div class="col-lg-4">
@@ -156,7 +158,7 @@ This block outputs its contents in the HTML document's <head>.
<a href="/aves/ptav">About</a>
<a href="/aves/ptav/logo">Logo Wear</a>
<a href="/aves/ptav/meetings">Meetings</a>
<h2>Single School Plan (SSC)</h2>
<h2>School Site Council (SSC)</h2>
<a href="/aves/ssc">About</a>
<a href="/aves/ssc/agenda">Agenda</a>
<a href="/aves/ssc/minutes">Minutes</a>