Skip to content

Commit

Permalink
adds hooks for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
smirolo committed Aug 17, 2024
1 parent 0d56634 commit ff64914
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 54 deletions.
4 changes: 2 additions & 2 deletions djaoapp/fixtures/cowork-db.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@
{
"fields": {
"app": 3,
"rank": 22,
"rank": 23,
"path": "/",
"rule_op": 0,
"is_forward": false
},
"model": "rules.Rule", "pk": 22
"model": "rules.Rule", "pk": 23
},
{
"fields": {
Expand Down
86 changes: 44 additions & 42 deletions djaoapp/fixtures/default-db.json
Original file line number Diff line number Diff line change
Expand Up @@ -851,12 +851,13 @@
"title":"Tennis Club of North Beach",
"created_at": "2024-01-01T00:00:00+00:00",
"setup_amount":0,
"period_amount":18900,
"period_amount":0,
"broker_fee_percent": 0,
"period_type": 5,
"description":"",
"organization" : 14,
"is_active" : 1
"is_active" : 1,
"optin_on_request": 1
},
"model" : "saas.Plan", "pk": 13
},
Expand Down Expand Up @@ -1939,7 +1940,8 @@
"registration": 3,
"session_backend": 2,
"entry_point": "http://localhost:8040",
"enc_key": ""
"enc_key": "",
"welcome_email": 0
},
"model": "rules.App", "pk": 1
},
Expand All @@ -1957,169 +1959,169 @@
"path": "/api/content/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 2
"model": "rules.Rule", "pk": 3
},
{ "fields": {
"app": 1,
"rank": 3,
"rank": 4,
"path": "/api/profile/{profile}/roles/{role}",
"rule_op": 6
},
"model": "rules.Rule", "pk": 3
"model": "rules.Rule", "pk": 4
},
{ "fields": {
"app": 1,
"rank": 4,
"rank": 5,
"path": "/api/profile/{profile}/roles",
"rule_op": 1
},
"model": "rules.Rule", "pk": 4
"model": "rules.Rule", "pk": 5
},
{ "fields": {
"app": 1,
"rank": 5,
"rank": 6,
"path": "/api/profile/{profile}",
"rule_op": 6
},
"model": "rules.Rule", "pk": 5
"model": "rules.Rule", "pk": 6
},

