Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #491 from eregs/split-nc
Browse files Browse the repository at this point in the history
Split comment-related functionality into separate Python module
  • Loading branch information
cmc333333 authored Jul 26, 2017
2 parents 7954d0b + 504c7b3 commit d9223d0
Show file tree
Hide file tree
Showing 41 changed files with 304 additions and 138 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ RUN npm install --quiet -g grunt-cli
COPY ["manage.py", "package.json", "example-config.json", "setup.py", "frontendbuild.sh", "Gruntfile.js", ".babelrc", ".eslintignore", ".eslintrc", "/app/src/"]
COPY ["regulations", "/app/src/regulations"]
COPY ["fr_notices", "/app/src/fr_notices"]
COPY ["notice_comment", "/app/src/notice_comment"]
WORKDIR /app/src/
RUN ./frontendbuild.sh
RUN $PIP_CMD install --no-cache-dir -e . \
RUN $PIP_CMD install --no-cache-dir -e .[notice_comment] \
&& $PYTHON_CMD manage.py migrate

ENV PYTHONUNBUFFERED="1"
Expand Down
22 changes: 22 additions & 0 deletions docs/notice_comment.management.commands.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
notice\_comment\.management\.commands package
=============================================

Submodules
----------

notice\_comment\.management\.commands\.setup\_cors module
---------------------------------------------------------

.. automodule:: notice_comment.management.commands.setup_cors
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: notice_comment.management.commands
:members:
:undoc-members:
:show-inheritance:
17 changes: 17 additions & 0 deletions docs/notice_comment.management.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
notice\_comment\.management package
===================================

Subpackages
-----------

.. toctree::

notice_comment.management.commands

Module contents
---------------

.. automodule:: notice_comment.management
:members:
:undoc-members:
:show-inheritance:
22 changes: 22 additions & 0 deletions docs/notice_comment.migrations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
notice\_comment\.migrations package
===================================

Submodules
----------

notice\_comment\.migrations\.0001\_initial module
-------------------------------------------------

.. automodule:: notice_comment.migrations.0001_initial
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: notice_comment.migrations
:members:
:undoc-members:
:show-inheritance:
63 changes: 63 additions & 0 deletions docs/notice_comment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
notice\_comment package
=======================

Subpackages
-----------

.. toctree::

notice_comment.management
notice_comment.migrations
notice_comment.tests

Submodules
----------

notice\_comment\.docket module
------------------------------

.. automodule:: notice_comment.docket
:members:
:undoc-members:
:show-inheritance:

notice\_comment\.models module
------------------------------

.. automodule:: notice_comment.models
:members:
:undoc-members:
:show-inheritance:

notice\_comment\.tasks module
-----------------------------

.. automodule:: notice_comment.tasks
:members:
:undoc-members:
:show-inheritance:

notice\_comment\.urls module
----------------------------

.. automodule:: notice_comment.urls
:members:
:undoc-members:
:show-inheritance:

notice\_comment\.views module
-----------------------------

.. automodule:: notice_comment.views
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: notice_comment
:members:
:undoc-members:
:show-inheritance:
38 changes: 38 additions & 0 deletions docs/notice_comment.tests.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
notice\_comment\.tests package
==============================

Submodules
----------

notice\_comment\.tests\.docket\_tests module
--------------------------------------------

.. automodule:: notice_comment.tests.docket_tests
:members:
:undoc-members:
:show-inheritance:

notice\_comment\.tests\.tasks\_tests module
-------------------------------------------

.. automodule:: notice_comment.tests.tasks_tests
:members:
:undoc-members:
:show-inheritance:

notice\_comment\.tests\.views\_tests module
-------------------------------------------

.. automodule:: notice_comment.tests.views_tests
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: notice_comment.tests
:members:
:undoc-members:
:show-inheritance:
8 changes: 0 additions & 8 deletions docs/regulations.management.commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ regulations\.management\.commands\.fetch\_wkhtmltox module
:undoc-members:
:show-inheritance:

regulations\.management\.commands\.setup\_cors module
-----------------------------------------------------

.. automodule:: regulations.management.commands.setup_cors
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------
Expand Down
8 changes: 8 additions & 0 deletions docs/regulations.migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ regulations\.migrations\.0002\_remove\_failedcommentsubmission\_files module
:undoc-members:
:show-inheritance:

regulations\.migrations\.0003\_delete\_failedcommentsubmission module
---------------------------------------------------------------------

