Revert "build: luci.mk: gracefully handle missing or unversioned po subdirectories"
authorJo-Philipp Wich <jo@mein.io>
Tue, 14 Apr 2020 16:42:33 +0000 (18:42 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 14 Apr 2020 16:42:36 +0000 (18:42 +0200)
This reverts commit e6f77d5d72c0e13ed3eb370419abab52c4920a32.
Commit contained unrelated changes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
luci.mk
modules/luci-base/htdocs/luci-static/resources/luci.js

diff --git a/luci.mk b/luci.mk
index 0b3a66e3b5b8d3005003af0c84ebe6cdd5901036..621008aa8743876a7d08aacc16844dbf1b098373 100644 (file)
--- a/luci.mk
+++ b/luci.mk
@@ -65,13 +65,9 @@ define findrev
   $(shell \
     if git log -1 >/dev/null 2>/dev/null; then \
       set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- '$(if $(1),:(exclude))po'); \
-      if [ -n "$$1" ]; then
-        secs="$$(($$1 % 86400))"; \
-        yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
-        printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
-      else \
-        echo "unknown"; \
-      fi; \
+      secs="$$(($$1 % 86400))"; \
+      yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
+      printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
     else \
       ts=$$(find . -type f $(if $(1),-not) -path './po/*' -printf '%T@\n' 2>/dev/null | sort -rn | head -n1 | cut -d. -f1); \
       if [ -n "$$ts" ]; then \
index 63c9d9ee6cb81dcaf53a0c64c9eac0b91c44cff9..11ca2fdfcacfb8452ddf98e503c8e6f53b501e82 100644 (file)
                 * methods are overwritten with `null`.
                 */
                addFooter: function() {
-                       var footer = E([]),
-                           vp = document.getElementById('view'),
-                           readonly = true;
-
-                       vp.querySelectorAll('.cbi-map').forEach(function(map) {
-                               var m = DOM.findClassInstance(map);
-                               if (m && !m.readonly)
-                                       readonly = false;
-                       });
+                       var footer = E([]);
 
                        var saveApplyBtn = this.handleSaveApply ? new L.ui.ComboButton('0', {
                                0: [ _('Save & Apply') ],
                                        0: 'btn cbi-button cbi-button-apply important',
                                        1: 'btn cbi-button cbi-button-negative important'
                                },
-                               click: L.ui.createHandlerFn(this, 'handleSaveApply'),
-                               disabled: readonly || null
+                               click: L.ui.createHandlerFn(this, 'handleSaveApply')
                        }).render() : E([]);
 
                        if (this.handleSaveApply || this.handleSave || this.handleReset) {
                                        saveApplyBtn, ' ',
                                        this.handleSave ? E('button', {
                                                'class': 'cbi-button cbi-button-save',
-                                               'click': L.ui.createHandlerFn(this, 'handleSave'),
-                                               'disabled': readonly || null
+                                               'click': L.ui.createHandlerFn(this, 'handleSave')
                                        }, [ _('Save') ]) : '', ' ',
                                        this.handleReset ? E('button', {
                                                'class': 'cbi-button cbi-button-reset',
-                                               'click': L.ui.createHandlerFn(this, 'handleReset'),
-                                               'disabled': readonly || null
+                                               'click': L.ui.createHandlerFn(this, 'handleReset')
                                        }, [ _('Reset') ]) : ''
                                ]));
                        }
                                        });
                },
 
-               /**
-                * Check whether the current session has been granted the given ACL
-                * group permissions.
-                *
-                * @param {string} aclGroupName
-                * The ACL group name to check.
-                *
-                * @return {boolean|null}
-                * Returns `null` if the session does not have the specified grant,
-                * returns `false` if the permissions are granted readonly or
-                * `true` if they're granted read/write.
-                */
-               hasAcl: function(aclGroupName) {
-                       if (!this.isObject(this.env.accessgroups) ||
-                           !this.env.accessgroups.hasOwnProperty(aclGroupName) ||
-                           !Array.isArray(this.env.accessgroups[aclGroupName]))
-                               return null;
-
-                       for (var i = 0; i < this.env.accessgroups[aclGroupName].length; i++)
-                               if (this.env.accessgroups[aclGroupName][i] == 'write')
-                                       return true;
-
-                       for (var i = 0; i < this.env.accessgroups[aclGroupName].length; i++)
-                               if (this.env.accessgroups[aclGroupName][i] == 'read')
-                                       return false;
-
-                       return null;
-               },
-
                /**
                 * Deprecated wrapper around {@link LuCI.poll.remove Poll.remove()}.
                 *