{ "fields": {
"app": 1,
"rank": 6,
"rank": 7,
"path": "/api/profile/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 6
"model": "rules.Rule", "pk": 7
},

{ "fields": {
"app": 1,
"rank": 7,
"rank": 8,
"path": "/api/units",
"rule_op": 1
},
"model": "rules.Rule", "pk": 7
"model": "rules.Rule", "pk": 8
},
{ "fields": {
"app": 1,
"rank": 8,
"rank": 9,
"path": "/api/timer",
"rule_op": 1
},
"model": "rules.Rule", "pk": 8
"model": "rules.Rule", "pk": 9
},
{ "fields": {
"app": 1,
"rank": 9,
"rank": 10,
"path": "/api/{profile}/campaigns",
"rule_op": 16,
"kwargs": "{\"profile\": null, \"plan\": \"premium\"}"
},
"model": "rules.Rule", "pk": 9
"model": "rules.Rule", "pk": 10
},
{ "fields": {
"app": 1,
"rank": 10,
"rank": 11,
"path": "/api/{profile}/reporting/",
"rule_op": 18
},
"model": "rules.Rule", "pk": 10
"model": "rules.Rule", "pk": 11
},
{ "fields": {
"app": 1,
"rank": 11,
"rank": 12,
"path": "/api/{profile}/",
"rule_op": 4,
"kwargs": "{\"profile\": null, \"roledescription\": \"contributor\"}"
},
"model": "rules.Rule", "pk": 11
"model": "rules.Rule", "pk": 12
},

{ "fields": {
"app": 1,
"rank": 12,
"rank": 13,
"path": "/app/assess/",
"rule_op": 1,
"engaged": "app,assess"
},
"model": "rules.Rule", "pk": 12
},
{ "fields": {
"app": 1,
"rank": 13,
"path": "/app/reporting/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 13
},
{ "fields": {
"app": 1,
"rank": 14,
"path": "/app/info/courses/",
"path": "/app/reporting/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 14
},
{ "fields": {
"app": 1,
"rank": 15,
"path": "/app/info/",
"path": "/app/info/courses/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 15
},
{ "fields": {
"app": 1,
"rank": 16,
"path": "/app/{profile}/improve/",
"path": "/app/info/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 16
},
{ "fields": {
"app": 1,
"rank": 17,
"path": "/app/{profile}/assess/",
"path": "/app/{profile}/improve/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 17
},
{ "fields": {
"app": 1,
"rank": 18,
"path": "/app/{profile}/reporting/",
"rule_op": 18
"path": "/app/{profile}/assess/",
"rule_op": 1
},
"model": "rules.Rule", "pk": 18
},
{ "fields": {
"app": 1,
"rank": 19,
"path": "/app/{profile}/reporting/",
"rule_op": 19
},
"model": "rules.Rule", "pk": 19
},
{ "fields": {
"app": 1,
"rank": 20,
"path": "/app/{profile}/",
"rule_op": 3,
"is_forward": false
},
"model": "rules.Rule", "pk": 19
"model": "rules.Rule", "pk": 20
},
{ "fields": {
"app": 1,
"rank": 20,
"rank": 21,
"path": "/app/",
"rule_op": 1,
"engaged": "app",
"is_forward": false
},
"model": "rules.Rule", "pk": 20
"model": "rules.Rule", "pk": 21
},
{ "fields": {
"app": 1,
"rank": 21,
"rank": 22,
"path": "/getstarted/",
"rule_op": 0,
"is_forward": true
},
"model": "rules.Rule", "pk": 21
"model": "rules.Rule", "pk": 22
},
{ "fields": {
"app": 1,
Expand Down
8 changes: 4 additions & 4 deletions djaoapp/fixtures/livedemo-db.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@
"app": 1,
"rank": 16,
"path": "/app/{profile}/improve/",
"rule_op": 1,
"rule_op": 4,
"kwargs": "{\"roledescription\": [\"contributor\"]}"
},
"model": "rules.Rule", "pk": 16
Expand All @@ -750,7 +750,7 @@
"app": 1,
"rank": 17,
"path": "/app/{profile}/assess/",
"rule_op": 1,
"rule_op": 4,
"kwargs": "{\"roledescription\": [\"contributor\"]}"
},
"model": "rules.Rule", "pk": 17
Expand All @@ -759,7 +759,7 @@
"app": 1,
"rank": 18,
"path": "/app/{profile}/reporting/",
"rule_op": 1,
"rule_op": 16,
"kwargs": "{\"roledescription\": [\"contributor\"]}"
},
"model": "rules.Rule", "pk": 18
Expand All @@ -768,7 +768,7 @@
"app": 1,
"rank": 19,
"path": "/app/{profile}/",
"rule_op": 3,
"rule_op": 6,
"kwargs": "{\"roledescription\": [\"contributor\"]}"
},
"model": "rules.Rule", "pk": 19
Expand Down
3 changes: 1 addition & 2 deletions djaoapp/templates/notification/quota_reached.eml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
{% block html_content %}
<h3>{% trans %}Free Tier Quota Reached{% endtrans %}</h3>

<p>{% trans user=user.nick_name %}Hello {{user}}{% endtrans %},</p>
<p>
{% trans broker=broker.printable_name %}This notification is to let you know that your profile has reached the free tier quota for the billing period.{% endtrans %} - {{back_url}}.
{% trans profile=profile.printable_name %}This notification is to let you know that {{profile}} has reached the free tier quota for the billing period.{% endtrans %} - {{back_url}}.
</p>
</div>
{% endblock %}
9 changes: 5 additions & 4 deletions djaoapp/templates/saas/billing/coupons.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
<coupon-list inline-template id="coupon-list-container">
<div class="container" data-trip data-trip-index="1" data-trip-content="<h2>{% trans %}Coupons{% endtrans %}</h2><p>{% trans %}Coupons are used to offer percentage discounts.<br />Create a coupon code with an associated discount percentage.<br />Distribute the coupon code to whoever is entitled<br />to a discount on their subscriptions. Users will be able to claim<br />the discount on the checkout page by entering the coupon code.{% endtrans %}</p><em>{% trans %}Use keyboard navigation or click 'Next' to move forward.{% endtrans %}</em>" data-trip-position="screen-center">

<form @submit.prevent="save">
<form id="couponCreate" method="post" @submit.prevent="save">
<input type="hidden" name="csrfmiddlewaretoken" value="{{csrf_token}}">
<div class="row">
<!-- Create a New Coupon -->
<div class="col-md-4">
<div class="me-2 mb-3 w-100">
<input type="text" class="form-control form-control-md" placeholder="{% trans %}Discount Code{% endtrans %}" v-model="newCoupon.code">
<input type="text" class="form-control form-control-md" placeholder="{% trans %}Discount Code{% endtrans %}" name="code" v-model="newCoupon.code">
</div>
</div>
<div class="col-md-4">
<div class="input-group me-2 mb-3 w-100">
<input type="text" class="form-control form-control-md" placeholder="{% trans %}Discount amount{% endtrans %}" v-model="newCoupon.discount_value">
<input type="text" class="form-control form-control-md" placeholder="{% trans %}Discount amount{% endtrans %}" name="discount_value" v-model="newCoupon.discount_value">
<select class="form-control form-select input-group-suffix"
v-model="newCoupon.discount_type">
name="discount_type" v-model="newCoupon.discount_type">
<option value="percentage">%</option>
<option value="currency">Currency (ex: usd)</option>
<option value="period">Period (ex: month)</option>
Expand Down

0 comments on commit ff64914

Please sign in to comment.