Ver código fonte

Preparing 0.10 release (#55)

* Fixing issue with modal blocks, updating docs based on testing results, regenerating migrations
* Updating docs
Vince Salvino 6 anos atrás
pai
commit
0e86f8cbf6

+ 1 - 0
coderedcms/blocks/content_blocks.py

@@ -95,6 +95,7 @@ class ModalBlock(ButtonMixin, BaseLayoutBlock):
             ('text', blocks.CharBlock(icon='fa-file-text-o', max_length=255, label=_('Simple Text'))),
             ('button', ButtonBlock()),
         ],
+        required=False,
         label=_('Modal footer'),
     )
 

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 22
coderedcms/migrations/0005_alter_content_field.py


+ 0 - 40
coderedcms/migrations/0005_auto_20181211_1536.py

@@ -1,40 +0,0 @@
-# Generated by Django 2.0.9 on 2018-12-11 20:36
-
-import coderedcms.blocks.base_blocks
-from django.db import migrations, models
-import django.db.models.deletion
-import modelcluster.contrib.taggit
-import modelcluster.fields
-import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
-import wagtail.documents.blocks
-import wagtail.images.blocks
-import wagtail.snippets.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('taggit', '0002_auto_20150616_2121'),
-        ('coderedcms', '0004_auto_20181119_1507'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='CoderedTag',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('content_object', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_items', to='coderedcms.CoderedPage')),
-                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='coderedcms_coderedtag_items', to='taggit.Tag')),
-            ],
-            options={
-                'verbose_name': 'CodeRed Tag',
-            },
-        ),
-        migrations.AddField(
-            model_name='coderedpage',
-            name='tags',
-            field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='Used to categorize your pages.', through='coderedcms.CoderedTag', to='taggit.Tag', verbose_name='Tags'),
-        ),
-    ]

Diferenças do arquivo suprimidas por serem muito extensas
+ 38 - 0
coderedcms/migrations/0005_auto_20181214_2214.py


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 22
coderedcms/migrations/0006_auto_20181213_1753.py


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 23
coderedcms/migrations/0006_auto_20181214_1016.py


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 22
coderedcms/project_template/website/migrations/0005_auto_20181213_1753.py


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 23
coderedcms/project_template/website/migrations/0005_auto_20181214_1016.py


Diferenças do arquivo suprimidas por serem muito extensas
+ 23 - 0
coderedcms/project_template/website/migrations/0005_auto_20181214_2214.py


+ 4 - 2
coderedcms/templates/coderedcms/blocks/modal_block.html

@@ -12,21 +12,23 @@
 
     <div class="modal-content">
       <div class="modal-header">
+        {% if self.header %}
         <h5 class="modal-title">{% include_block self.header %}</h5>
+        {% endif %}
         <button type="button" class="close modal-close" data-dismiss="modal">
           <span aria-hidden="true">&times;</span>
         </button>
       </div>
 
       <div class="modal-body">
-        <div>
           {% include_block self.content %}
-        </div>
       </div>
 
+      {% if self.footer %}
       <div class="modal-footer">
           {% include_block self.footer %}
       </div>
+      {% endif %}
     </div>
 
   </div>

+ 73 - 1
docs/_static/docs.css

