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

feature: Client main contact method #223 #398

Merged
merged 4 commits into from
Jun 4, 2024
Merged
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
18 changes: 18 additions & 0 deletions backend/migrations/0035_client_contact_method.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.4 on 2024-05-30 01:58

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("backend", "0034_invoice_client_email_quotaincreaserequest_reason_and_more"),
]

operations = [
migrations.AddField(
model_name="client",
name="contact_method",
field=models.CharField(blank=True, max_length=100, null=True),
),
]
1 change: 1 addition & 0 deletions backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ class Client(models.Model):
email = models.EmailField(blank=True, null=True)
email_verified = models.BooleanField(default=False)
company = models.CharField(max_length=100, blank=True, null=True)
contact_method = models.CharField(max_length=100, blank=True, null=True)
is_representative = models.BooleanField(default=False)

address = models.CharField(max_length=100, blank=True, null=True)
Expand Down
1 change: 1 addition & 0 deletions backend/views/core/clients/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def create_client(request: HtmxHttpRequest):
"email": request.POST.get("client_email"),
"address": request.POST.get("client_address"),
"phone_number": request.POST.get("client_phone"),
"contact_method": request.POST.get("client_contact_method"),
"company": request.POST.get("company_name"),
"is_representative": (True if request.POST.get("is_representative") == "on" else False),
}
Expand Down
17 changes: 17 additions & 0 deletions frontend/templates/pages/clients/create/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@
</div>
</div>
</div>
{# Client Main Contact Method #}
<div class="card me-3 w-full bg-base-200 border border-base-200 hover:border-gray-400">
<div class="card-body w-full">
<div class="form-control w-full">
<label class="label">
<span class="label-text">Client Main Contact Method</span>
</label>
<input name="client_contact_method"
type="text"
class="peer input input-bordered w-full"
placeholder="Enter email, phone number, etc." />
<label class="label peer-[&amp;:not(:placeholder-shown):not(:focus):invalid]:block hidden">
<span class="label-text-alt text-error">Please enter a valid main contact method</span>
</label>
</div>
</div>
</div>
</div>
<button type="submit" class="btn float-right w-[150px] btn-primary">Create</button>
</form>
Expand Down
Loading