diff --git a/ansible_ai_connect/main/tests/test_views.py b/ansible_ai_connect/main/tests/test_views.py index 022d5f301..391a7f8c3 100644 --- a/ansible_ai_connect/main/tests/test_views.py +++ b/ansible_ai_connect/main/tests/test_views.py @@ -201,6 +201,12 @@ def test_get_view_trial(self): Logged in as: test_user_name
Plan: trial of 90 days
Expiration: {expired_at} + +
Accelerate Playbook creation with AI-driven content recommendations + from IBM Watsonx Code Assistant for Red Hat Ansible Lightspeed, + enabling faster, more efficient automation development. + Learn more. """ self.assertEqual(dedent(expectation).strip(), content) @@ -223,7 +229,9 @@ def test_get_view_expired_trial(self): r = self.client.get(reverse("me_summary")) self.assertEqual(r.status_code, 200) content = r.json()["content"] - self.assertTrue("Your trial has expired. Contact your Red Hat" in content) + self.assertTrue( + "Your trial has expired. To continue your Ansible automation journey" in content + ) user.delete() trial_plan.delete() diff --git a/ansible_ai_connect/users/one_click_trial.py b/ansible_ai_connect/users/one_click_trial.py index ab4d41d17..b4f3b5434 100644 --- a/ansible_ai_connect/users/one_click_trial.py +++ b/ansible_ai_connect/users/one_click_trial.py @@ -50,6 +50,14 @@ def get_markdown(self, host): Plan: {active_plan.plan.name}
Expiration: {expired_at} """ + if (active_plan.expired_at - timezone.now()).days <= 90: + markdown_value += """ +
Accelerate Playbook creation with AI-driven content recommendations + from IBM Watsonx Code Assistant for Red Hat Ansible Lightspeed, + enabling faster, more efficient automation development. + Learn more. + """ elif active_plan and not active_plan.expired_at: markdown_value = f""" Logged in as: {self.user.username}
@@ -59,11 +67,11 @@ def get_markdown(self, host): elif expired_plan: markdown_value = f""" Logged in as: {self.user.username}
- Your trial has expired. Contact your Red Hat Organization's - administrator to request access to - - Ansible Lightspeed with IBM watsonx Code Assistant. + Your trial has expired. To continue your Ansible automation journey, + contact your Red Hat organization's administrator, or connect with an IBM expert to subscribe to watsonx Code + Assistant for Red Hat Ansible Lightspeed. """ else: markdown_value = f""" diff --git a/ansible_ai_connect/users/templates/users/trial.html b/ansible_ai_connect/users/templates/users/trial.html index bc08291fd..d6f0fc08d 100644 --- a/ansible_ai_connect/users/templates/users/trial.html +++ b/ansible_ai_connect/users/templates/users/trial.html @@ -3,42 +3,49 @@ {% block content %} -{% if start_trial_button and accept_trial_terms is False %} -
-
- -
-

- Please accept the Terms and Conditions and allow information to be shared with IBM. -

-
-{% endif %} - -
-
-
-
-
- -
- {{ project_name }} logo -
+ {% if start_trial_button and accept_trial_terms is False %} +
+
+ +
+

+ Please accept the Terms and Conditions and allow information to be shared with IBM. +

+
+ {% endif %} +
+
+
+
+
-

{{ project_name }}

+
+ {{ project_name }} logo +
- {% if user.is_authenticated %} -
-

{% firstof user.external_username user.username %}

-
- {% if deployment_mode != "saas" or not one_click_trial_available %} - - {% elif has_active_plan %} -
- You have {{ days_left }} days left on your trial period -
+

{{ project_name }}

+ {% if user.is_authenticated %} +
+

{% firstof user.external_username user.username %}

+
+ + {% if deployment_mode != "saas" or not one_click_trial_available %} + + {% elif has_active_plan %} +
+

You have {{ days_left }} days left on your trial period

+ {% if days_left <= 90 %} +

+ Accelerate Playbook creation with AI-driven content recommendations from IBM Watsonx Code Assistant for Red Hat Ansible Lightspeed, enabling faster, more efficient automation development. + + Learn more. +

+ {% endif %} +
{% elif has_expired_plan %} -
-

- Your trial has expired. Contact your Red Hat Organization's administrator to request access to - - Ansible Lightspeed with IBM watsonx Code Assistant. -

-
+
+

+ Your trial has expired. To continue your Ansible automation journey, contact your Red Hat organization's administrator, or + + connect with an IBM expert to subscribe to watsonx Code Assistant for Red Hat Ansible Lightspeed. +

+
{% else %} -
{% csrf_token %} - -
-
-

- Start a trial to Ansible Lightspeed with IBM watsonx Code Assistant by accepting the terms below, - and clicking the Start button. -

-
+ {% csrf_token %} -
-
+
+

- - By checking the box and activating this trial, you accept - IBM terms and conditions - and acknowledge that Red Hat will share your information with IBM. - Required * + Start a trial to Ansible Lightspeed with IBM watsonx Code Assistant by accepting the terms below, + and clicking the Start button.

-
-
+
+
+

+ + By checking the box and activating this trial, you accept + IBM terms and conditions + and acknowledge that Red Hat will share your information with IBM. + Required * +

+
+
-
-

- Red Hat may use your personal data to inform you about its products, services, and events. -

-
+
-
-
+

- - Notify me about products, services, and events. + Red Hat may use your personal data to inform you about its products, services, and events.

-
+
+
+

+ + Notify me about products, services, and events. +

+
+
+ +

+ You can stop receiving marketing emails by clicking the unsubscribe link in each email or + withdraw your consent at any time in the + preference center. + See Privacy Statement for details. +

+ +

- You can stop receiving marketing emails by clicking the unsubscribe link in each email or - withdraw your consent at any time in the - preference center. - See Privacy Statement for details. +

- -
-

- -

- + {% endif %}
@@ -122,25 +129,29 @@

{{ project_name }}

- {% else %} + {% else %}
You are currently not logged in. Please log in using the button below.
Log in - {% endif %} - -
- Documentation - Status - - {% if deployment_mode == 'saas' and user.is_authenticated and user.rh_user_is_org_admin %} - Admin Portal - {% endif %} - {% if chatbot_enabled and deployment_mode == 'saas' and user.is_authenticated and rh_employee_or_test_user %} - Chatbot - {% endif %} + {% endif %} + +
+
+
+ Documentation + Status + + {% if deployment_mode == 'saas' and user.is_authenticated and user.rh_user_is_org_admin %} + Admin Portal + {% endif %} + {% if chatbot_enabled and deployment_mode == 'saas' and user.is_authenticated and rh_employee_or_test_user %} + Chatbot + {% endif %} +
+
+
-
-
+
{% endblock content %} diff --git a/ansible_ai_connect/users/tests/test_views.py b/ansible_ai_connect/users/tests/test_views.py index c384281ac..1fb83742d 100644 --- a/ansible_ai_connect/users/tests/test_views.py +++ b/ansible_ai_connect/users/tests/test_views.py @@ -344,7 +344,9 @@ def test_trial_period_is_done(self): ) self.user.plans.add(trial_plan) r = self.client.get(reverse("trial")) - self.assertContains(r, "Your trial has expired. Contact your Red Hat") + self.assertContains( + r, "Your trial has expired. To continue your Ansible automation journey" + ) @override_settings(SEGMENT_WRITE_KEY="blablabla") def test_accept_trial_schema1(self):