Skip to content

Commit

Permalink
refactor buttons stracture
Browse files Browse the repository at this point in the history
  • Loading branch information
bai1024 committed Aug 23, 2024
1 parent 94e9891 commit 0523275
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
21 changes: 11 additions & 10 deletions promgen/static/css/promgen.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,17 @@ a[rel]:after {


/* service-action-button-group */
.service-action-button-group hr {
margin-top: 5px !important;
margin-bottom: 5px !important;
}

.service-action-button-group > .dropdown-menu > li > form > button {
padding: 3px 20px;
white-space: nowrap;
background: none;
border: none;
.service-action-button-group {
hr {
margin-top: 5px !important;
margin-bottom: 5px !important;
}
.dropdown-menu > li > form > button {
padding: 3px 20px;
white-space: nowrap;
background: none;
border: none;
}
}

/* Margin Top */
Expand Down
23 changes: 9 additions & 14 deletions promgen/templates/promgen/service_action_button_group.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% load i18n %}
{% load promgen %}


<div style="display: inline-block;" class="service-action-button-group">
<div class="btn-group btn-group-sm" role="group" aria-label="...">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand All @@ -10,13 +9,11 @@
<ul class="dropdown-menu">

<li>
<a href="">
<form action="{% url 'service-notifier' service.id %}" style="display:inline" method="post" v-pre>{% csrf_token %}
<input type="hidden" name="sender" value="promgen.notification.user">
<input type="hidden" name="value" value="{{request.user.username}}" />
<button style="background:none;border:none;padding:0;">{% translate "Subscribe to Notifications" %}</button>
</form>
</a>
<form action="{% url 'service-notifier' service.id %}" style="display:inline" method="post" v-pre>{% csrf_token %}
<input type="hidden" name="sender" value="promgen.notification.user">
<input type="hidden" name="value" value="{{request.user.username}}" />
<button>{% translate "Subscribe to Notifications" %}</button>
</form>
</li>

<hr>
Expand All @@ -32,12 +29,10 @@
<hr>

<li role="presentation">
<a href="">
<form method="post" action="{% url 'service-delete' service.id %}" onsubmit="return confirm('{% translate "Delete this service?" %}')" style="display: inline">
{% csrf_token %}
<button style="background:none;border:none;padding:0;color:#d9534f" >{% translate "Delete Service" %}</button>
</form>
</a>
<form method="post" action="{% url 'service-delete' service.id %}" onsubmit="return confirm('{% translate "Delete this service?" %}')" style="display: inline">
{% csrf_token %}
<button type="submit" style="color:#d9534f;">{% translate "Delete Service" %}</button>
</form>
</li>

</ul>
Expand Down

0 comments on commit 0523275

Please sign in to comment.