mirror of
https://github.com/logos-co/open-law.git
synced 2025-02-03 02:24:45 +00:00
remove section.about
This commit is contained in:
parent
7ab0eb1dec
commit
2730536a07
@ -8,7 +8,6 @@ from app.logger import log
|
||||
|
||||
class BaseSectionForm(FlaskForm):
|
||||
label = StringField("Label", [DataRequired(), Length(3, 256)])
|
||||
about = StringField("About")
|
||||
|
||||
|
||||
class CreateSectionForm(BaseSectionForm):
|
||||
|
@ -7,7 +7,6 @@ class Section(BaseModel):
|
||||
__tablename__ = "sections"
|
||||
|
||||
label = db.Column(db.String(256), unique=False, nullable=False)
|
||||
about = db.Column(db.Text, unique=False, nullable=True)
|
||||
|
||||
# Foreign keys
|
||||
collection_id = db.Column(db.ForeignKey("collections.id"))
|
||||
|
@ -11,7 +11,6 @@
|
||||
method="post" class="relative bg-white rounded-lg shadow dark:bg-gray-700">
|
||||
{{ form_hidden_tag() }}
|
||||
<input type="hidden" name="section_id" id="section_id" value="{{section.id}}" />
|
||||
<input type="hidden" name="about" id="new-section-about-input" />
|
||||
|
||||
<!-- Modal header -->
|
||||
<div class="flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600">
|
||||
@ -27,15 +26,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-6 pt-0 space-y-6">
|
||||
<div class="w-full max-w-6xl mx-auto rounded-xl bg-gray-50 dark:bg-gray-600 shadow-lg text-white-900">
|
||||
<div class="overflow-hidden rounded-md bg-gray-50 [&>*]:dark:bg-gray-600 text-black [&>*]:!border-none [&>*]:!stroke-black dark:text-white dark:[&>*]:!stroke-white">
|
||||
<div id="new-section-about" class="quill-editor dark:text-white h-80">
|
||||
{{ section.about|safe }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal footer -->
|
||||
<div class="flex items-center p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600">
|
||||
<button name="submit" type="submit" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Save</button>
|
||||
|
@ -34,22 +34,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="myTabContent" class="mt-40">
|
||||
<!-- prettier-ignore -->
|
||||
<div class="hidden p-4 rounded-lg bg-gray-50 dark:bg-gray-800" id="section-text" role="tabpanel" aria-labelledby="text-tab">
|
||||
<dl class="bg-white dark:bg-gray-900 max-w-full p-3 text-gray-900 divide-y divide-gray-200 dark:text-white dark:divide-gray-700 m-3 border-2 border-gray-200 border-solid rounded-lg dark:border-gray-700">
|
||||
<div class="flex flex-col w-full">
|
||||
<!-- prettier-ignore -->
|
||||
<dt class="flex w-full mb-1 text-gray-500 md:text-lg dark:text-gray-400 flex-col">
|
||||
<div class="ql-snow">
|
||||
<div class="ql-editor-readonly">
|
||||
{{ section.about|safe }}
|
||||
</div>
|
||||
</div>
|
||||
</dt>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
<div class="hidden p-4 rounded-lg bg-gray-50 dark:bg-gray-800" id="interpretation" role="tabpanel" aria-labelledby="interpretation-tab">
|
||||
{% if not current_user.is_authenticated %}
|
||||
|
@ -667,7 +667,6 @@ def section_create(
|
||||
if form.validate_on_submit():
|
||||
section: m.Section = m.Section(
|
||||
label=form.label.data,
|
||||
about=form.about.data,
|
||||
collection_id=sub_collection_id or collection_id,
|
||||
version_id=book.last_version.id,
|
||||
)
|
||||
@ -720,10 +719,6 @@ def section_edit(
|
||||
if label:
|
||||
section.label = label
|
||||
|
||||
about = form.about.data
|
||||
if about:
|
||||
section.about = about
|
||||
|
||||
log(log.INFO, "Edit section [%s]", section.id)
|
||||
section.save()
|
||||
|
||||
|
@ -78,7 +78,6 @@ def create_dummy_data():
|
||||
|
||||
section_1_1 = m.Section(
|
||||
label="Dummy Section 1.1 Label",
|
||||
about="Dummy Section 1.1 About",
|
||||
collection_id=collection_1.id,
|
||||
version_id=collection_1.version_id,
|
||||
user_id=user.id,
|
||||
@ -86,7 +85,6 @@ def create_dummy_data():
|
||||
|
||||
section_2_1_1 = m.Section(
|
||||
label="Dummy Section 2.1.1 Label",
|
||||
about="Dummy Section 2.1.1 About",
|
||||
collection_id=subcollection_2_1.id,
|
||||
version_id=unexported_version.id,
|
||||
user_id=user.id,
|
||||
@ -94,7 +92,6 @@ def create_dummy_data():
|
||||
|
||||
section_2_1_2 = m.Section(
|
||||
label="Dummy Section 2.1.2 Label",
|
||||
about="Dummy Section 2.1.2 About",
|
||||
collection_id=subcollection_2_1.id,
|
||||
version_id=unexported_version.id,
|
||||
user_id=user.id,
|
||||
|
@ -663,14 +663,12 @@ def test_crud_sections(client: FlaskClient, runner: FlaskCliRunner):
|
||||
|
||||
m.Section(
|
||||
label="Test",
|
||||
about="Test",
|
||||
collection_id=leaf_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
|
||||
m.Section(
|
||||
label="Test",
|
||||
about="Test",
|
||||
collection_id=sub_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
@ -703,7 +701,7 @@ def test_crud_sections(client: FlaskClient, runner: FlaskCliRunner):
|
||||
assert b"Success!" in response.data
|
||||
|
||||
edited_section: m.Section = m.Section.query.filter_by(
|
||||
label=new_label, about=new_about, id=section.id
|
||||
label=new_label, id=section.id
|
||||
).first()
|
||||
assert edited_section
|
||||
|
||||
@ -732,7 +730,7 @@ def test_crud_sections(client: FlaskClient, runner: FlaskCliRunner):
|
||||
assert b"Success!" in response.data
|
||||
|
||||
edited_section: m.Section = m.Section.query.filter_by(
|
||||
label=new_label, about=new_about, id=section_2.id
|
||||
label=new_label, id=section_2.id
|
||||
).first()
|
||||
assert edited_section
|
||||
|
||||
@ -797,7 +795,6 @@ def test_crud_interpretation(client: FlaskClient, runner: FlaskCliRunner):
|
||||
).save()
|
||||
section_in_collection: m.Section = m.Section(
|
||||
label="Test Section in Collection #1 Label",
|
||||
about="Test Section in Collection #1 About",
|
||||
collection_id=leaf_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
@ -813,7 +810,6 @@ def test_crud_interpretation(client: FlaskClient, runner: FlaskCliRunner):
|
||||
).save()
|
||||
section_in_subcollection: m.Section = m.Section(
|
||||
label="Test Section in Subcollection #1 Label",
|
||||
about="Test Section in Subcollection #1 About",
|
||||
collection_id=sub_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
@ -982,7 +978,6 @@ def test_crud_comment(client: FlaskClient, runner: FlaskCliRunner):
|
||||
).save()
|
||||
section_in_collection: m.Section = m.Section(
|
||||
label="Test Section in Collection #1 Label",
|
||||
about="Test Section in Collection #1 About",
|
||||
collection_id=leaf_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
@ -998,7 +993,6 @@ def test_crud_comment(client: FlaskClient, runner: FlaskCliRunner):
|
||||
).save()
|
||||
section_in_subcollection: m.Section = m.Section(
|
||||
label="Test Section in Subcollection #1 Label",
|
||||
about="Test Section in Subcollection #1 About",
|
||||
collection_id=sub_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
@ -1134,7 +1128,6 @@ def test_interpretation_in_home_last_inter_section(
|
||||
).save()
|
||||
section_in_collection: m.Section = m.Section(
|
||||
label="Test Section in Collection #1 Label",
|
||||
about="Test Section in Collection #1 About",
|
||||
collection_id=leaf_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
@ -1150,7 +1143,6 @@ def test_interpretation_in_home_last_inter_section(
|
||||
).save()
|
||||
section_in_subcollection: m.Section = m.Section(
|
||||
label="Test Section in Subcollection #1 Label",
|
||||
about="Test Section in Subcollection #1 About",
|
||||
collection_id=sub_collection.id,
|
||||
version_id=book.last_version.id,
|
||||
).save()
|
||||
|
Loading…
x
Reference in New Issue
Block a user