@@ -5,7 +5,7 @@ body {
 
 code, pre {
     background-color:#f0f0f3;
-    font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
+    font-family: SFMono-Regular,Menlo,Monaco,Consolas,monospace;
     font-size: 0.85em;
     line-height: unset;
 }
@@ -36,6 +36,7 @@ div.body h1 {
 }
 div.body h2 {
     font-size: 1.5em;
+    margin-top: 1.5em;
 }
 div.body h3 {
     font-size: 1.2em;
@@ -101,6 +102,12 @@ div.logowrapper {
 
 p.logo {
     padding: 10px 20px;
+    font-size: 1.5em;
+}
+
+div.sphinxsidebar div.logowrapper p,
+div.sphinxsidebar div.logowrapper a {
+    color: #fff;
 }
 
 p.version {
@@ -234,4 +241,69 @@ div.footer {
 
 .clearfix {
     clear: both;
+}
+
+div.admonition {
+    background-color: #fafcff;
+    border-color: #d0e0f0;
+    border-radius: 4px;
+    border-width: 1.5px;
+    color: #248;
+    padding: 1em;
+}
+div.admonition.warning {
+    background-color:#fffcfa;
+    border-color:#f0e0d0;
+    color:#842;
+}
+div.admonition.warning code {
+    background-color: #f5e5d5;
+}
+
+.mobile-header {
+    display:none;
+    background-color: #d33;
+    color: #fff;
+    text-align: center;
+    font-weight: bold;
+    padding: 15px;
+}
+.mobile-header a {
+    color: inherit;
+}
+
+/** Responsive utilities **/
+@media(max-width: 800px) {
+    html * {
+        box-sizing: border-box;
+    }
+    div.sphinxsidebar {
+        width: 100%;
+        margin: 0;
+    }
+    div.bodywrapper {
+        margin: 0;
+    }
+    div.body {
+        padding: 10px;
+        min-height: unset;
+        min-width: 100%;
+        max-width: 100%;
+        width: 100%;
+    }
+    div.body h1 {
+        font-size: 1.7em;
+    }
+    div.body h2 {
+        font-size: 1.3em;
+    }
+    div.body h3 {
+        font-size: 1.1em;
+    }
+    div.logowrapper {
+        padding: 40px 20px;
+    }
+    .mobile-header {
+        display: block;
+    }
 }

+ 4 - 3
docs/_static/versions.js

@@ -1,10 +1,11 @@
-vfile = '/cms/versions.txt';
+vroot = '/cms/';
+vfile = 'versions.txt';
 
 function setversions(data) {
     data.split('\n').forEach((item, index) => {
         if(item.trim() != '') {
             newa = document.createElement('a', );
-            newa.setAttribute('href', '/cms/' + item + '/');
+            newa.setAttribute('href', vroot + item + '/');
             newa.innerHTML = item;
             document.getElementById("other-versions").appendChild(newa);
         }
@@ -17,7 +18,7 @@ $(document).ready(function() {
     }
     else {
         $.ajax({
-            url: '/cms/versions.txt',
+            url: vroot + vfile,
             success: function(data) {
                 sessionStorage.setItem(vfile, data);
                 setversions(data);

+ 13 - 1
docs/_templates/layout.html

@@ -32,6 +32,13 @@
 </div>
 {%- endmacro %}
 
+
+
+
+{%- block extrahead %}
+<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
+{%- endblock %}
+
 {%- block sidebarlogo %}
 <div class="logowrapper">
   <p class="logo"><a href="{{ pathto(master_doc) }}" title="{{ project }}">
@@ -50,14 +57,19 @@
 
 {%- block document %}
   <div class="documentwrapper">
+    <div class="mobile-header">
+        <a href="{{ pathto(master_doc) }}" title="{{ project }}">{{ project }}</a>
+    </div>
   {%- if render_sidebar %}
     <div class="bodywrapper">
   {%- endif %}
-      <div class="body" role="main">
+      <div class="body">
 
         {{ custom_relbar() }}
 
+        <div role="main">
         {% block body %} {% endblock %}
+        </div>
 
         {{ custom_prevnext() }}
 

+ 53 - 22
docs/contributing/index.rst

@@ -1,18 +1,21 @@
 Contributing
 ============
 
+
 Developing and testing coderedcms
 ---------------------------------
-To create a test project locally before committing your changes:
 
-#. Run ``pip install -e ./[dev]`` from the coderedcms directory. The -e flag makes the install editable,
+To create a test project locally:
+
+#. Clone the code from https://github.com/coderedcorp/coderedcms.
+#. Run ``pip install -e ./[dev]`` from the root coderedcms directory. The -e flag makes the install editable,
    which is relevant when running makemigrations in test project to actually generate the migration
    files in the coderedcms pip package. The ``[dev]`` installs extras such as sphinx for generating docs.
-#. Follow steps 4 through 6 in :doc:`/getting_started/index`. Use "testproject" or "testapp" for
+#. Follow the steps in :doc:`/getting_started/install`. Use "testproject" for
    your project name to ensure it is ignored by git.
 #. When making model or block changes within coderedcms, run ``makemigrations coderedcms`` in the
    test project to generate the relevant migration files for the pip package. ALWAYS follow steps
-   4 and 5 in :doc:`/getting_started/index` with a fresh database before making migrations.
+   4 and 5 in :doc:`/getting_started/install` with a fresh database before making migrations.
 #. When model or block changes affect the local test project (i.e. the "website" app), run
    ``makemigrations website`` in the test project to generate the relevant migration files locally.
    Apply and test the migrations. When satisfied, copy the new migration files to the
@@ -22,30 +25,36 @@ When making changes that are potentially destructive or backwards incompatible,
 version number until coderedcms reaches a stable 1.0 release. Each production project that uses
 coderedcms should specify the appropriate version in its requirements.txt to prevent breakage.
 
+.. note:
+    When testing existing projects with coderedcms installed from the master or development branches,
+    be sure to use a disposable database, as it is likely that the migrations in master will
+    not be the same migrations that get released.
+
+
 Contributor guidelines
 ----------------------
 
 We are happy to accept pull requests from the community if it aligns with our vision for coderedcms.
-When created a pull request, please make sure you include the following:
+When creating a pull request, please make sure you include the following:
 
 * A description in the pull request of what this change does and how it works.
-* Reference to an issue if the change is related to one of the issues on our github page.
-* Documentation updates describing your change.
+* Reference to an issue if the change is related to one of the issues on our GitHub page.
+* Documentation updates in the ``docs/`` directory describing your change.
 
 Following submission of your pull request, a CodeRed member will review and test your change.
-
 **All changes, even by CodeRed members, must go through a pull request process to ensure quality.**
 
+
 Building pip packages
 ---------------------
 
-To build a publicly consumable pip package and upload to pypi, run::
+To build a publicly consumable pip package, run::
 
     python setup.py sdist bdist_wheel
-    twine upload dist/*
 
-Building & publishing documentation
------------------------------------
+
+Building documentation
+----------------------
 
 For every code or feature change, be sure to update the docs in the repository. To build and publish
 the documentation run::
@@ -54,16 +63,38 @@ the documentation run::
     make clean
     make html
 
-Output will be in ``docs/_build/html/`` directory. To publish:
+Output will be in ``docs/_build/html/`` directory.
+
+
+Publishing a new release
+------------------------
+
+First checkout the code/branch for release.
+
+Next build a pip package::
+
+    python setup.py sdist bdist_wheel
+
+Then upload the pip package to pypi::
+
+    twine upload dist/*
+
+Finally build and update docs::
+
+    cd docs/
+    make clean
+    make html
+
+If updating docs for an existing minor version release:
+
+#. Copy the contents of ``docs/_build/html/`` to the CodeRed docs server under the existing version directory.
 
-* If updating docs for an existing minor version release:
-    #. Copy the contents of ``docs/_build/html/`` to the CodeRed docs server under the existing version directory.
+If this is a new major or minor version release:
 
-* If this is a new major or minor version release:
-    #. Create a new major.minor directory on the CodeRed docs server.
-    #. Update the ``.htaccess`` file to point to the new version directory.
-    #. Add the new version to the ``versions.txt`` file on the docs server.
-    #. Copy the contents of ``docs/_build/html`` to the CodeRed docs server under the new version directory.
+#. Create a new major.minor directory on the CodeRed docs server.
+#. Update the ``stable`` symlink to point to the new version directory.
+#. Add the new version to the ``versions.txt`` file on the docs server.
+#. Copy the contents of ``docs/_build/html/`` to the CodeRed docs server under the new version directory.
 
-Note that we do not release separate documentation for maintenance releases. Just update the existing minor
-version docs if there are any maintenance release doc changes.
+Note that we do not release separate documentation versions for maintenance releases. Update the existing minor
+version docs with release notes and other changes.

+ 2 - 2
docs/features/events.rst

@@ -71,7 +71,7 @@ To implement, add the following to your ``website/models.py``::
         event = ParentalKey(EventPage, related_name='occurrences')
 
 
-Next run ``python manage.py makemigrations`` and ``python manage.py migrate`` to create the new pages
-in your project.
+Next run ``python manage.py makemigrations website`` and ``python manage.py migrate`` to
+create the new pages in your project.
 
 Now when going to the wagtail admin, you can create an Event Landing Page, and child Event Pages.

+ 2 - 2
docs/features/store_locator.rst

@@ -39,8 +39,8 @@ the following to your ``website/models.py``::
 
         template = 'coderedcms/pages/location_index_page.html'
 
-Next run ``python manage.py makemigrations`` and ``python manage.py migrate`` to create the new pages
-in your project.
+Next run ``python manage.py makemigrations website`` and ``python manage.py migrate`` to create
+the new pages in your project.
 
 Now when going to the wagtail admin, you can create a Location Index Page, and child Location Pages.
 Also be sure to add a Google Maps API key under Settings > Google API Settings.

+ 2 - 1
docs/getting_started/customize_develop.rst

@@ -7,7 +7,8 @@ Page models
 The django app ``website`` has been created with default models based on pre-built abstract
 CodeRed CMS models. You can use these as-is, override existing fields and function, and add
 custom fields to these models. After making a change to any of these models, be sure to run
-``python manage.py makemigrations`` and ``python manage.py migrate`` to apply the database changes.
+``python manage.py makemigrations website`` and ``python manage.py migrate`` to apply the
+database changes.
 
 Hooks
 -----

+ 11 - 11
docs/getting_started/django_settings.rst

@@ -3,17 +3,6 @@ CodeRed CMS Django Settings
 
 Default settings are loaded from ``coderedcms/settings.py``. Available settings for CodeRed CMS:
 
-CODERED_CACHE_PAGES
--------------------
-
-Boolean on whether or not to load the page caching machinery and enable cache settings in the
-wagtail admin.
-
-CODERED_CACHE_BACKEND
----------------------
-
-The name of the Django cache backend to use for CodeRed CMS. Defaults to ``'default'`` which is
-required by Django when using the cache.
 
 CODERED_PROTECTED_MEDIA_ROOT
 ----------------------------
@@ -22,10 +11,12 @@ The directory where files from File Upload fields on Form Pages are saved. These
 served through Django using ``CODERED_PROTECTED_MEDIA_URL`` and require login to access.
 Defaults to ``protected/`` in your project directory.
 
+
 CODERED_PROTECTED_MEDIA_URL
 ---------------------------
 The URL for protected media files from form file uploads. Defaults to ``'/protected/'``
 
+
 CODERED_PROTECTED_MEDIA_UPLOAD_WHITELIST
 ----------------------------------------
 
@@ -33,12 +24,14 @@ The allowed filetypes for media upload in the form of a list of file type extens
 Default is blank. For example, to only allow documents and images, set to:
 ``['.pdf', '.doc', '.docx', '.txt', '.rtf', '.jpg', '.jpeg', '.png', '.gif']``
 
+
 CODERED_PROTECTED_MEDIA_UPLOAD_BLACKLIST
 ----------------------------------------
 
 The disallowed filetypes for media upload in the form of a list of file type extensions.
 Defaults to ``['.sh', '.exe', '.bat', '.ps1', '.app', '.jar', '.py', '.php', '.pl', '.rb']``
 
+
 CODERED_FRONTEND_*
 ------------------
 
@@ -46,3 +39,10 @@ Various frontend settings to specify defaults and choices used in the wagtail ad
 to rendering blocks, pages, and templates. By default, all CODERED_FRONTEND_* settings are
 designed to work with Bootstrap 4 CSS framework, but these can be customized if using a
 different CSS framework or theme variant.
+
+.. warning::
+    CODERED_FRONTEND_* settings are experimental and are known to cause issues
+    with migrations. If you do need to use them:
+
+    * DO NOT run ``makemigrations`` or ``makemigrations coderedcms``
+    * ONLY run migrations for specific apps, i.e. ``makemigrations website``

+ 7 - 2
docs/index.rst

@@ -12,9 +12,14 @@ it is extremely quick and easy to customize the website's design due to a respon
 editing interface and a pure Bootstrap 4 front-end. Features needed by marketing teams are also
 built-in including proper SEO tagging, Google Analytics tracking, and publishing tools.
 
+Join us
+-------
 
-Index
------
+Have questions or ideas? Join us in the **#coderedcms** channel on the
+`Wagtail Slack <https://wagtail.io/slack/>`_.
+
+Contents
+--------
 
 .. toctree::
    :maxdepth: 2

+ 13 - 0
docs/releases/index.rst

@@ -1,6 +1,19 @@
 Release Notes
 =============
 
+CodeRed CMS follows the ``[major].[minor].[maintenance]`` versioning scheme.
+
+* **Major** - significant changes that may not be backwards compatible.
+* **Minor** - new features, enhancements, and bug fixes that are most likely
+  but not guaranteed to be backwards compatible.
+* **Maintenance** - guaranteed to be backwards compatible. These changes are
+  reserved for bug, security, or documentation fixes only.
+
+.. note::
+    CodeRed CMS may have breaking changes between minor version upgrades until reaching a stable
+    1.0 status. Releases with a zero major version number are considered "beta" quality.
+
+
 .. toctree::
     :maxdepth: 1
 

+ 35 - 4
docs/releases/v0.10.0.rst

@@ -1,14 +1,45 @@
 CodeRed CMS 0.10.0 release notes
 ================================
 
-New features:
+New features
+------------
 
+* NEW event & calendar pages! See :doc:`/features/events`.
+* NEW "Embed Media" block replacing the "Embed Video" block. Embed Media supports YouTube,
+  Vimeo, Tweets, Facebook posts, GitHub gists, Spotify, Etsy, Tumblr, and dozens of other sources.
+* NEW tags on all ``CoderedPage`` pages. Tags provide a global and flexible way of organizing
+  and categorizing content. More tagging features coming soon.
+* NEW color picker available in the wagtail admin. Use ``coderedcms.fields.ColorField`` on your
+  models or ``coderedcms.widgets.ColorPickerWidget`` on Django form fields.
+* NEW official documentation! More user and how-to guides coming soon.
+  Available at https://docs.coderedcorp.com/cms/.
 * Updated to Wagtail 2.3.
 * Added support for Django 2.1. Supports Django 1.11 through 2.1.
-* Added new template blocks in ``base.html`` for easier extending.
-* NEW documentation! Available at https://docs.coderedcorp.com/cms/.
+* Added additional template blocks in ``coderedcms/pages/base.html`` for easier extending.
 
-Maintenance:
+
+Bug fixes
+---------
+
+* Modals no longer require a footer.
+
+
+Maintenance
+-----------
 
 * Replace Wagtail version with CodeRed CMS version in admin.
 * Replace built-in cache with `wagtail-cache <https://github.com/coderedcorp/wagtail-cache/>`_.
+
+
+Upgrade considerations
+----------------------
+
+* Some template blocks added to ``coderedcms/pages/web_page.html`` in 0.9 were removed and replaced
+  with more general blocks in ``coderedcms/pages/base.html``.
+* "Formatted Code" block (``coderedcms.blocks.CodeBlock``) was removed. If needed, use a 3rd party
+  block instead such as `wagtailcodeblock <https://github.com/FlipperPA/wagtailcodeblock>`_,
+  or use the new "Embed Media" block with GitHub gists.
+* ``CODERED_CACHE_PAGES`` setting replaced with ``WAGTAIL_CACHE``.
+* ``CODERED_CACHE_BACKEND`` setting replaced with ``WAGTAIL_CACHE_BACKEND``.
+* Existing projects must add ``wagtailcache`` to ``INSTALLED_APPS`` in project settings.
+* Existing projects must make and apply new migrations.

+ 4 - 2
docs/releases/v0.9.0.rst

@@ -1,14 +1,16 @@
 CodeRed CMS 0.9.0 release notes
 ===============================
 
-New Features:
+New Features
+------------
 
 * NEW Store Locator feature powered by Google Maps. See :doc:`/features/store_locator`.
 * NEW import export functionality. Import or export existing pages as JSON. Import new pages from CSV files. See :doc:`/features/import_export`.
 * Replaced Google Analytics with Google Tag Manager.
 * Added additional blocks to WebPage HTML template to ease template extending.
 
-Maintenance:
+Maintenance
+-----------
 
 * Updated Bootstrap to 4.1.3.
 * Added additional trove classifiers.

+ 2 - 1
docs/releases/v0.9.1.rst

@@ -1,6 +1,7 @@
 CodeRed CMS 0.9.1 release notes
 ===============================
 
-Bug Fixes:
+Bug Fixes
+---------
 
 * Moved Google Tag Manager tracking code to <head> per Google documentation.

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff