Skip to content

Commit

Permalink
Enhance user actions UI and add disassociation confirmation in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eduzen committed Jan 11, 2025
1 parent d00442a commit a8e7f1e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions pycompanies/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def test_company_disassociate_last_user_from_company(logged_client, user):

assert 200 == response.status_code
assert DISASSOCIATE_MESSAGE == response.context_data['message']
assert not UserCompanyProfile.objects.filter(id=user_company_profile.id).exists()


@pytest.mark.django_db
Expand Down
25 changes: 18 additions & 7 deletions templates/companies/_user_actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,25 @@
</div>
</div>

<div class="list-group-item">
<a href="{% url 'joboffers:admin' %}" class="btn btn-default">
{% trans 'Administrar Ofertas' %}
</a>
<a href="{% url 'companies:analytics' own_company.id %}" class="btn btn-dark-green">
{% trans 'Analítica de Ofertas' %}
</a>
<div class="list-group-item text-center">
<div class="btn-group" role="group">
<a href="{% url 'joboffers:admin' %}" class="btn btn-default">
{% trans 'Administrar Ofertas' %}
</a>
<a href="{% url 'companies:analytics' own_company.id %}" class="btn btn-success">
{% trans 'Analítica de Ofertas' %}
</a>
</div>
<div style="margin-top: 10px;">
<form action="{% url 'companies:disassociate' user.company.first.id %}" method="post" style="display:inline;">
{% csrf_token %}
<button type="submit" class="btn btn-danger">
{% trans 'Desuscribirse' %}
</button>
</form>
</div>
</div>

{% else %}
<div class="list-group-item">
<div class="h4 list-group-item-heading flex-center">
Expand Down

0 comments on commit a8e7f1e

Please sign in to comment.