Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pricing update #587

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions migrations/versions/35d477d67b7_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""empty message

Revision ID: 35d477d67b7
Revises: 33e499db410
Create Date: 2024-12-06 10:16:54.464973

"""

# revision identifiers, used by Alembic.
revision = '35d477d67b7'
down_revision = '33e499db410'

from alembic import op
import sqlalchemy as sa


def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('bill_file',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('bill_id', sa.Integer(), nullable=False),
sa.Column('file_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['bill_id'], ['bill.id'], name=op.f('fk_bill_file_bill_id_bill')),
sa.ForeignKeyConstraint(['file_id'], ['file.id'], name=op.f('fk_bill_file_file_id_file')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_bill_file'))
)
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_table('bill_file')
### end Alembic commands ###
15 changes: 14 additions & 1 deletion pmg/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,18 @@ def get_list(self, term, offset=0, limit=DEFAULT_PAGE_SIZE):

return query.offset(offset).limit(limit).all()

class InlineBillFileForm(InlineFormAdmin):
form_columns = (
"id",
"file",
)
form_ajax_refs = {
"file": {
"fields": ("title", "file_path"),
"page_size": 10,
},
}


class BillsView(MyModelView):
column_list = (
Expand Down Expand Up @@ -1289,13 +1301,14 @@ class BillsView(MyModelView):
"date_of_assent",
"effective_date",
"act_name",
"versions",
"versions"
)
column_default_sort = ("year", True)
column_searchable_list = ("title",)
inline_models = [
InlineBillEventsForm(Event),
InlineBillVersionForm(BillVersion),
InlineBillFileForm(BillFile),
]
form_args = {
"events": {"widget": widgets.InlineBillEventsWidget()},
Expand Down
10 changes: 10 additions & 0 deletions pmg/api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Bill,
BillType,
BillVersion,
BillFile,
BillStatus,
Event,
QuestionReply,
Expand Down Expand Up @@ -396,6 +397,7 @@ class Meta:
"effective_date",
"act_name",
"versions",
"bill_files",
"events",
"created_at",
"updated_at",
Expand All @@ -405,6 +407,7 @@ class Meta:
status = fields.Nested("BillStatusSchema")
place_of_introduction = fields.Nested("HouseSchema")
versions = fields.Nested("BillVersionSchema", many=True)
bill_files = fields.Nested("BillFileSchema", many=True)
events = PolyField(serialization_schema_selector=choose_event_schema, many=True)

_links = ma.Hyperlinks({"self": AbsoluteUrlFor("api2.bills", id="<id>"),})
Expand All @@ -428,3 +431,10 @@ class Meta:
fields = ("id", "title", "file", "date", "enacted")

file = fields.Nested("FileSchema")

class BillFileSchema(ma.ModelSchema):
class Meta:
model = BillFile
fields = ("id", "file_id", "file")

file = fields.Nested("FileSchema")
10 changes: 10 additions & 0 deletions pmg/models/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class Bill(ApiResource, db.Model):
versions = db.relationship(
"BillVersion", backref="bill", cascade="all, delete, delete-orphan"
)
bill_files = db.relationship("BillFile", back_populates="bill", cascade="all, delete-orphan")

@property
def code(self):
Expand Down Expand Up @@ -224,6 +225,15 @@ class BillVersion(db.Model):
db.Boolean, default=False, server_default=sql.expression.false(), nullable=False
)

class BillFile(db.Model):
__tablename__ = 'bill_file'
id = db.Column(db.Integer, primary_key=True)
bill_id = db.Column(db.Integer, db.ForeignKey('bill.id'), nullable=False)
file_id = db.Column(db.Integer, db.ForeignKey('file.id'), nullable=False)

bill = db.relationship("Bill", back_populates="bill_files")
file = db.relationship("File")


class File(db.Model):

Expand Down
16 changes: 16 additions & 0 deletions pmg/templates/bills/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ <h1>
</ul>
{% endif %}


{% if bill.status %}
{% if bill.status.name in ["enacted", "president", "ncop", "na", "returned-to-na", "introduced"] -%}
<div class="bill-status-container">
Expand Down Expand Up @@ -169,6 +170,21 @@ <h4>{{ version.title }}</h4>
</div>
{% endif %}

{% if bill.bill_files %}
<ul class="list-inline bill-versions">
<li><h3>Bill files:</h3></li>
{% for file in bill.bill_files %}
<li>
<a href="{{ file.file.url }}" target="_blank">
<span class="label label-info" title="{{ file.file.title }}">
<i class="fa fa-file-text"></i> {{ file.file.title }}
</span>
</a>
</li>
{% endfor %}
</ul>
{% endif %}

{% endblock %}

{% block javascript %}
Expand Down
43 changes: 22 additions & 21 deletions pmg/templates/user_management/committee_subscriptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,46 +44,47 @@ <h1>Committee subscriptions</h1>
{% endif %}

<hr>

{% include "_premium_committees.html" %}

<hr>

<h2>Subscription Options</h2>

<p>
<strong>Annual Subscription: R6 800 + R1020 (VAT) = R7 820</strong><br>
Choose 4 of the above committees and receive comprehensive minutes and documents for 12 months.
Should your organization require access to more than 4 of the above committees, this is possible
according to the list below.
<strong>Annual Subscription: R7 300 + R1095 (VAT) = R8 395</strong>
Choose 4 of the above committees and receive comprehensive minutes and documents for 12 months. Should your organization require access to more than 4 of the above committees, this is possible according to the list below.
</p>

<p>
<strong>Short access: R2 200 + R330 (VAT) = R2 530</strong><br>
<strong>Short access: R2 300 + R345 (VAT) = R2 645</strong>
Subscribe to one committee for 3 months.
</p>

<p>
<strong>Single meeting report plus documents: R530 + R79.50 (VAT) = R609.50</strong><br>
<strong>Single meeting report plus documents: R580 + R87 (VAT) = R667</strong>
Send an email to <a href="mailto:subscribe@pmg.org.za">subscribe@pmg.org.za</a> and receive the meeting report immediately upon proof of payment.
</p>

<p>
<strong>2024 Price List</strong><br>

<ul>
<li>Basic subscription (access to 4 committees) R6 800 + R1020 (VAT) = R7 820</li>
<li>Basic subscription plus 1 extra committee R7 400 + R1110 (VAT) = R8 510</li>
<li>Basic subscription plus 2 extra committees R8 000 + R1 200 (VAT) = R9 200</li>
<li>Basic subscription plus 3 extra committees R8 600 + R1 290 (VAT) = R9 890</li>
<li>Basic subscription plus 4 extra committees R9 200 + R1 380 (VAT) = R10 580</li>
<li>Basic subscription plus 5 extra committees R9 800 + R1 470 (VAT) = R11 270</li>
<li>Basic subscription plus 6 extra committees R10 400 + R1 560 (VAT) = R11 960</li>
<li>Basic subscription plus 7 extra committees R11 000 + R1 650 (VAT) = R12 650</li>
<li>Basic subscription plus 8 extra committees R11 600 + R1 740(VAT) = R13 340</li>
<li>Basic subscription plus 9 extra committees R12 300 + R1 845 (VAT) = R14 145</li>
</ul>
<strong>2025 Price List</strong>
</p>

<ul>
<li>Basic subscription (access to 4 committees) R7 300 + R1 095 (VAT) = R8 395</li>
<li>Basic subscription plus 1 extra committee R7 900 + R1 185 (VAT) = R9 085</li>
<li>Basic subscription plus 2 extra committees R8 500 + R1 275 (VAT) = R9 775</li>
<li>Basic subscription plus 3 extra committees R9 100 + R1 365 (VAT) = R10 465</li>
<li>Basic subscription plus 4 extra committees R9 700 + R1 455 (VAT) = R11 155</li>
<li>Basic subscription plus 5 extra committees R10 300 + R1 545 (VAT) = R11 845</li>
<li>Basic subscription plus 6 extra committees R10 900 + R1 635 (VAT) = R12 535</li>
<li>Basic subscription plus 7 extra committees R11 500 + R1 725 (VAT) = R13 225</li>
<li>Basic subscription plus 8 extra committees R12 100 + R1 815 (VAT) = R13 915</li>
<li>Basic subscription plus 9 extra committees R13 200 + R1 980 (VAT) = R15 180</li>
</ul>


</p>


<h2>How To Subscribe</h2>
<p>
Expand Down
Loading