From a0e712827debe002af3777ef7e4ee1c8151576e1 Mon Sep 17 00:00:00 2001 From: Varakh Date: Fri, 8 Nov 2019 21:39:43 +0100 Subject: [PATCH] Use autofocus on username input field instead of the password field, Fill missing cells on incorrect cell count in table views --- CHANGELOG.md | 4 + README.md | 11 +- docker/nginx.conf | 1 - src/View/bootstrap4/login.twig | 4 +- src/View/bootstrap4/table.twig | 185 +++++++++++++++++++++------------ 5 files changed, 130 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2051e9f..dec16d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.1.4 - 2019/11/08 +* Use autofocus on username input field instead of the password field +* Fill missing cells on incorrect cell count in table views when only partial data is available + ## 2.1.3 - 2019/08/08 * Fixed false rendering of forms * Fixed channel tree view showing the wrong virtual server after selection diff --git a/README.md b/README.md index 6a2ac08..1dcb256 100755 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ ts3web is a free and open-source web interface for TeamSpeak 3 instances. The minimalistic approach of this application is intentional. -* Docker images available on https://hub.docker.com/r/varakh/ts3web -* Sources are hosted on https://gitlab.com/varakh/ts3web +* Docker images available on [https://hub.docker.com/r/varakh/ts3web](https://hub.docker.com/r/varakh/ts3web) +* Sources are hosted on [https://gitlab.com/varakh/ts3web](https://gitlab.com/varakh/ts3web) ## Limitations Features which are currently not supported: @@ -52,7 +52,7 @@ IP for this example setup. the `env` file referenced in the example `docker-compose`. ``` -version: '2' +version: '2.1' networks: teamspeak: external: false @@ -86,6 +86,11 @@ services: restart: always networks: - teamspeak + healthcheck: + test: "nc -z localhost 80" + interval: 1s + timeout: 10s + retries: 5 ``` Now execute `docker-compose up -d` to start those containers. If you like to update, do `docker-compose down`, diff --git a/docker/nginx.conf b/docker/nginx.conf index 1dc14e7..a560d80 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -75,7 +75,6 @@ http { # Enable checking the existence of precompressed files. #gzip_static on; - # Specifies the main log format. log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' diff --git a/src/View/bootstrap4/login.twig b/src/View/bootstrap4/login.twig index 76c3757..67a4866 100644 --- a/src/View/bootstrap4/login.twig +++ b/src/View/bootstrap4/login.twig @@ -24,14 +24,14 @@ + autofocus required>
+ placeholder="{% trans %}login.form.password.placeholder{% endtrans %}" required>
diff --git a/src/View/bootstrap4/table.twig b/src/View/bootstrap4/table.twig index 59ac8d2..e33d25a 100644 --- a/src/View/bootstrap4/table.twig +++ b/src/View/bootstrap4/table.twig @@ -1,10 +1,50 @@ + +{% set allKeys = [] %} +{% for arr in data %} + {% for key in arr|keys %} + {% if key not in allKeys %} + {% set allKeys = allKeys|merge([key]) %} + {% endif %} + {% endfor %} +{% endfor %} + +{% set workData = [] %} +{% for arr in data %} + {% set missing = [] %} + + {% for ix,key in allKeys %} + {% if key not in arr|keys %} + {% set missing = missing|merge({(key) : null}) %} + {% endif %} + {% endfor %} + + {% if missing is not null %} + {% set manipulatedArr = arr %} + {% set manipulatedArr = manipulatedArr|merge(missing) %} + + {% set correctOrdered = [] %} + {% for key in allKeys %} + {% for k,v in manipulatedArr %} + {% if k == key %} + {% set correctOrdered = correctOrdered|merge({(k):v}) %} + {% endif %} + {% endfor %} + {% endfor %} + + {% set workData = workData|merge([correctOrdered]) %} + + {% else %} + {% set workData = workData|merge([arr]) %} + {% endif %} +{% endfor %} +
{% set added = [] %} - {% for arr in data %} + {% for arr in workData %} {% set added = arr|keys %} {% endfor %} @@ -22,95 +62,102 @@ - {% for arr in data %} + {% for arr in workData %} - - {% set show = true %} - {% for hidden in hiddenDependingOnAttribute %} - {% if hidden.key in arr|keys and attribute(arr, hidden.key) in hidden.values %} - {% set show = false %} - {% endif %} - {% endfor %} + + {% set show = true %} + {% for hidden in hiddenDependingOnAttribute %} + {% if hidden.key in arr|keys and attribute(arr, hidden.key) in hidden.values %} + {% set show = false %} + {% endif %} + {% endfor %} - {% if show == true %} - - {% for key, value in arr %} - {% set value = value %} + {% if show == true %} + + {% for key, value in arr %} + {% set value = value %} - - {% for filter in filters %} - {% if filter.key == key %} + + {% for filter in filters %} + {% if filter.key == key %} + {% if value is not empty %} {% set value = value|apply_filter(filter.apply)|raw %} {% endif %} - {% endfor %} - - - {% set showColumn = true %} - {% if key in hiddenColumns %} - {% set showColumn = false %} {% endif %} + {% endfor %} - {% if showColumn %} - - {% endif %} - {% endfor %} + {% endif %} + + {% endif %} + {% endfor %} - - {% for link in additional_links %} - - {% endfor %} - - {% endif %} + {% set item = "#{link.label}" %} + {% endif %} + {% endfor %} + {% endif %} + + {{ item|raw }} + + {% endfor %} + + {% endif %} {% endfor %}
- {% set item = value %} + + {% set showColumn = true %} + {% if key in hiddenColumns %} + {% set showColumn = false %} + {% endif %} - - {% set editable = null %} - {% for attr in attributesEditable %} - {% if attr.key == key %} - {% set editable = attr %} + {% if showColumn %} + + {% set item = value %} + + + {% set editable = null %} + {% for attr in attributesEditable %} + {% if attr.key == key %} + {% set editable = attr %} + {% endif %} + {% endfor %} + + + {% if editable is not empty %} + {% include 'form_inline.twig' with {'editable': editable} %} + + {% else %} + {% for link in links %} + {% if link.key == key %} + {% if link.uri_param is not empty %} + {% for searchingKey, searchingValue in arr %} + {% if searchingKey == link.uri_param %} + {% set item = "#{value}" %} + {% endif %} + {% endfor %} + {% else %} + {% set item = "#{value}" %} + {% endif %} {% endif %} {% endfor %} - - {% if editable is not empty %} - {% include 'form_inline.twig' with {'editable': editable} %} - + {% if item is empty %} {% else %} - {% for link in links %} - {% if link.key == key %} - {% if link.uri_param is not empty %} - {% for searchingKey, searchingValue in arr %} - {% if searchingKey == link.uri_param %} - {% set item = "#{value}" %} - {% endif %} - {% endfor %} - {% else %} - {% set item = "#{value}" %} - {% endif %} - {% endif %} - {% endfor %} - {{ item|raw }} {% endif %} - - {% set item = "#{link.label}" %} + + {% for link in additional_links %} + + {% set item = "#{link.label}" %} - {% if link.uri_param is not empty %} - {% for searchingKey, searchingValue in arr %} - {% if searchingKey == link.uri_param %} - {% set shownValue = searchingValue %} + {% if link.uri_param is not empty %} + {% for searchingKey, searchingValue in arr %} + {% if searchingKey == link.uri_param %} + {% set shownValue = searchingValue %} - {% if link.apply is not empty %} + {% if link.apply is not empty %} + {% if shownValue is not empty %} {% set shownValue = shownValue|apply_filter(link.apply)|raw %} {% endif %} - - {% set item = "#{link.label}" %} {% endif %} - {% endfor %} - {% endif %} - {{ item|raw }} -