Skip to content

Commit 8aae94c

Browse files
disjfaNyholm
authored andcommitted
Upgraded to bootstrap 4.1.1 (#227)
* Upgraded to bootstrap 4.1.1 * Upgraded to bootstrap 4.1.1 * Sorted css * Moved javascript into javascript block, for framework compatibility
1 parent fb70b1d commit 8aae94c

File tree

9 files changed

+157
-200
lines changed

9 files changed

+157
-200
lines changed

Resources/public/css/bootstrap.4.1.1.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/css/bootstrap.4.1.1.min.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/css/bootstrap4-alpha5.min.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

Resources/public/css/bootstrap4-alpha5.min.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

Resources/public/css/webui.css

100644100755
Lines changed: 20 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,23 @@
1-
/* Navigation */
2-
.configs {
3-
padding: 0 2rem;
4-
}
5-
.configs .navbar-nav .nav-text{
6-
font-weight: bold;
7-
padding-top: 0.2rem;
8-
padding-bottom: 0;
9-
display: inline-block;
10-
width: 6rem;
11-
}
12-
13-
.configs .navbar-nav .nav-link {
14-
padding-top: 0.1rem;
15-
padding-bottom: 0.1rem;
16-
}
17-
18-
191
/* Index page */
20-
.catalogue-list {
21-
margin-top:2rem;
22-
}
23-
242
.total-progressbar {
253
width: 100%;
264
}
275

286
.domain-table .progressbar-cell {
29-
width: 15rem;
30-
padding: 0 1rem;
31-
}
32-
33-
.domain-table .progressbar-cell .progress{
34-
margin: 0;
7+
width: 60%;
358
}
369

37-
.domain-table tr td{
38-
vertical-align: top;
39-
}
40-
41-
/* Show page */
42-
.message-list {
43-
margin-top:2rem;
10+
.message-delete {
11+
float: right;
4412
}
4513

46-
.message {
47-
border-top: 1px solid #cecece;
48-
margin-bottom: 1rem;
49-
padding-top: 0.5rem;
50-
}
51-
.message-textarea {
52-
width: 100%;
53-
height: 3rem;
14+
.locales-item {
15+
padding: .25rem;
16+
display: inline-block;
5417
}
5518

56-
.message-key {
57-
font-family: "serif";
58-
text-decoration: none;
59-
color: black;
60-
font-weight: bold;
61-
font-size: 110%
62-
}
63-
.message-delete {
64-
float: right;
19+
.locales-item.active {
20+
color: rgba(0, 0, 0, .5);
6521
}
6622

6723
pre a {
@@ -70,28 +26,26 @@ pre a {
7026
}
7127

7228
.location-list {
29+
list-style: none;
7330
margin: 0;
7431
padding: 0;
75-
list-style: none;
7632
}
7733

78-
7934
/* Ajax results */
80-
.ajax-result {
81-
border-radius: 5px;
82-
padding: 5px;
83-
margin-top: 0.5rem;
84-
}
85-
8635

8736
.ajax-result.success {
88-
background-color: #449944;
89-
border: 1px solid #cecece;
90-
color: #ffffff;
37+
width: 100%;
38+
padding: .25rem .5rem;
39+
color: #155724;
40+
background-color: #d4edda;
41+
border-color: #c3e6cb;
42+
border-radius: .25rem;
9143
}
9244

9345
.ajax-result.error {
94-
background-color: #bb4444;
95-
border: 1px solid #cecece;
96-
color: #ffffff;
46+
width: 100%;
47+
padding: .25rem .5rem;
48+
color: #721c24;
49+
background-color: #f8d7da;
50+
border-color: #f5c6cb;
9751
}

Resources/public/js/webui.js

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ function removeResultElement(el) {
125125
function toggleElement(id) {
126126
var el = document.getElementById(id);
127127
if (el.offsetParent === null) {
128-
el.classList.add("in");
128+
el.classList.add("show");
129129
} else {
130-
el.classList.remove("in");
130+
el.classList.remove("show");
131131
}
132132
}
133133

Resources/views/WebUI/base.html.twig

100644100755
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
77
<meta http-equiv="x-ua-compatible" content="ie=edge">
88
<title>PHP Translation</title>
9-
<link rel="stylesheet" href="{{ asset("bundles/translation/css/bootstrap4-alpha5.min.css") }}">
9+
<link rel="stylesheet" href="{{ asset("bundles/translation/css/bootstrap.4.1.1.min.css") }}">
1010
<link rel="stylesheet" href="{{ asset("bundles/translation/css/webui.css") }}">
1111
</head>
1212
<body>
1313

14-
<nav class="navbar navbar-light bg-faded configs">
15-
<ul class="nav navbar-nav">
16-
<li class="nav-item"><span class="nav-text">Configs:</span></li>
17-
{% for c in configNames %}
18-
<li class="nav-item{% if configName == c %} active{% endif %}">
19-
<a class="nav-link" href="{{ path('translation_index', {configName: c}) }}">
20-
{{ c }}
21-
</a>
22-
</li>
23-
{% endfor %}
24-
</ul>
14+
<nav class="navbar navbar-expand-lg navbar-light bg-light">
15+
<div class="container">
16+
<ul class="navbar-nav mr-auto">
17+
<li class="nav-item"><span class="navbar-text">Configs:</span></li>
18+
{% for c in configNames %}
19+
<li class="nav-item{% if configName == c %} active{% endif %}">
20+
<a class="nav-link" href="{{ path('translation_index', {configName: c}) }}">
21+
{{ c }}
22+
</a>
23+
</li>
24+
{% endfor %}
25+
</ul>
26+
</div>
2527
</nav>
2628

2729
{% block body %}{% endblock %}
2830

29-
<script type="text/javascript" src="{{ asset("bundles/translation/js/webui.js") }}"></script>
31+
{% block javascripts %}
32+
<script type="text/javascript" src="{{ asset("bundles/translation/js/webui.js") }}"></script>
33+
{% endblock %}
34+
3035
</body>
3136
</html>

Resources/views/WebUI/index.html.twig

100644100755
Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@
22
{% import _self as macro %}
33

44
{% block body %}
5-
<div class="container">
6-
<div class="catalogue-list">
7-
{% for cataloge in catalogues %}
8-
<div class="catalouge">
9-
<h3>{{ localeMap[cataloge.locale] }}</h3>
10-
<table class="domain-table">
11-
{% set totalMessages = 0 %}
12-
{% set translatedMessages = 0 %}
13-
{% for domain,messages in cataloge.all|sort %}
14-
{% set pg = 0 %}
15-
{% set translated = 0 %}
16-
{% for message in messages %}
17-
{% if message != '' %}
18-
{% set translated = translated + 1 %}
5+
<div class="container">
6+
{% for cataloge in catalogues %}
7+
<h3 class="mt-3">{{ localeMap[cataloge.locale] }}</h3>
8+
<table class="table domain-table">
9+
{% set totalMessages = 0 %}
10+
{% set translatedMessages = 0 %}
11+
{% for domain,messages in cataloge.all|sort %}
12+
{% set pg = 0 %}
13+
{% set translated = 0 %}
14+
{% for message in messages %}
15+
{% if message != '' %}
16+
{% set translated = translated + 1 %}
17+
{% endif %}
18+
{% endfor %}
19+
{% if translated > 0 %}
20+
{% set pg = (translated/messages|length*100)|round(2) %}
1921
{% endif %}
22+
<tr>
23+
<td>
24+
<a href="{{ path("translation_show", {configName: configName, domain:domain, locale:cataloge.locale}) }}">
25+
{{ domain }}
26+
</a>
27+
</td>
28+
<td class="progressbar-cell">
29+
{{ macro.progress(pg, "") }}
30+
</td>
31+
<td>
32+
<div class="text-nowrap">
33+
<small>({{ translated }} / {{ messages|length }})</small>
34+
<b>{{ pg }} %</b>
35+
</div>
36+
</td>
37+
</tr>
38+
{% set totalMessages = totalMessages + messages|length %}
39+
{% set translatedMessages = translatedMessages + translated %}
2040
{% endfor %}
21-
{% if translated > 0 %}
22-
{% set pg = (translated/messages|length*100)|round(2) %}
23-
{% endif %}
24-
<tr>
25-
<td>
26-
<a href="{{ path("translation_show", {configName: configName, domain:domain, locale:cataloge.locale}) }}">
27-
{{ domain }}
28-
</a>
29-
</td>
30-
<td class="progressbar-cell">
31-
{{ macro.progress(pg, "") }}
32-
</td>
33-
<td>
34-
<small>({{ translated }} / {{ messages|length }})</small>
35-
<b>{{ pg }} %</b>
36-
</td>
37-
</tr>
38-
{% set totalMessages = totalMessages + messages|length %}
39-
{% set translatedMessages = translatedMessages + translated %}
40-
{% endfor %}
4141
</table>
4242
{% if totalMessages == 0 %}
4343
{% set pg = 100 %}
@@ -53,10 +53,8 @@
5353
<b>{{ pg }}%</b>
5454
</div>
5555
{{ macro.progress(pg, "total-progressbar") }}
56-
</div>
57-
{% endfor %}
56+
{% endfor %}
5857
</div>
59-
</div>
6058
{% endblock %}
6159

6260
{% macro progress(pg, class) %}
@@ -67,5 +65,9 @@
6765
{% else %}
6866
{% set type="success" %}
6967
{% endif %}
70-
<progress class="progress progress-striped progress-{{ type }} {{ class }}" value="{{ pg }}" max="100"></progress>
68+
<div class="py-1">
69+
<div class="progress">
70+
<div class="progress-bar bg-{{ type }}" role="progressbar" style="width: {{ pg }}%" aria-valuenow="{{ pg }}" aria-valuemin="0" aria-valuemax="100"></div>
71+
</div>
72+
</div>
7173
{% endmacro %}

0 commit comments

Comments
 (0)