Skip to content
Merged
Changes from all commits
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
26 changes: 17 additions & 9 deletions core/src/org/labkey/core/admin/lookAndFeelProperties.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
FolderDisplayMode currentMode = laf.getFolderDisplayMode();
inherited = isInherited(laf.getFolderDisplayModeStored());
%>
<%=inheritCheckbox(inherited, folderDisplayMode, "folder_always", "folder_admin")%>
<%=inheritCheckbox(inherited, folderDisplayMode, true, "folder_always", "folder_admin")%>
<td>
<label><input id="folder_always" type="radio" name="<%=folderDisplayMode%>" value="<%=FolderDisplayMode.ALWAYS%>"<%=checked(currentMode == FolderDisplayMode.ALWAYS)%><%=disabled(inherited)%>> <%=h(FolderDisplayMode.ALWAYS.getDisplayString())%></label><br>
<label><input id="folder_admin" type="radio" name="<%=folderDisplayMode%>" value="<%=FolderDisplayMode.ADMIN%>"<%=checked(currentMode == FolderDisplayMode.ADMIN)%><%=disabled(inherited)%>> <%=h(FolderDisplayMode.ADMIN.getDisplayString())%></label><br>
Expand All @@ -180,7 +180,7 @@
FolderDisplayMode currentMenuDisplayMode = laf.getApplicationMenuDisplayMode();
inherited = isInherited(laf.getApplicationMenuDisplayModeStored());
%>
<%=inheritCheckbox(inherited, applicationMenuDisplayMode, "menu_always", "menu_admin")%>
<%=inheritCheckbox(inherited, applicationMenuDisplayMode, true, "menu_always", "menu_admin")%>
<td>
<label><input id="menu_always" type="radio" name="<%=applicationMenuDisplayMode%>" value="<%=FolderDisplayMode.ALWAYS%>"<%=checked(currentMenuDisplayMode == FolderDisplayMode.ALWAYS)%><%=disabled(inherited)%>> <%=h(FolderDisplayMode.ALWAYS.getDisplayString())%></label><br>
<label><input id="menu_admin" type="radio" name="<%=applicationMenuDisplayMode%>" value="<%=FolderDisplayMode.ADMIN%>"<%=checked(currentMenuDisplayMode == FolderDisplayMode.ADMIN)%><%=disabled(inherited)%>>
Expand Down Expand Up @@ -240,14 +240,14 @@
<label for="<%=systemEmailAddress%>">System email address (<i>from</i> address for system notification emails)</label><%=helpPopup("System email address", "Requires AdminOperationsPermission to update.", false)%>
</td>
<% inherited = isInherited(laf.getSystemEmailAddressStored()); %>
<%=inheritCheckbox(inherited, systemEmailAddress)%>
<td><input type="text" id="<%=systemEmailAddress%>" name="<%=systemEmailAddress%>" size="<%=standardInputWidth%>" value="<%= h(laf.getSystemEmailAddress()) %>"<%=disabled(!hasAdminOpsPerm)%><%=disabled(inherited)%>></td>
<%=inheritCheckbox(inherited, systemEmailAddress, hasAdminOpsPerm)%>
<td><input type="text" id="<%=systemEmailAddress%>" name="<%=systemEmailAddress%>" size="<%=standardInputWidth%>" value="<%= h(laf.getSystemEmailAddress()) %>"<%=disabled(!hasAdminOpsPerm || inherited)%>></td>
</tr>
<tr>
<td class="labkey-form-label"><label for="<%=companyName%>">Organization name (appears in notification emails sent by system)</label></td>
<% inherited = isInherited(laf.getCompanyNameStored()); %>
<%=inheritCheckbox(inherited, companyName)%>
<td><input type="text" id="<%=companyName%>" name="<%=companyName%>" size="<%=standardInputWidth%>" value="<%= h(laf.getCompanyName()) %><%=disabled(inherited)%>"></td>
<td><input type="text" id="<%=companyName%>" name="<%=companyName%>" size="<%=standardInputWidth%>" value="<%= h(laf.getCompanyName()) %>" <%=disabled(inherited)%>></td>
Copy link
Contributor

Choose a reason for hiding this comment

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

Space is not needed before disabled(), but whatever

</tr>
<tr>
<td>&nbsp;</td>
Expand Down Expand Up @@ -330,7 +330,7 @@
<tr>
<td class="labkey-form-label"><label for="<%=defaultDateTimeFormat%>">Default display format for date-times</label><%=helpPopup("Date-time format", dateTimeFormatHelp, true)%></td>
<% inherited = isInherited(laf.getDefaultDateTimeFormatStored()); %>
<%=inheritCheckbox(inherited, defaultDateTimeFormat, "dateSelect", "timeSelect")%>
<%=inheritCheckbox(inherited, defaultDateTimeFormat, true, "dateSelect", "timeSelect")%>
<%
String dateTimeFormat = laf.getDefaultDateTimeFormat();
DateTimeFormat td = DateUtil.splitDateTimeFormat(dateTimeFormat);
Expand Down Expand Up @@ -426,7 +426,7 @@
<tr>
<td class="labkey-form-label"><label for="<%=customLogin%>">Alternative login page</label><%=helpPopup("Custom Login Page", customLoginHelp, true)%></td>
<% inherited = isInherited(laf.getCustomLoginStored()); %>
<%=inheritCheckbox(inherited, customLogin)%>
<%=inheritCheckbox(inherited, customLogin, hasAdminOpsPerm)%>
<td><input type="text" id="<%=customLogin%>" name="<%=customLogin%>" size="<%=standardInputWidth%>" value="<%= h(laf.getCustomLogin()) %>"<%=disabled(inherited || !hasAdminOpsPerm)%>></td>
</tr>
<tr>
Expand Down Expand Up @@ -569,10 +569,15 @@
private HtmlString inheritCheckbox(boolean inherited, Enum<?> e)
{
return inheritCheckbox(inherited, e, e.name());
return inheritCheckbox(inherited, e, true);
}
private HtmlString inheritCheckbox(boolean inherited, Enum<?> e, String... ids)
private HtmlString inheritCheckbox(boolean inherited, Enum<?> e, boolean enabled)
{
return inheritCheckbox(inherited, e, enabled, e.name());
}
private HtmlString inheritCheckbox(boolean inherited, Enum<?> e, boolean enabled, String... ids)
{
if (getContainer().isRoot())
return HtmlString.EMPTY_STRING;
Expand All @@ -593,6 +598,9 @@
if (inherited)
builder.append(" checked");
if (!enabled)
builder.append(" disabled");
return builder.append(HtmlString.unsafe("></td>")).getHtmlString();
}
Expand Down