Skip to content

Commit

Permalink
More clarifications on the claim page for FB and IG channels
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Nov 26, 2024
1 parent 7ae8ba7 commit 887da08
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions temba/channels/types/facebookapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def get_context_data(self, **kwargs):
claim_error = context["form"].errors["__all__"][0]
context["claim_error"] = claim_error

context["update_existing"] = self.request.GET.get("update") == "1"
return context

def form_valid(self, form):
Expand Down
2 changes: 2 additions & 0 deletions temba/channels/types/instagram/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def get_context_data(self, **kwargs):
if context["form"].errors:
claim_error = context["form"].errors["__all__"][0]
context["claim_error"] = claim_error

context["update_existing"] = self.request.GET.get("update") == "1"
return context

def form_valid(self, form):
Expand Down
20 changes: 16 additions & 4 deletions templates/channels/types/facebookapp/claim.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
{% load i18n compress temba %}

{% block pre-form %}
{% blocktrans trimmed with name=branding.name %}
You can connect your Facebook page to {{ name }} in just a few simple steps.
{% endblocktrans %}
{% if update_existing %}
{% blocktrans trimmed %}
Your existing channel has invalid credentials, you need to go through the steps below again to get the credentials updated.
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with name=branding.name %}
You can connect your Facebook page to {{ name }} in just a few simple steps.
{% endblocktrans %}
{% endif %}
{% if claim_error %}
<temba-alert level="error" class="my-4">
{{ claim_error }}
Expand All @@ -23,7 +29,13 @@
</ol>
</div>
<div class="flex mt-4" id="fb-app-connect">
<div class="button-primary connect-facebook">{% trans "Add Facebook Page" %}</div>
<div class="button-primary connect-facebook">
{% if update_existing %}
{% trans "Connect Facebook Page" %}
{% else %}
{% trans "Add Facebook Page" %}
{% endif %}
</div>
</div>
<form style="display:none;" method="post" action="{{ claim_url }}" id="claim-form">
{% csrf_token %}
Expand Down
20 changes: 16 additions & 4 deletions templates/channels/types/instagram/claim.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
{% load i18n compress temba %}

{% block pre-form %}
{% blocktrans trimmed with name=branding.name %}
You can connect your Instagram business account to {{ name }} in just a few simple steps.
{% endblocktrans %}
{% if update_existing %}
{% blocktrans trimmed %}
Your existing channel has invalid credentials, you need to go through the steps below again to get the credentials updated.
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with name=branding.name %}
You can connect your Instagram business account to {{ name }} in just a few simple steps.
{% endblocktrans %}
{% endif %}
{% if claim_error %}
<temba-alert level="error" class="my-4">
{{ claim_error }}
Expand All @@ -28,7 +34,13 @@
</ol>
</div>
<div class="flex mt-4" id="fb-app-connect">
<div class="button-primary connect-facebook">{% trans "Add Instagram Business Account" %}</div>
<div class="button-primary connect-facebook">
{% if update_existing %}
{% trans "Connect Instagram Business Account" %}
{% else %}
{% trans "Add Instagram Business Account" %}
{% endif %}
</div>
</div>
<form style="display:none;" method="post" action="{{ claim_url }}" id="claim-form">
{% csrf_token %}
Expand Down

0 comments on commit 887da08

Please sign in to comment.