.. automodule:: regulations.migrations.0003_delete_failedcommentsubmission
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------
Expand Down
24 changes: 0 additions & 24 deletions docs/regulations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,6 @@ regulations\.context module
:undoc-members:
:show-inheritance:

regulations\.docket module
--------------------------

.. automodule:: regulations.docket
:members:
:undoc-members:
:show-inheritance:

regulations\.models module
--------------------------

.. automodule:: regulations.models
:members:
:undoc-members:
:show-inheritance:

regulations\.tasks module
-------------------------

.. automodule:: regulations.tasks
:members:
:undoc-members:
:show-inheritance:

regulations\.url\_caches module
-------------------------------

Expand Down
24 changes: 0 additions & 24 deletions docs/regulations.tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,6 @@ regulations\.tests\.partial\_view\_tests module
:undoc-members:
:show-inheritance:

regulations\.tests\.sanitize\_fields\_tests module
--------------------------------------------------

.. automodule:: regulations.tests.sanitize_fields_tests
:members:
:undoc-members:
:show-inheritance:

regulations\.tests\.sidebar\_analyses\_tests module
---------------------------------------------------

Expand All @@ -228,14 +220,6 @@ regulations\.tests\.sidebar\_help\_tests module
:undoc-members:
:show-inheritance:

regulations\.tests\.tasks\_tests module
---------------------------------------

.. automodule:: regulations.tests.tasks_tests
:members:
:undoc-members:
:show-inheritance:

regulations\.tests\.templatetags\_macros\_tests module
------------------------------------------------------

Expand Down Expand Up @@ -292,14 +276,6 @@ regulations\.tests\.views\_chrome\_tests module
:undoc-members:
:show-inheritance:

regulations\.tests\.views\_comment\_tests module
------------------------------------------------

.. automodule:: regulations.tests.views_comment_tests
:members:
:undoc-members:
:show-inheritance:

regulations\.tests\.views\_diff\_tests module
---------------------------------------------

Expand Down
8 changes: 0 additions & 8 deletions docs/regulations.views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ regulations\.views\.chrome\_breakaway module
:undoc-members:
:show-inheritance:

regulations\.views\.comment module
----------------------------------

.. automodule:: regulations.views.comment
:members:
:undoc-members:
:show-inheritance:

regulations\.views\.diff module
-------------------------------

Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
24 changes: 24 additions & 0 deletions notice_comment/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 15:47
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='FailedCommentSubmission',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True,
serialize=False, verbose_name='ID')),
('body', models.TextField()),
],
),
]
Empty file.
File renamed without changes.
4 changes: 2 additions & 2 deletions regulations/tasks.py → notice_comment/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from django.template import loader
from django.utils.crypto import get_random_string

from regulations.models import FailedCommentSubmission
from notice_comment.models import FailedCommentSubmission
logger = get_task_logger(__name__)


Expand Down Expand Up @@ -102,7 +102,7 @@ def json_to_html(sections, mark_as_draft=False):
:param mark_as_draft: Indicates if the HTML is to be marked as DRAFT
"""
return loader.render_to_string(
'regulations/comment.html',
'notice_comment/comment.html',
{'sections': sections, 'mark_as_draft': mark_as_draft}
)

Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
data-metadata-url="{{metadata_url}}"
data-doc-id="{{doc_number}}">
{% if message %}
{% include 'regulations/comment-confirm-invalid.html' %}
{% include 'notice_comment/confirm-invalid.html' %}
{% elif not metadata_url %}
{% include 'regulations/comment-confirm-fail.html' %}
{% include 'notice_comment/confirm-fail.html' %}
{% else %}
{% include 'regulations/comment-confirm-success.html' %}
{% include 'notice_comment/confirm-success.html' %}
{% endif %}
</section>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "regulations/comment-confirm-fail.html" %}
{% extends "notice_comment/confirm-fail.html" %}

{% block alert-text %}
<div class="alert-text">
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ <h4 class="preview-button" disabled>Building your PDF...</h4>

<input type="hidden" name="comments" />

{% include 'regulations/comment-additional-info.html' %}
{% include 'notice_comment/additional-info.html' %}

<div class="statement">
{% include 'regulations/comment-disclaimer.html' %}
{% include 'notice_comment/disclaimer.html' %}
</div>

<button class="submit-button">Submit your comment</button>
Expand Down
Empty file.
Loading

0 comments on commit d9223d0

Please sign in to comment.