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

[B5] Internal project pages #35536

Merged
merged 13 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@

{% js_entry 'domain/js/bootstrap5/toggles' %}

{% block stylesheets %}
<style>
Copy link
Contributor

@orangejenny orangejenny Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Musing: I wonder if it will be worthwhile to pull these into generally available classes, named similarly to these ones. But I don't know think that's important unless/until another use case comes up. I don't know offhand of other places we use background colors like this.

I do prefer to pull page-specific styles into their own scss sheets, because it's easier to get an overview of all styles in HQ by looking across the scss files, rather than needing to search for style blocks in HTML pages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep that in mind and pull them out if I come across other similar styles that could be generally useful.

.success > td {
background-color: var(--bssuccess-bg-subtle);
}
.warning > td {
background-color: var(--bswarning-bg-subtle);
}
.bg-default, .bg-release {
background-color: rgba(var(--bssecondary-rgb), 1);
}
</style>
{% endblock %}

{% block page_content %}

{% initial_page_data 'domain' domain %}
Expand Down Expand Up @@ -80,7 +94,7 @@ <h1>Feature Flags</h1>
<tbody data-bind="foreach: toggles">
<tr>
<td>
<span data-bind="css: ('label-' + tagCssClass),
<span data-bind="css: ('bg-' + tagCssClass),
text: tag"
class="badge"></span>
</td>
Expand All @@ -90,13 +104,13 @@ <h1>Feature Flags</h1>
</td>

<td data-bind="css: {'text-body-secondary': !isEnabled()}" >
<div class="row clickable" data-bind="click: showHideDescription">
<!--ko text: badge --><!--/ko-->
<div class="clickable" data-bind="click: showHideDescription">
<!--ko text: label --><!--/ko-->

<span data-bind="visible: description || helpLink">&hellip;</span>
</div>

<div class="row" data-bind="slideVisible: expanded()">
<div data-bind="slideVisible: expanded()">
<br />
<p data-bind="visible: description, html: description"></p>
<span data-bind="visible: helpLink">
Expand All @@ -105,7 +119,7 @@ <h1>Feature Flags</h1>

<hr data-bind="visible: description || helpLink" />

<span data-bind="css: ('label-' + tagCssClass),
<span data-bind="css: ('bg-' + tagCssClass),
text: tag"
class="badge"></span>
<span data-bind="html: tagDescription"></span>
Expand Down
3 changes: 2 additions & 1 deletion corehq/apps/domain/views/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,13 @@ def page_context(self):
}


@method_decorator(use_bootstrap5, name='dispatch')
@method_decorator(always_allow_project_access, name='dispatch')
@method_decorator(require_superuser, name='dispatch')
class FlagsAndPrivilegesView(BaseAdminProjectSettingsView):
urlname = 'feature_flags_and_privileges'
page_title = gettext_lazy("Feature Flags and Privileges")
template_name = 'domain/admin/bootstrap3/flags_and_privileges.html'
template_name = 'domain/admin/bootstrap5/flags_and_privileges.html'

def _get_toggles(self):

Expand Down