Skip to content

Commit

Permalink
Preparing 0.10 release (#55)
Browse files Browse the repository at this point in the history
* Fixing issue with modal blocks, updating docs based on testing results, regenerating migrations
* Updating docs
  • Loading branch information
vsalvino authored Dec 17, 2018
1 parent 6c5eba5 commit 0e86f8c
Show file tree
Hide file tree
Showing 23 changed files with 328 additions and 296 deletions.
1 change: 1 addition & 0 deletions coderedcms/blocks/content_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
)

Expand Down
40 changes: 0 additions & 40 deletions coderedcms/migrations/0005_alter_content_field.py

This file was deleted.

40 changes: 0 additions & 40 deletions coderedcms/migrations/0005_auto_20181211_1536.py

This file was deleted.

61 changes: 61 additions & 0 deletions coderedcms/migrations/0005_auto_20181214_2214.py

Large diffs are not rendered by default.

40 changes: 0 additions & 40 deletions coderedcms/migrations/0006_auto_20181213_1753.py

This file was deleted.

41 changes: 0 additions & 41 deletions coderedcms/migrations/0006_auto_20181214_1016.py

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions coderedcms/templates/coderedcms/blocks/modal_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
74 changes: 73 additions & 1 deletion docs/_static/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
}
7 changes: 4 additions & 3 deletions docs/_static/versions.js
Original file line number Diff line number Diff line change
@@ -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);
}
Expand All @@ -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);
Expand Down
14 changes: 13 additions & 1 deletion docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ <h3>{{ _('Navigation') }}</h3>
</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 }}">
Expand All @@ -50,14 +57,19 @@ <h3>{{ _('Navigation') }}</h3>

{%- 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() }}

Expand Down
75 changes: 53 additions & 22 deletions docs/contributing/index.rst
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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::
Expand All @@ -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.
4 changes: 2 additions & 2 deletions docs/features/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions docs/features/store_locator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion docs/getting_started/customize_develop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
Loading

0 comments on commit 0e86f8c

Please sign in to comment.