Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/adding template filter for switch flag sample usable for if statements #531

Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2dfc644
adding is_active to django.html
MatthewEthanTam Nov 2, 2024
dd3b5d8
adding is_active template filter for switch, flag, and sample
MatthewEthanTam Nov 2, 2024
1492f63
adding tests for is_active template tags
MatthewEthanTam Nov 2, 2024
0a67973
running ./run.sh makemessages and compliemessages
MatthewEthanTam Nov 2, 2024
2e92fcd
waffle_tags: fixing linting
MatthewEthanTam Nov 17, 2024
213270a
test_templates: removing `with` for context manager compatibility
MatthewEthanTam Nov 17, 2024
fded0ae
adding template style spaces and small document changes
MatthewEthanTam Nov 17, 2024
2d137d5
Merge branch 'master' into feature/adding-template-filter-for-switch-…
MatthewEthanTam Nov 17, 2024
3f3adb5
Revert "Merge branch 'master' into feature/adding-template-filter-for…
MatthewEthanTam Nov 18, 2024
9fd2ba4
Revert "running ./run.sh makemessages and compliemessages"
MatthewEthanTam Nov 18, 2024
60c3dc1
Use ruff to lint Python code (#518)
cclauss Nov 9, 2024
cda0f97
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 18, 2024
87bed70
Revert "Use ruff to lint Python code (#518)"
MatthewEthanTam Nov 18, 2024
dfae8be
Use ruff to lint Python code (#518)
cclauss Nov 9, 2024
97db292
Revert "Use ruff to lint Python code (#518)"
MatthewEthanTam Nov 18, 2024
70a5751
Use ruff to lint Python code (#518)
cclauss Nov 9, 2024
62a20f8
Revert "Use ruff to lint Python code (#518)"
MatthewEthanTam Nov 18, 2024
80b1d5d
running ./run.sh makemessages and compliemessages
MatthewEthanTam Nov 2, 2024
bacf2a1
Use ruff to lint Python code (#518)
cclauss Nov 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test_app/templates/django/django.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,23 @@
sample_var off
{% endsample %}

{% flag_is_active "flag" request True as is_flag_active %}
{% if is_flag_active %}
flag_is_active on
{% else %}
flag_is_active off
{% endif %}

{% if "switch"|switch_is_active %}
switch_is_active on
{% else %}
switch_is_active off
{% endif %}

{% if "sample"|sample_is_active %}
sample_is_active on
{% else %}
sample_is_active off
{% endif %}

{% wafflejs %}
98 changes: 49 additions & 49 deletions waffle/locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-18 11:43+0100\n"
"POT-Creation-Date: 2024-11-02 14:42+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -17,202 +17,202 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.py:54
#: admin.py:38
msgid "Enable selected flags for everyone"
msgstr ""

#: admin.py:55
#: admin.py:50
msgid "Disable selected flags for everyone"
msgstr ""

#: admin.py:56
#: admin.py:62
msgid "Delete selected"
msgstr ""

#: admin.py:116
#: admin.py:112
msgid "Enable selected switches"
msgstr ""

#: admin.py:117
#: admin.py:123
msgid "Disable selected switches"
msgstr ""

#: models.py:128 models.py:407 models.py:470
#: models.py:141 models.py:438 models.py:501
msgid "The human/computer readable name."
msgstr ""

#: models.py:129 models.py:408 models.py:471
#: models.py:142 models.py:439 models.py:502
msgid "Name"
msgstr ""

#: models.py:135
#: models.py:148
msgid ""
"Flip this flag on (Yes) or off (No) for everyone, overriding all other "
"settings. Leave as Unknown to use normally."
msgstr ""

#: models.py:137
#: models.py:150
msgid "Everyone"
msgstr ""

#: models.py:144
#: models.py:157
msgid ""
"A number between 0.0 and 99.9 to indicate a percentage of users for whom "
"this flag will be active."
msgstr ""

#: models.py:146 models.py:478
#: models.py:159 models.py:509
msgid "Percent"
msgstr ""

#: models.py:150
#: models.py:163
msgid "Allow this flag to be set for a session for user testing"
msgstr ""

#: models.py:151
#: models.py:164
msgid "Testing"
msgstr ""

#: models.py:155
#: models.py:168
msgid "Flag always active for superusers?"
msgstr ""

#: models.py:156
#: models.py:169
msgid "Superusers"
msgstr ""

#: models.py:160
#: models.py:173
msgid "Flag always active for staff?"
msgstr ""

#: models.py:161
#: models.py:174
msgid "Staff"
msgstr ""

#: models.py:165
#: models.py:178
msgid "Flag always active for authenticated users?"
msgstr ""

#: models.py:166
#: models.py:179
msgid "Authenticated"
msgstr ""

#: models.py:171
#: models.py:184
msgid ""
"Activate this flag for users with one of these languages (comma-separated "
"list)"
msgstr ""

#: models.py:172
#: models.py:185
msgid "Languages"
msgstr ""

#: models.py:176
#: models.py:189
msgid "Activate roll-out mode?"
msgstr ""

#: models.py:177
#: models.py:190
msgid "Rollout"
msgstr ""

#: models.py:181
#: models.py:194
msgid "Note where this Flag is used."
msgstr ""

#: models.py:182 models.py:418 models.py:483
#: models.py:195 models.py:449 models.py:514
msgid "Note"
msgstr ""

#: models.py:187
#: models.py:200
msgid "Date when this Flag was created."
msgstr ""

#: models.py:188 models.py:424 models.py:489
#: models.py:201 models.py:455 models.py:520
msgid "Created"
msgstr ""

#: models.py:192
#: models.py:205
msgid "Date when this Flag was last modified."
msgstr ""

#: models.py:193 models.py:429 models.py:494
#: models.py:206 models.py:460 models.py:525
msgid "Modified"
msgstr ""

#: models.py:203 models.py:321 models.py:393
#: models.py:216 models.py:352 models.py:424
msgid "Flag"
msgstr ""

#: models.py:204 models.py:322 models.py:394
#: models.py:217 models.py:353 models.py:425
msgid "Flags"
msgstr ""

#: models.py:309
#: models.py:340
msgid "Activate this flag for these user groups."
msgstr ""

#: models.py:310
#: models.py:341
msgid "Groups"
msgstr ""

#: models.py:315
#: models.py:346
msgid "Activate this flag for these users."
msgstr ""

#: models.py:316
#: models.py:347
msgid "Users"
msgstr ""

#: models.py:412
#: models.py:443
msgid "Is this switch active?"
msgstr ""

#: models.py:413
#: models.py:444
msgid "Active"
msgstr ""

#: models.py:417
#: models.py:448
msgid "Note where this Switch is used."
msgstr ""

#: models.py:423
#: models.py:454
msgid "Date when this Switch was created."
msgstr ""

#: models.py:428
#: models.py:459
msgid "Date when this Switch was last modified."
msgstr ""

#: models.py:438
#: models.py:470 models.py:565
msgid "Switch"
msgstr ""

#: models.py:439
#: models.py:471 models.py:566
msgid "Switches"
msgstr ""

#: models.py:476
#: models.py:507
msgid ""
"A number between 0.0 and 100.0 to indicate a percentage of the time this "
"sample will be active."
msgstr ""

#: models.py:482
#: models.py:513
msgid "Note where this Sample is used."
msgstr ""

#: models.py:488
#: models.py:519
msgid "Date when this Sample was created."
msgstr ""

#: models.py:493
#: models.py:524
msgid "Date when this Sample was last modified."
msgstr ""

#: models.py:503
#: models.py:535 models.py:578
msgid "Sample"
msgstr ""

#: models.py:504
#: models.py:536 models.py:579
msgid "Samples"
msgstr ""
Binary file modified waffle/locale/it/LC_MESSAGES/django.mo
Binary file not shown.
Loading
Loading