@@ -84,39 +84,44 @@ <h3 class="package-snippet__title">{{ project.name }}
84
84
</ div >
85
85
< div class ="package-snippet__buttons ">
86
86
87
- {% if not user_has_two_factor and project.name in projects_requiring_2fa %}
88
- < a
89
- href ="{{ request.route_path('manage.account.two-factor') }} "
90
- class ="button button--danger "
91
- {% if project.pypi_mandates_2fa %}
92
- title ="{% trans %}PyPI requires 2FA to be enabled to manage this project{% endtrans %} "
93
- {% else %}
94
- title ="{% trans %}This project requires 2FA to be enabled to manage{% endtrans %} "
95
- {% endif %}
96
- > {% trans %}2FA Required{% endtrans %}</ a >
87
+ {% if project.name in projects_owned %}
88
+ {% if not user_has_two_factor and project.name in projects_requiring_2fa %}
89
+ {# Show 2FA required button #}
90
+ < a
91
+ href ="{{ request.route_path('manage.account.two-factor') }} "
92
+ class ="button button--danger "
93
+ {% if project.pypi_mandates_2fa %}
94
+ title ="{% trans %}PyPI requires 2FA to be enabled to manage this project{% endtrans %} "
95
+ {% else %}
96
+ title ="{% trans %}This project requires 2FA to be enabled to manage{% endtrans %} "
97
+ {% endif %}
98
+ > {% trans %}2FA Required{% endtrans %}</ a >
97
99
98
- {% else %}
99
- < a
100
+ {% else %}
101
+ {# Show manage button #}
102
+ < a
100
103
href ="{{ request.route_path('manage.project.releases', project_name=project.normalized_name) }} "
101
104
class ="button button--primary "
102
- {% if project.name in projects_owned %}
103
105
title ="{% trans %}Manage this project{% endtrans %} "
104
- {% else %}
105
- disabled
106
- title ="{% trans %}You are not an owner of this project{% endtrans %} "
107
- {% endif %}
108
106
> {% trans %}Manage{% endtrans %}</ a >
107
+ {% endif %}
108
+ {% else %}
109
+ {# Show disabled button #}
110
+ < button class ="button button--primary " disabled title ="{% trans %}You are not an owner of this project{% endtrans %} ">
111
+ {% trans %}Manage{% endtrans %}
112
+ </ button >
109
113
{% endif %}
114
+ {% if project.releases %}
110
115
< a
111
116
href ="{{ request.route_path('packaging.project', name=project.normalized_name) }} "
112
117
class ="button "
113
- {% if project.releases %}
114
118
title ="{% trans %}View this project's public page{% endtrans %} "
115
- {% else %}
116
- disabled
117
- title ="{% trans %}This project has no releases{% endtrans %} "
118
- {% endif %}
119
119
> {% trans %}View{% endtrans %}</ a >
120
+ {% else %}
121
+ < button class ="button " disabled title ="{% trans %}This project has no releases{% endtrans %} " >
122
+ {% trans %}View{% endtrans %}
123
+ </ button >
124
+ {% endif %}
120
125
</ div >
121
126
</ div >
122
127
</ div >
0 commit comments