Skip to content

Commit d068ca7

Browse files
committed
Fix CSS and template for automation rule UI
Remove hard coded values in HTML for font awesome and override the values with CSS instead.
1 parent 76f801d commit d068ca7

File tree

4 files changed

+50
-12
lines changed

4 files changed

+50
-12
lines changed

media/css/core.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,6 @@ div.httpexchange div.highlight pre {
12931293

12941294

12951295
/* Subprojects */
1296-
12971296
div.module.project-subprojects li.subproject a.subproject-url:before {
12981297
padding-right: .5em;
12991298
font-family: FontAwesome;
@@ -1307,14 +1306,6 @@ div.module.project-subprojects li.subproject a.subproject-edit:before {
13071306
content: "\f044";
13081307
}
13091308

1310-
/* Automation Rules */
1311-
1312-
li.automation-rule input[type="submit"] {
1313-
font-family: FontAwesome;
1314-
font-weight: normal;
1315-
}
1316-
1317-
13181309
/* Pygments */
13191310
div.highlight pre .hll { background-color: #ffffcc }
13201311
div.highlight pre .c { color: #60a0b0; font-style: italic } /* Comment */

readthedocs/projects/static-src/projects/css/admin.less

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,25 @@
1616
}
1717
}
1818
}
19+
20+
// Automation rules
21+
#content .module-list.automation-rules .automation-rule button {
22+
margin: .25em;
23+
24+
> span {
25+
display: none;
26+
}
27+
28+
&:before {
29+
font-family: FontAwesome;
30+
font-weight: normal;
31+
}
32+
33+
&.automation-rule-up:before {
34+
content: "\f062";
35+
}
36+
37+
&.automation-rule-down:before {
38+
content: "\f063";
39+
}
40+
}

readthedocs/projects/static/projects/css/admin.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,19 @@
1313
display: inline-block;
1414
margin: 1em 0em 0em 0em;
1515
}
16+
#content .module-list.automation-rules .automation-rule button {
17+
margin: .25em;
18+
}
19+
#content .module-list.automation-rules .automation-rule button > span {
20+
display: none;
21+
}
22+
#content .module-list.automation-rules .automation-rule button:before {
23+
font-family: FontAwesome;
24+
font-weight: normal;
25+
}
26+
#content .module-list.automation-rules .automation-rule button.automation-rule-up:before {
27+
content: "\f062";
28+
}
29+
#content .module-list.automation-rules .automation-rule button.automation-rule-down:before {
30+
content: "\f063";
31+
}

readthedocs/templates/builds/versionautomationrule_list.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{% extends "projects/project_edit_base.html" %}
22

33
{% load i18n %}
4+
{% load static %}
45

56
{% block title %}{% trans "Automation Rules" %}{% endblock %}
67

8+
{% block extra_links %}
9+
<link rel="stylesheet" type="text/css" href="{% static "projects/css/admin.css" %}" />
10+
{% endblock %}
11+
712
{% block nav-dashboard %} class="active"{% endblock %}
813

914
{% block project-automation-rules-active %}active{% endblock %}
@@ -30,7 +35,7 @@
3035
</ul>
3136
</div>
3237

33-
<div class="module-list">
38+
<div class="module-list automation-rules">
3439
<div class="module-list-wrapper">
3540
<ul>
3641
{% for rule in object_list %}
@@ -46,7 +51,9 @@
4651
<li class="automation-rule">
4752
<form method="post" action="{% url 'projects_automation_rule_move' project_slug=project.slug automation_rule_pk=rule.pk steps=-1 %}">
4853
{% csrf_token %}
49-
<input aria-label="{% trans 'Move up' %}" title="{% trans 'Move up' %}" type="submit" value="&#xf062">
54+
<button aria-label="{% trans 'Move up' %}" title="{% trans 'Move up' %}" class="automation-rule-up">
55+
<span>{% trans 'Move up' %}</span>
56+
</button>
5057
</form>
5158
</li>
5259
{% endif %}
@@ -55,7 +62,9 @@
5562
<li class="automation-rule">
5663
<form method="post" action="{% url 'projects_automation_rule_move' project_slug=project.slug automation_rule_pk=rule.pk steps=1 %}">
5764
{% csrf_token %}
58-
<input aria-label="{% trans 'Move down' %}" title="{% trans 'Move down' %}" type="submit" value="&#xf063">
65+
<button aria-label="{% trans 'Move down' %}" title="{% trans 'Move down' %}" class="automation-rule-down">
66+
<span>{% trans 'Move down' %}</span>
67+
</button>
5968
</form>
6069
</li>
6170
{% endif %}

0 commit comments

Comments
 (0)