diff options
| author | Frederick Muriuki Muriithi | 2025-12-10 12:57:14 -0600 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-12-10 12:57:14 -0600 |
| commit | 09fc4bbc3ef66b02f0711dadaf3b10ed53d9d968 (patch) | |
| tree | 722daa9cee62cc7d66ed58f85fc18dcbf2636a89 /uploader/templates/macro-forms.html | |
| parent | 7838bd59c7fe3fbc936c932f1729c7372eb158ed (diff) | |
| download | gn-uploader-09fc4bbc3ef66b02f0711dadaf3b10ed53d9d968.tar.gz | |
Feature Flags: Generically deal with HTTP-based feature flags.
* Define a default `FEATURE_FLAGS_HTTP` configuration variable that's an empty list to help defining http-based feature flags that can be used to turn on/off features * Build macro to include hidden fields for feature flags where necessary. * Extend flask's `url_for` function to deal with defined feature flags in a mostly transparent way
Diffstat (limited to 'uploader/templates/macro-forms.html')
| -rw-r--r-- | uploader/templates/macro-forms.html | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/uploader/templates/macro-forms.html b/uploader/templates/macro-forms.html new file mode 100644 index 0000000..0ccab32 --- /dev/null +++ b/uploader/templates/macro-forms.html @@ -0,0 +1,9 @@ +{%macro add_http_feature_flags()%} +{%for flag in http_feature_flags():%} +{%if (request.args.get(flag) or request.form.get(flag) or ""):%} +<input type="hidden" + name="{{flag}}" + value="{{(request.args.get(flag) or request.form.get(flag))}}" /> +{%endif%} +{%endfor%} +{%endmacro%} |
