[Rt-commit] rt branch 5.0/update-labeled-value-layout created. rt-5.0.3-134-g8280074982
BPS Git Server
git at git.bestpractical.com
Fri Oct 7 21:19:11 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/update-labeled-value-layout has been created
at 828007498221f3de7602c48ed19cb5fc1b290b3c (commit)
- Log -----------------------------------------------------------------
commit 828007498221f3de7602c48ed19cb5fc1b290b3c
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 7 10:30:34 2022 +0800
Use a loose regex to get around space changes caused by LabeledValue refactor
diff --git a/t/web/cf_textarea.t b/t/web/cf_textarea.t
index a15aa5edc1..77297b037d 100644
--- a/t/web/cf_textarea.t
+++ b/t/web/cf_textarea.t
@@ -123,9 +123,9 @@ $m->follow_link_ok( { text => 'Display' } );
$content =~ s!\n+!!g;
$m->text_like(
qr/TheTextarea\sadded.+\Q$content\E.+
- TheTextarea\schanged.+From:\Q$content\ETo:\Q$new_content\E.+
- TheTextarea\schanged.+From:\Q$new_content\ETo:\Q$newer_content\E.+
- TheTextarea\sdeleted.+\Q$newer_content\E/xs,
+ TheTextarea\schanged.+From:\s*\Q$content\E\s*To:\s*\Q$new_content\E.+
+ TheTextarea\schanged.+From:\s*\Q$new_content\E\s*To:\s*\Q$newer_content\E.+
+ TheTextarea\sdeleted.+\s*\Q$newer_content\E/xs,
'textarea change details'
);
commit b660f8302f391c870a7c3718d0697a29c31e0140
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 7 06:21:36 2022 +0800
Port more elements to LabeledValue
diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index 2cfc5be13e..1234f4faf2 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -178,42 +178,26 @@ jQuery( function() {
<&| /Widgets/TitleBox, title => 'Integration', class => 'custom-field-info-integration', content_class => 'mx-auto width-lg' &>
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>Link values to</&>
- </div>
- <div class="col-8">
+ <&| /Elements/LabeledValue, Label => loc('Link values to'), LabelCols => 2, ValueCols => 8 &>
<input class="form-control" type="text" size="60" name="LinkValueTo" value="<% $CustomFieldObj->LinkValueTo || $LinkValueTo || '' %>" />
- </div>
-</div>
+ </&>
-<div class="form-row">
- <div class="col-2"></div>
- <div class="col-8">
+ <&| /Elements/LabeledValue, Label => '', LabelCols => 2, ValueCols => 8 &>
<&|/l&>RT can make this custom field's values into hyperlinks to another service.</&>
<&|/l&>Fill in this field with a URL.</&>
<&|/l_unsafe, '<tt>__id__</tt>', '<tt>__CustomField__</tt>' &>RT will replace [_1] and [_2] with the record's id and the custom field's value, respectively.</&>
- </div>
-</div>
+ </&>
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>Include page</&>
- </div>
- <div class="value col-8">
+ <&| /Elements/LabeledValue, Label => loc('Include page'), LabelCols => 2, ValueCols => 8 &>
<input class="form-control" type="text" size="60" name="IncludeContentForValue" value="<% $CustomFieldObj->IncludeContentForValue || $IncludeContentForValue || '' %>" />
- </div>
-</div>
+ </&>
-<div class="form-row">
- <div class="col-2"></div>
- <div class="col-8">
+ <&| /Elements/LabeledValue, Label => '', LabelCols => 2, ValueCols => 8 &>
<&|/l&>RT can include content from another web service when showing this custom field.</&>
<&|/l&>Fill in this field with a URL.</&>
<&|/l_unsafe, '<tt>__id__</tt>', '<tt>__CustomField__</tt>' &>RT will replace [_1] and [_2] with the record's id and the custom field's value, respectively.</&>
<i><&|/l&>Some browsers may only load content from the same domain as your RT server.</&></i>
- </div>
-</div>
+ </&>
</&>
% if ( $CustomFieldObj->Id && $CustomFieldObj->IsSelectionType && !$CustomFieldObj->IsExternalValues ) {
diff --git a/share/html/Admin/CustomFields/index.html b/share/html/Admin/CustomFields/index.html
index 589d611666..8e53bb507d 100644
--- a/share/html/Admin/CustomFields/index.html
+++ b/share/html/Admin/CustomFields/index.html
@@ -53,19 +53,14 @@
<form action="<%RT->Config->Get('WebPath')%>/Admin/CustomFields/index.html" method="get">
- <div class="form-row">
- <div class="label col-auto">
- <&|/l&>Only show custom fields for:</&>
- </div>
- <div class="value col-auto">
+ <&| /Elements/LabeledValue, Label => loc('Only show custom fields for'), LabelCols => 'auto', ValueCols => 'auto' &>
<select name="Type" class="form-control selectpicker">
<option value="" <% !$Type && 'selected="selected"'%> ><% loc('(any)') %></option>
% for my $type ( $tmp->LookupTypes ) {
<option value="<% $type %>" <% $type eq $Type && 'selected="selected"'%> ><% $tmp->FriendlyLookupType( $type ) %></option>
% }
</select>
- </div>
- </div>
+ </&>
<div class="form-row">
<div class="col-12">
diff --git a/share/html/Admin/CustomRoles/Visibility.html b/share/html/Admin/CustomRoles/Visibility.html
index 17e58515e9..85d85fdb0b 100644
--- a/share/html/Admin/CustomRoles/Visibility.html
+++ b/share/html/Admin/CustomRoles/Visibility.html
@@ -55,11 +55,7 @@
<&| /Widgets/TitleBox, class => 'custom-role-info-visibility', content_class => 'mx-auto width-sm' &>
% for (@pages) {
% my ($label, $url) = @$_;
- <div class="form-row boolean">
- <div class="label col-4">
- <% $label %>:
- </div>
- <div class="value col-8">
+ <&| /Elements/LabeledValue, Class => 'boolean', Label => $label, LabelCols => 4, ValueCols => 8 &>
<div class="form-row">
<div class="col-auto">
<div class="custom-control custom-radio">
@@ -74,8 +70,7 @@
</div>
</div>
</div>
- </div>
- </div>
+ </&>
% }
</&>
diff --git a/share/html/Admin/Elements/ModifyTemplate b/share/html/Admin/Elements/ModifyTemplate
index a9ffd1199d..8515777b6a 100644
--- a/share/html/Admin/Elements/ModifyTemplate
+++ b/share/html/Admin/Elements/ModifyTemplate
@@ -46,29 +46,15 @@
%#
%# END BPS TAGGED BLOCK }}}
<&| /Widgets/TitleBox, class => 'template-info-basics', content_class => 'mx-auto width-lg' &>
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>Name</&>:
- </div>
- <div class="value col-6">
+ <&| /Elements/LabeledValue, Label => loc('Name'), LabelCols => 2, ValueCols => 6 &>
<input type="text" class="form-control" name="Name" value="<%$Name||''%>" size="80" />
- </div>
-</div>
+ </&>
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>Description</&>:
- </div>
- <div class="value col-6">
+ <&| /Elements/LabeledValue, Label => loc('Description'), LabelCols => 2, ValueCols => 6 &>
<input type="text" class="form-control" name="Description" value="<%$Description||''%>" size="80" />
- </div>
-</div>
+ </&>
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>Type</&>:
- </div>
- <div class="value col-6">
+ <&| /Elements/LabeledValue, Label => loc('Type'), LabelCols => 2, ValueCols => 6 &>
<div class="custom-control custom-radio">
<input type="radio" name="Type" class="custom-control-input" id="Type-Perl" value="Perl" <% $Type eq "Perl" ? 'checked="checked"' : "" |n %>></input>
<label class="custom-control-label" for="Type-Perl"><&|/l&>Perl</&></label><br />
@@ -77,18 +63,12 @@
<input type="radio" name="Type" class="custom-control-input" id="Type-Simple" value="Simple" <% $Type eq "Simple" ? 'checked="checked"' : "" |n %>>
<label class="custom-control-label" for="Type-Simple"><&|/l&>Simple</&></label><br />
</div>
- </div>
-</div>
+ </&>
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>Content</&>:
- </div>
- <div class="value col-8">
+ <&| /Elements/LabeledValue, Label => loc('Content'), LabelCols => 2, ValueCols => 8 &>
<textarea name="Content" class="form-control" rows="25" cols="80" wrap="soft">
<%$Content||''%></textarea>
- </div>
-</div>
+ </&>
</&>
<%INIT>
diff --git a/share/html/Admin/Groups/index.html b/share/html/Admin/Groups/index.html
index 2d1ea985a6..eeb98c4300 100644
--- a/share/html/Admin/Groups/index.html
+++ b/share/html/Admin/Groups/index.html
@@ -54,12 +54,7 @@
<input type="hidden" name="GroupOp" value="LIKE" />
<div class="row">
<div class="col-xl-6">
-
- <div class="form-row">
- <div class="label col-3 text-left">
- <&|/l&>Go to group</&>
- </div>
- <div class="value col-3">
+ <&| /Elements/LabeledValue, Label => loc('Go to group'), LabelClass => 'label text-left', ValueCols => 3 &>
<input type="text" class="form-control" name="GroupString" value="" data-autocomplete="Groups" id="autocomplete-GroupString" />
<script type="text/javascript">
jQuery(function(){
@@ -69,8 +64,7 @@
});
});
</script>
- </div>
- </div>
+ </&>
</div>
</div>
</form>
diff --git a/share/html/Admin/Queues/People.html b/share/html/Admin/Queues/People.html
index fb9a2a77fd..c112c4f20b 100644
--- a/share/html/Admin/Queues/People.html
+++ b/share/html/Admin/Queues/People.html
@@ -99,20 +99,17 @@
<em><%$user_msg%></em>
% } elsif ($Users) {
% while (my $u = $Users->Next ) {
- <div class="form-row">
- <div class="col-3">
- <& /Elements/SelectWatcherType,
- Scope => 'queue',
- Name => "Queue-AddWatcher-Principal-". $u->PrincipalId,
- Queue => $QueueObj,
- &>
- </div>
- <div class="col-3">
- <span class="form-control current-value">
+ <&| /Elements/LabeledValue,
+ RawLabel => $m->scomp( "/Elements/SelectWatcherType",
+ Scope => 'queue',
+ Name => "Queue-AddWatcher-Principal-" . $u->PrincipalId,
+ Queue => $QueueObj, ),
+ LabelCols => 3,
+ ValueCols => 3,
+ ValueSpanClass => 'current-value',
+ &>
<& /Elements/ShowUser, User => $u &>
- </span>
- </div>
- </div>
+ </&>
% }
% }
@@ -123,20 +120,17 @@
<em><%$group_msg%></em>
% } elsif ($Groups) {
% while (my $g = $Groups->Next ) {
- <div class="form-row">
- <div class="col-3">
- <& /Elements/SelectWatcherType,
- Scope => 'queue',
- Name => "Queue-AddWatcher-Principal-".$g->PrincipalId,
- Queue => $QueueObj,
- &>
- </div>
- <div class="col-3">
- <span class="form-control current-value">
+ <&| /Elements/LabeledValue,
+ RawLabel => $m->scomp( "/Elements/SelectWatcherType",
+ Scope => 'queue',
+ Name => "Queue-AddWatcher-Principal-" . $g->PrincipalId,
+ Queue => $QueueObj, ),
+ LabelCols => 3,
+ ValueCols => 3,
+ ValueSpanClass => 'current-value',
+ &>
<%$g->Name%> (<%$g->Description%>)
- </span>
- </div>
- </div>
+ </&>
% }
% }
</div>
diff --git a/share/html/Admin/Tools/Shredder/Elements/SelectPlugin b/share/html/Admin/Tools/Shredder/Elements/SelectPlugin
index 1957b83902..b2065692e9 100644
--- a/share/html/Admin/Tools/Shredder/Elements/SelectPlugin
+++ b/share/html/Admin/Tools/Shredder/Elements/SelectPlugin
@@ -49,17 +49,14 @@
$Plugin => ''
</%ARGS>
<& PluginHelp, %ARGS, Plugin => 'Base' &>
-<div class="shredder-form form-row">
- <div class="label col-auto"><&|/l&>Select plugin</&>: </div>
- <div class="col-auto">
+<&| /Elements/LabeledValue, Class => 'shredder-form', Label => loc('Select plugin'), LabelCols => 'auto', ValueCols => 'auto' &>
<select name="Plugin" class="form-control selectpicker" onchange="showShredderPluginTab(this.value);">
<option value=""><% loc('(no value)') %></option>
% foreach my $p( keys %plugins ) {
<option value="<% $p %>" <% ($p eq $Plugin)? 'selected="selected"': '' %>><% loc($p) %></option>
% }
</select>
- </div>
-</div>
+</&>
<div id="shredder-plugin-tabs">
% foreach my $p( keys %plugins ) {
<div id="shredder-plugin-<% $p %>-tab" class="<% ($p ne $Plugin)? 'hidden': '' %>">
diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index bb76a12efe..c8d8d1b210 100644
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -57,14 +57,9 @@
<input type="hidden" name="UserField" value="Name" />
<input type="hidden" name="UserOp" value="LIKE" />
- <div class="form-row">
- <div class="label col-4 text-left">
- <&|/l&>Go to user</&>
- </div>
- <div class="col-8">
+ <&| /Elements/LabeledValue, Label => loc('Go to user'), LabelClass => 'label text-left', LabelCols => 4, ValueCols => 8 &>
<input type="text" class="form-control" name="UserString" value="" data-autocomplete="Users" data-autocomplete-return="Name" id="autocomplete-UserString" />
- </div>
- </div>
+ </&>
<script type="text/javascript">
jQuery(function(){
// Jump directly to the page if a user is chosen
@@ -83,11 +78,7 @@ jQuery(function(){
<input type="hidden" name="<% $field %>" value="<% $ARGS{ $field } %>" />
% }
- <div class="form-row">
- <div class="label col-3 text-left">
- <&|/l&>Include</&>
- </div>
- <div class="col-3">
+ <&| /Elements/LabeledValue, Label => loc('Include'), LabelClass => 'label text-left', LabelCols => 3, ValueCols => 3 &>
<select name="IncludeSystemGroups" class="selectpicker form-control">
% my $group_selected;
% for my $group_value ( qw(Privileged Unprivileged All) ) {
@@ -98,8 +89,7 @@ jQuery(function(){
<option value="<% $group_value %>" <% $group_selected |n %>><% loc($group_value) %></option>
% }
</select>
- </div>
- </div>
+ </&>
<div class="form-row">
<div class="label col-3 text-left">
<&|/l&>Find all users whose</&>
diff --git a/share/html/Articles/Elements/BeforeMessageBox b/share/html/Articles/Elements/BeforeMessageBox
index 9d5c3663bc..2e93704a17 100644
--- a/share/html/Articles/Elements/BeforeMessageBox
+++ b/share/html/Articles/Elements/BeforeMessageBox
@@ -51,10 +51,9 @@
<div class="articles-select-article">
% unless (RT->Config->Get('HideArticleSearchOnReplyCreate')) {
- <div class="form-row">
- <div class="form-group label col-2"><&|/l&>Include Article:</&></div>
- <div class="value col-9"><& /Elements/SelectArticle, QueueObj => $QueueObj, AutoSubmit => 1 &></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('Include Article'), LabelClass => 'form-group label', LabelCols => 2, ValueCols => 9 &>
+ <& /Elements/SelectArticle, QueueObj => $QueueObj, AutoSubmit => 1 &>
+ </&>
% }
% if ( @$topics ) {
<div class="form-row">
diff --git a/share/html/Asset/Elements/ShowPeople b/share/html/Asset/Elements/ShowPeople
index 6b35fdf2e6..59a6b7b5ef 100644
--- a/share/html/Asset/Elements/ShowPeople
+++ b/share/html/Asset/Elements/ShowPeople
@@ -52,11 +52,7 @@ $AssetObj
my $CatalogObj = $AssetObj->CatalogObj;
</%init>
% for my $role ($AssetObj->Roles) {
- <div class="form-row">
- <div class="label col-3">
- <% loc($role) %>:
- </div>
- <div class="value col-9">
+<&| /Elements/LabeledValue, Label => loc($role), &>
<div class="user-accordion accordion">
% if ($AssetObj->Role($role)->{Single}) {
% my $users = $AssetObj->RoleGroup($role)->UserMembersObj(Recursively => 0);
@@ -72,8 +68,7 @@ my $CatalogObj = $AssetObj->CatalogObj;
<& ShowRoleMembers, Group => $CatalogObj->RoleGroup($role), Role => $role, Skip => $AssetObj->RoleGroup($role), Note => loc("(via this asset's catalog)") &>
% }
</div>
- </div>
- </div>
+</&>
% }
<& /Elements/ShowCustomFields, Object => $AssetObj, Grouping => 'People', Table => 0 &>
diff --git a/share/html/Elements/AuthToken/Create b/share/html/Elements/AuthToken/Create
index c6bdc29f39..7c3a03a659 100644
--- a/share/html/Elements/AuthToken/Create
+++ b/share/html/Elements/AuthToken/Create
@@ -58,24 +58,13 @@
<form method="POST">
<input type="hidden" name="Owner" value="<% $Owner %>">
% if ( $require_password ){
- <div class="form-row">
- <div class="label col-4">
- <&|/l, $session{'CurrentUser'}->Name()&>[_1]'s current password</&>:
- </div>
- <div class="value col-8">
- <input class="form-control" type="password" name="Password" size="16" autocomplete="off" /></td>
- </div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc("[_1]'s current password", $session{'CurrentUser'}->Name), LabelCols => 4, ValueCols => 8 &>
+ <input class="form-control" type="password" name="Password" size="16" autocomplete="off" />
+ </&>
% }
- <div class="form-row">
- <div class="label col-4">
- <span class="prev-icon-helper"><&|/l&>Description</&>:</span>\
-<span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<% loc("What's this token for?") %>"></span>
- </div>
- <div class="value col-8">
+ <&| /Elements/LabeledValue, Label => loc('Description'), LabelTooltip => loc("What's this token for?"), LabelCols => 4, ValueCols => 8 &>
<input class="form-control" type="text" name="Description" value="<% $Description %>" size="16" />
- </div>
- </div>
+ </&>
<div class="form-row">
<div class="col-12">
diff --git a/share/html/Elements/LabeledValue b/share/html/Elements/LabeledValue
index 3603a76742..d191771fe8 100644
--- a/share/html/Elements/LabeledValue
+++ b/share/html/Elements/LabeledValue
@@ -58,6 +58,7 @@ $LabelClass => 'label'
$ValueClass => 'value'
$LabelCols => 3
$ValueCols => 9
+$ValueId => undef
</%args>
<%init>
if ( !defined($Value) && !defined($RawValue) && $m->content) {
@@ -84,7 +85,8 @@ if ( !defined($Value) && !defined($RawValue) && $m->content) {
$m->out('<span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="'. $m->interp->apply_escapes($LabelTooltip, "h").'"></span>');
}
$m->out('</div>');
- $m->out(qq{<div class="$ValueClass col-$ValueCols">});
+ my $id_attr = $ValueId ? qq{ id="$ValueId"} : '';
+ $m->out(qq{<div class="$ValueClass col-$ValueCols"$id_attr>});
if ($ValueSpanClass) {
$m->out('<span class="'.$m->interp->apply_escapes($ValueSpanClass,"h").'">');
}
diff --git a/share/html/Elements/ShowTransaction b/share/html/Elements/ShowTransaction
index 67ccc5882a..c41ecb56da 100644
--- a/share/html/Elements/ShowTransaction
+++ b/share/html/Elements/ShowTransaction
@@ -97,30 +97,25 @@ $m->comp(
% $new =~ s|\n|<br />|g;
<div class="details hidden" id="txn-<% $Transaction->Id %>-details">
% if ( $old eq loc('(no value)') ) {
- <div class="form-row">
- <div class="label col-2"><% loc('Added') %>:</div>
- <div class="value col-10"><% $new |n %></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('Added'), LabelCols => 2, ValueCols => 10 &>
+ <% $new |n %>
+ </&>
% }
% elsif ( $new eq loc('(no value)') ) {
- <div class="form-row">
- <div class="label col-2"><% loc('Deleted') %>:</div>
- <div class="value col-10"><% $old |n %></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('Deleted'), LabelCols => 2, ValueCols => 10 &>
+ <% $old |n %>
+ </&>
% }
% else {
- <div class="form-row">
- <div class="label col-2"><% loc('From') %>:</div>
- <div class="value col-10"><% $old |n %></div>
- </div>
- <div class="form-row">
- <div class="label col-2"><% loc('To') %>:</div>
- <div class="value col-10"><% $new |n %></div>
- </div>
- <div class="form-row diff">
- <div class="label col-2"><% loc('Changes') %>:</div>
- <div class="value col-10"><% loc('Loading...') %></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('From'), LabelCols => 2, ValueCols => 10 &>
+ <% $old |n %>
+ </&>
+ <&| /Elements/LabeledValue, Label => loc('To'), LabelCols => 2, ValueCols => 10 &>
+ <% $new |n %>
+ </&>
+ <&| /Elements/LabeledValue, Class => 'diff', Label => loc('Changes'), LabelCols => 2, ValueCols => 10 &>
+ <% loc('Loading...') %>
+ </&>
% }
</div>
% }
diff --git a/share/html/Search/Elements/EditSearches b/share/html/Search/Elements/EditSearches
index 6871e702bb..4228f06f99 100644
--- a/share/html/Search/Elements/EditSearches
+++ b/share/html/Search/Elements/EditSearches
@@ -50,18 +50,14 @@
%# Hide all the save functionality if the user shouldn't see it.
% if ( $can_modify ) {
-<div class="form-row">
- <div class="label col-4"><&|/l&>Privacy</&>:</div>
- <div class="col-8">
+ <&| /Elements/LabeledValue, Label => loc('Privacy'), LabelCols => 4, ValueCols => 8 &>
<& SelectSearchObject, Name => 'SavedSearchOwner', Objects => \@CreateObjects, Object => ( $Object && $Object->id ) ? $Object->Object : '' &>
- </div>
-</div>
- <div class="form-row">
- <div class="label col-4"><&|/l&>Description</&>:</div>
- <div class="col-8">
+ </&>
+
+ <&| /Elements/LabeledValue, Label => loc('Description'), LabelCols => 4, ValueCols => 8 &>
<input type="text" size="25" name="SavedSearchDescription" value="<% $Description || '' %>" class="form-control" />
- </div>
- </div>
+ </&>
+
<div class="form-row justify-content-end">
<div class="col-auto">
% if ($Id ne 'new') {
@@ -90,24 +86,16 @@
% }
% if ( $Object && $Object->Id && $Object->DependedOnBy->Count ) {
- <div class="form-row">
- <div class="label col-4"><&|/l&>Depended on by</&>:</div>
- <div class="col-8">
- <span class="form-control current-value">
- <a href="#" data-toggle="modal" data-target="#saved-search-depended-on-by-list-modal"><% loc('View') %></a>
- </span>
- </div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('Depended on by'), LabelCols => 4, ValueCols => 8, ValueSpanClass => 'current-value' &>
+ <a href="#" data-toggle="modal" data-target="#saved-search-depended-on-by-list-modal"><% loc('View') %></a>
+ </&>
% }
<hr />
- <div class="form-row">
- <div class="label col-4"><&|/l&>Load saved search</&>:</div>
- <div class="col-8 input-group">
+ <&| /Elements/LabeledValue, Label => loc('Load saved search'), LabelCols => 4, ValueClass => 'input-group', ValueCols => 8, &>
<& SelectSearchesForObjects, Name => 'SavedSearchLoad', Objects => \@LoadObjects, SearchType => $Type &>
<input type="submit" class="button btn btn-primary" value="<% loc('Load') %>" id="SavedSearchLoadSubmit" name="SavedSearchLoadSubmit" />
- </div>
- </div>
+ </&>
</&>
</div>
diff --git a/share/html/Search/Elements/PickCriteria b/share/html/Search/Elements/PickCriteria
index 6f23bbaf2e..dc1fd6d54c 100644
--- a/share/html/Search/Elements/PickCriteria
+++ b/share/html/Search/Elements/PickCriteria
@@ -68,10 +68,9 @@
% $m->callback( %ARGS, CallbackName => "AfterCFs" );
% }
-<div class="form-row">
- <div class="label col-3"><&|/l&>Aggregator</&></div>
- <div class="col-9 operator"><& SelectAndOr, Name => "AndOr" &></div>
-</div>
+<&| /Elements/LabeledValue, Label => loc('Aggregator'), ValueClass => 'value operator' &>
+ <& SelectAndOr, Name => "AndOr" &>
+</&>
</&>
diff --git a/share/html/SelfService/Create.html b/share/html/SelfService/Create.html
index 63cff26179..83929bd739 100644
--- a/share/html/SelfService/Create.html
+++ b/share/html/SelfService/Create.html
@@ -58,39 +58,25 @@
<&|/Widgets/TitleBox, title => $title, class => 'ticket-info-basics' &>
<div>
-<div class="queue form-row">
-<div class="label col-2">
-<&|/l&>Queue</&>:
-</div>
-<div class="value col-8">
- <span class="current-value form-control"><strong><%$queue_obj->Name || ''%></strong> <% $queue_obj->Description ? '('.$queue_obj->Description.')' : '' %></span>
-</div>
-</div>
+
+<&| /Elements/LabeledValue, Label => loc('Queue'), Class => 'queue', LabelCols => 2, ValueCols => 8 &>
+ <span class="current-value form-control"><strong><%$queue_obj->Name || ''%></strong> <% $queue_obj->Description ? '('.$queue_obj->Description.')' : '' %></span>
+</&>
+
<% $m->callback( CallbackName => 'AfterQueue', %ARGS, QueueObj => $queue_obj ) %>
-<div class="form-row">
-<div class="form-group label col-2">
-<&|/l&>Requestors</&>:
-</div>
-<div class="value col-8">
-<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => RT->Config->Get('AllowUserAutocompleteForUnprivileged') ? 1 : 0, AutocompleteType => 'Principals' &>
-</div>
-</div>
-<div class="form-row">
-<div class="form-group label col-2">
-<&|/l&>Cc</&>:
-</div>
-<div class="value col-8">
-<& /Elements/EmailInput, Name => 'Cc', Size => '20', Default => $ARGS{Cc} || '', AutocompleteMultiple => RT->Config->Get('AllowUserAutocompleteForUnprivileged') ? 1 : 0, AutocompleteType => 'Principals' &>
-</div>
-</div>
-<div class="form-row">
-<div class="form-group label col-2">
-<&|/l&>Subject</&>:
-</div>
-<div class="form-group value col-8">
-<input class="form-control" type="text" name="Subject" size="60" maxsize="200" value="<%$ARGS{Subject} || ''%>" />
-</div>
-</div>
+
+<&| /Elements/LabeledValue, Label => loc('Requestors'), LabelClass => 'form-group label', LabelCols => 2, ValueCols => 8 &>
+ <& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => RT->Config->Get('AllowUserAutocompleteForUnprivileged') ? 1 : 0, AutocompleteType => 'Principals' &>
+</&>
+
+<&| /Elements/LabeledValue, Label => loc('Cc'), LabelClass => 'form-group label', LabelCols => 2, ValueCols => 8 &>
+ <& /Elements/EmailInput, Name => 'Cc', Size => '20', Default => $ARGS{Cc} || '', AutocompleteMultiple => RT->Config->Get('AllowUserAutocompleteForUnprivileged') ? 1 : 0, AutocompleteType => 'Principals' &>
+</&>
+
+<&| /Elements/LabeledValue, Label => loc('Subject'), LabelClass => 'form-group label', ValueClass => 'form-group value', LabelCols => 2, ValueCols => 8 &>
+ <input class="form-control" type="text" name="Subject" size="60" maxsize="200" value="<%$ARGS{Subject} || ''%>" />
+</&>
+
<div class="form-group">
<& /Elements/EditCustomFields,
%ARGS,
diff --git a/share/html/SelfService/Update.html b/share/html/SelfService/Update.html
index 0bbb46b4a9..8be16070a9 100644
--- a/share/html/SelfService/Update.html
+++ b/share/html/SelfService/Update.html
@@ -60,27 +60,16 @@
<&|/Widgets/TitleBox, title => $title, class => 'ticket-info-basics' &>
<div>
- <div class="form-row">
- <div class="label col-2">
- <&|/l&>Status</&>
- </div>
- <div class="value col-8">
- <& /Ticket/Elements/SelectStatus,
- Name => "Status",
- TicketObj => $Ticket,
- Default => $DefaultStatus &>
- </div>
- </div>
- <div class="form-row">
- <div class="form-group label col-2">
- <&|/l&>Subject</&>
- </div>
- <div class="form-group value col-8">
- <input class="form-control" type="text" name="UpdateSubject" size="60" value="<% $ARGS{UpdateSubject} || $Ticket->Subject || '' %>" />
- </div>
-
- </div>
- <& /Elements/EditCustomFields, Object => $Ticket &>
+ <&| /Elements/LabeledValue, Label => loc('Status'), LabelCols => 2, ValueCols => 8 &>
+ <& /Ticket/Elements/SelectStatus,
+ Name => "Status",
+ TicketObj => $Ticket,
+ Default => $DefaultStatus &>
+ </&>
+ <&| /Elements/LabeledValue, Label => loc('Subject'), LabelCols => 2, ValueCols => 8 &>
+ <input class="form-control" type="text" name="UpdateSubject" size="60" value="<% $ARGS{UpdateSubject} || $Ticket->Subject || '' %>" />
+ </&>
+ <& /Elements/EditCustomFields, Object => $Ticket &>
</div>
<div class="form-group">
% if (exists $ARGS{UpdateContent}) {
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 7999f544db..eaa40352e1 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -154,29 +154,18 @@
<div>
% $m->callback(CallbackName => 'BeforeRequestors', QueueObj => $QueueObj, ARGSRef => \%ARGS);
-<div class="form-row">
-<div class="label col-2"><&|/l&>Requestors</&>:</div>
-<div class="value col-9">
+<&| /Elements/LabeledValue, Label => loc('Requestors'), LabelCols => 2, ValueCols => 9 &>
<& /Elements/EmailInput, Name => 'Requestors', Size => undef, Default => $ARGS{Requestors} // $session{CurrentUser}->EmailAddress, AutocompleteMultiple => 1, AutocompleteType => 'Principals' &>
% $m->callback( CallbackName => 'AfterRequestors', QueueObj => $QueueObj, ARGSRef => \%ARGS );
-</div>
-</div>
+</&>
-<div class="form-row">
-<div class="label col-2">
-<span class="prev-icon-helper"><&|/l&>Cc</&>:</span>\
-<span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<&|/l&>Sends a copy of this update to the provided users or groups. These people will receive future updates.</&>"></span>
-</div>
-<div class="value col-9"><& /Elements/EmailInput, Name => 'Cc', Size => undef, Default => $ARGS{Cc}, AutocompleteMultiple => 1, AutocompleteType => 'Principals' &></div>
-</div>
+<&| /Elements/LabeledValue, Label => loc('Cc'), LabelTooltip => loc('Sends a copy of this update to the provided users or groups. These people will receive future updates.'), LabelCols => 2, ValueCols => 9 &>
+ <& /Elements/EmailInput, Name => 'Cc', Size => undef, Default => $ARGS{Cc}, AutocompleteMultiple => 1, AutocompleteType => 'Principals' &>
+</&>
-<div class="form-row">
-<div class="label col-2">
-<span class="prev-icon-helper"><&|/l&>Admin Cc</&>:</span>\
-<span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<&|/l&>Sends a copy of this update to the provided users or groups. These people will receive future updates.</&>"></span>
-</div>
-<div class="value col-9"><& /Elements/EmailInput, Name => 'AdminCc', Size => undef, Default => $ARGS{AdminCc}, AutocompleteMultiple => 1, AutocompleteType => 'Principals' &></div>
-</div>
+<&| /Elements/LabeledValue, Label => loc('Admin Cc'), LabelTooltip => loc('Sends a copy of this update to the provided users or groups. These people will receive future updates.'), LabelCols => 2, ValueCols => 9 &>
+ <& /Elements/EmailInput, Name => 'AdminCc', Size => undef, Default => $ARGS{AdminCc}, AutocompleteMultiple => 1, AutocompleteType => 'Principals' &>
+</&>
% my $roles = $QueueObj->CustomRoles;
% $roles->LimitToMultipleValue;
@@ -207,21 +196,15 @@
ForCreation => 1,
&>
-<div class="form-row">
-<div class="form-group label col-2">
-<&|/l&>Subject</&>:
-</div>
-<div class="form-group value col-9">
+<&| /Elements/LabeledValue, Label => loc('Subject'), LabelClass => 'form-group label', ValueClass => 'form-group value', LabelCols => 2, ValueCols => 9 &>
<input class="form-control" type="text" name="Subject" maxsize="200" value="<%$ARGS{Subject} || ''%>" />
% $m->callback( %ARGS, CallbackName => 'AfterSubject' );
-</div>
-</div>
+</&>
% if ( $gnupg_widget ) {
-<div class="form-row">
- <div class="label col-2 empty"></div>
- <div class="value col-9"><& /Elements/Crypt/SignEncryptWidget, self => $gnupg_widget, QueueObj => $QueueObj &></div>
-</div>
+<&| /Elements/LabeledValue, Label => '', LabelClass => 'label empty', LabelCols => 2, ValueCols => 9 &>
+ <& /Elements/Crypt/SignEncryptWidget, self => $gnupg_widget, QueueObj => $QueueObj &>
+</&>
% }
% if ( RT->Config->Get('ArticleOnTicketCreate')) {
<& /Articles/Elements/BeforeMessageBox, %ARGS, QueueObj => $QueueObj &>
diff --git a/share/html/Ticket/Elements/AddAttachments b/share/html/Ticket/Elements/AddAttachments
index 112b1bfb12..fd1f6b70b8 100644
--- a/share/html/Ticket/Elements/AddAttachments
+++ b/share/html/Ticket/Elements/AddAttachments
@@ -46,8 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
% if ( $attachments ) {
-<div class="form-row attachment"><div class="label col-3"><&|/l&>Attached file</&>:</div>
-<div class="value col-9">
+<&| /Elements/LabeledValue, Class => 'attachment', Label => loc('Attached file') &>
% foreach my $attach_name ( sort keys %$attachments ) {
<div>
<label for="DeleteAttach-<%$attach_name%>"><% $attach_name %></label>
@@ -55,8 +54,7 @@
(<a href="#" class="delete-attach" data-name="<%$attach_name%>"><&|/l&>Delete</&></a>)
</div>
% } # end of foreach
-</div>
-</div>
+</&>
% } # end of if
<div class="form-group">
@@ -178,9 +176,7 @@ jQuery( function() {
</div>
</div>
% if ($HasExisting) {
-<div class="form-row">
- <div class="label col-3"><&|/l&>Include attachments</&>:</div>
- <div class="value col-9" id="reuse-attachments">
+<&| /Elements/LabeledValue, Label => loc('Include attachments'), ValueId => 'reuse-attachments' &>
<& /Ticket/Elements/ShowAttachments,
Ticket => $TicketObj,
Selectable => 1,
@@ -188,8 +184,7 @@ jQuery( function() {
Checked => \@AttachExisting,
Count => RT->Config->Get('AttachmentListCount'),
&>
- </div>
-</div>
+</&>
% }
% $m->callback( %ARGS, CallbackName => 'End' );
<%ARGS>
diff --git a/share/html/Ticket/Elements/ShowDates b/share/html/Ticket/Elements/ShowDates
index 6ae1683bb9..9a1ac20d24 100644
--- a/share/html/Ticket/Elements/ShowDates
+++ b/share/html/Ticket/Elements/ShowDates
@@ -70,32 +70,30 @@
</div>
% $m->callback( %ARGS, CallbackName => 'AfterTold', TicketObj => $Ticket );
- <div class="date form-row due<% $Ticket->DueObj->Unix ? q{} : q{ unset-field}%>">
- <div class="label col-3"><&|/l&>Due</&>:</div>\
+ <&| /Elements/LabeledValue, Class => 'date due' . ( $Ticket->DueObj->Unix ? q{} : q{ unset-field} ), Label => loc('Due'), ValueSpanClass => 'current-value' &>
+
% my $due = $Ticket->DueObj;
% if ( $due && $due->IsSet && $due->Diff < 0 && $Ticket->QueueObj->IsActiveStatus($Ticket->Status) ) {
- <div class="value col-9"><span class="current-value"><span class="overdue"><% $due->AsString %></span></div></span>
+ <span class="overdue"><% $due->AsString %></span>
% } else {
- <div class="value col-9"><span class="current-value"><% $due->AsString %></span></div>
+ <% $due->AsString %>
% }
- </div>
+ </&>
% $m->callback( %ARGS, CallbackName => 'AfterDue', TicketObj => $Ticket );
- <div class="date form-row resolved<% $Ticket->ResolvedObj->Unix ? q{} : q{ unset-field}%>">
- <div class="label col-3"><&|/l&>Closed</&>:</div>\
- <div class="value col-9"><span class="current-value"><% $Ticket->ResolvedObj->AsString %></span></div>
- </div>
+ <&| /Elements/LabeledValue, Class => 'date resolved' . ( $Ticket->ResolvedObj->Unix ? q{} : q{ unset-field} ), Label => loc('Closed'), ValueSpanClass => 'current-value' &>
+ <% $Ticket->ResolvedObj->AsString %>
+ </&>
% $m->callback( %ARGS, CallbackName => 'AfterResolved', TicketObj => $Ticket );
- <div class="date form-row updated">
- <div class="label col-3"><&|/l&>Updated</&>:</div>\
+ <&| /Elements/LabeledValue, Class => 'date updated', Label => loc('Updated'), ValueSpanClass => 'current-value' &>
% my $UpdatedString = $Ticket->LastUpdated ? loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $m->scomp('/Elements/ShowUser', User => $Ticket->LastUpdatedByObj)) : loc("Never");
% if ($UpdatedLink) {
- <div class="value col-9"><span class="current-value"><a href="<% $UpdatedLink %>"><% $UpdatedString | n %></a></span></div>
+ <a href="<% $UpdatedLink %>"><% $UpdatedString | n %></a>
% } else {
- <div class="value col-9"><span class="current-value"><% $UpdatedString | n %></span></div>
+ <% $UpdatedString | n %>
% }
- </div>
+ </&>
% $m->callback( %ARGS, CallbackName => 'AfterUpdated', TicketObj => $Ticket );
<& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket, Grouping => 'Dates', Table => 0 &>
% $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket );
diff --git a/share/html/Ticket/Elements/ShowPeople b/share/html/Ticket/Elements/ShowPeople
index 42e9740b7a..ac1e045246 100644
--- a/share/html/Ticket/Elements/ShowPeople
+++ b/share/html/Ticket/Elements/ShowPeople
@@ -46,14 +46,12 @@
%#
%# END BPS TAGGED BLOCK }}}
<div>
- <div class="form-row owner">
- <div class="label col-3"><&|/l&>Owner</&>:</div>
+ <&| /Elements/LabeledValue, Class => 'owner', Label => loc('Owner'), ValueSpanClass => 'current-value' &>
% my $owner = $Ticket->OwnerObj;
- <div class="value col-9"><span class="current-value"><& /Elements/ShowUser, User => $owner, Ticket => $Ticket &>
+ <& /Elements/ShowUser, User => $owner, Ticket => $Ticket &>
<& /Elements/ShowUserEmailFrequency, User => $owner, Ticket => $Ticket &>
% $m->callback( User => $owner, Ticket => $Ticket, %ARGS, CallbackName => 'AboutThisUser' );
- </span></div>
- </div>
+ </&>
% my $single_roles = $Ticket->QueueObj->CustomRoles;
% $single_roles->LimitToSingleValue;
@@ -71,24 +69,20 @@
%# so fall back to nobody
% my $user = $users->First || RT->Nobody;
- <div class="form-row">
- <div class="label col-3"><% $role->Name %>:</div>
- <div class="value col-9"><span class="current-value"><& /Elements/ShowUser, User => $user, Ticket => $Ticket &></span></div>
- </div>
+ <&| /Elements/LabeledValue, Label => $role->Name, ValueSpanClass => 'current-value' &>
+ <& /Elements/ShowUser, User => $user, Ticket => $Ticket &>
+ </&>
% }
- <div class="form-row requestors">
- <div class="label col-3"><&|/l&>Requestors</&>:</div>
- <div class="value col-9"><span class="current-value"><& ShowGroupMembers, Group => $Ticket->Requestors, Ticket => $Ticket &></span></div>
- </div>
- <div class="form-row cc<% $Ticket->Cc->MembersObj->Count ? q{} : q{ unset-field}%>">
- <div class="label col-3"><&|/l&>Cc</&>:</div>
- <div class="value col-9"><span class="current-value"><& ShowGroupMembers, Group => $Ticket->Cc, Ticket => $Ticket &></span></div>
- </div>
- <div class="form-row admincc<% $Ticket->AdminCc->MembersObj->Count ? q{} : q{ unset-field}%>">
- <div class="label col-3"><&|/l&>AdminCc</&>:</div>
- <div class="value col-9"><span class="current-value"><& ShowGroupMembers, Group => $Ticket->AdminCc, Ticket => $Ticket &></span></div>
- </div>
+ <&| /Elements/LabeledValue, Class => 'requestors', Label => loc('Requestors'), ValueSpanClass => 'current-value' &>
+ <& ShowGroupMembers, Group => $Ticket->Requestors, Ticket => $Ticket &>
+ </&>
+ <&| /Elements/LabeledValue, Class => 'cc' . ( $Ticket->Cc->MembersObj->Count ? q{} : q{ unset-field} ), Label => loc('Cc'), ValueSpanClass => 'current-value' &>
+ <& ShowGroupMembers, Group => $Ticket->Cc, Ticket => $Ticket &>
+ </&>
+ <&| /Elements/LabeledValue, Class => 'admincc' . ( $Ticket->AdminCc->MembersObj->Count ? q{} : q{ unset-field} ), Label => loc('AdminCc'), ValueSpanClass => 'current-value' &>
+ <& ShowGroupMembers, Group => $Ticket->AdminCc, Ticket => $Ticket &>
+ </&>
% my $multi_roles = $Ticket->QueueObj->CustomRoles;
% $multi_roles->LimitToMultipleValue;
@@ -97,10 +91,9 @@
% $m->callback( CustomRoles => $multi_roles, SingleRoles => 0, Ticket => $Ticket, %ARGS, CallbackName => 'ModifyCustomRoles' );
% while (my $role = $multi_roles->Next) {
- <div class="form-row">
- <div class="label col-3"><% $role->Name %>:</div>
- <div class="value col-9"><span class="current-value"><& ShowGroupMembers, Group => $Ticket->RoleGroup($role->GroupType), Ticket => $Ticket &></span></div>
- </div>
+ <&| /Elements/LabeledValue, Label => $role->Name, ValueSpanClass => 'current-value' &>
+ <& ShowGroupMembers, Group => $Ticket->RoleGroup($role->GroupType), Ticket => $Ticket &>
+ </&>
% }
<& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket, Grouping => 'People', Table => 0 &>
diff --git a/share/html/Ticket/Elements/UpdateCc b/share/html/Ticket/Elements/UpdateCc
index 83a73272a8..ae7faa3651 100644
--- a/share/html/Ticket/Elements/UpdateCc
+++ b/share/html/Ticket/Elements/UpdateCc
@@ -47,19 +47,12 @@
%# END BPS TAGGED BLOCK }}}
% $m->callback(CallbackName => 'BeforeCc', ARGSRef => \%ARGS, Ticket => $TicketObj, one_time_Ccs => \@one_time_Ccs, txn_addresses => \%txn_addresses);
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>One-time Cc</&>:
- </div>
- <div class="value col-9">
+<&| /Elements/LabeledValue, Label => loc('One-time Cc'), LabelCols => 2, ValueCols => 9 &>
<& /Elements/EmailInput, Name => 'UpdateCc', Size => undef, Default => $ARGS{UpdateCc}, AutocompleteMultiple => 1, Options => \@one_time_Ccs &>
<input type="hidden" id="UpdateIgnoreAddressCheckboxes" name="UpdateIgnoreAddressCheckboxes" value="<% $ARGS{UpdateIgnoreAddressCheckboxes} || 0 %>">
- </div>
-</div>
+</&>
-<div class="form-row mt-0">
- <div class="label col-2"></div>
- <div class="value col-9">
+<&| /Elements/LabeledValue, Class => 'mt-0', Label => '', LabelCols => 2, ValueCols => 9 &>
<div class="form-row">
%if (scalar @one_time_Ccs) {
% if ($hide_cc_suggestions) {
@@ -98,21 +91,13 @@
</div>
%}
</div>
- </div>
-</div>
+</&>
-<div class="form-row">
- <div class="label col-2">
- <&|/l&>One-time Bcc</&>:
- </div>
- <div class="value col-9">
+<&| /Elements/LabeledValue, Label => loc('One-time Bcc'), LabelCols => 2, ValueCols => 9 &>
<& /Elements/EmailInput, Name => 'UpdateBcc', Size => undef, Default => $ARGS{UpdateBcc}, AutocompleteMultiple => 1, Options => \@one_time_Ccs &>
- </div>
-</div>
+</&>
-<div class="form-row mt-0">
- <div class="label col-2"></div>
- <div class="value col-9">
+<&| /Elements/LabeledValue, Class => 'mt-0', Label => '', LabelCols => 2, ValueCols => 9 &>
<div class="form-row">
%if (scalar @one_time_Ccs) {
% if ($hide_cc_suggestions) {
@@ -163,8 +148,7 @@ jQuery(function() {
</script>
%}
</div>
- </div>
-</div>
+</&>
<%args>
$TicketObj
</%args>
diff --git a/share/html/Ticket/Forward.html b/share/html/Ticket/Forward.html
index 24ca5efa13..d762037be1 100644
--- a/share/html/Ticket/Forward.html
+++ b/share/html/Ticket/Forward.html
@@ -60,41 +60,33 @@
<&|/Widgets/TitleBox, title => loc('Message'), class => 'messagedetails' &>
<div>
- <div class="form-row">
- <div class="label col-2"><&|/l&>From</&>:</div>
- <div class="value col-9"><% $from %></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('From'), LabelCols => 2, ValueCols => 9, ValueSpanClass => 'current-value' &>
+ <% $from %>
+ </&>
- <div class="form-row">
- <div class="label col-2"><&|/l&>Subject</&>:</div>
- <div class="value col-9"><input class="form-control" type="text" name="Subject" value="<% $ARGS{'Subject'} || $subject %>" /></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('Subject'), LabelCols => 2, ValueCols => 9 &>
+ <input class="form-control" type="text" name="Subject" value="<% $ARGS{'Subject'} || $subject %>" />
+ </&>
- <div class="form-row">
- <div class="label col-2"><&|/l&>To</&>:</div>
- <div class="value col-9"><& /Elements/EmailInput, Name => "To", AutocompleteMultiple => 1, Default => $ARGS{'To'} &></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('To'), LabelCols => 2, ValueCols => 9 &>
+ <& /Elements/EmailInput, Name => "To", AutocompleteMultiple => 1, Default => $ARGS{'To'} &>
+ </&>
- <div class="form-row">
- <div class="label col-2"><&|/l&>Cc</&>:</div>
- <div class="value col-9"><& /Elements/EmailInput, Name => "Cc", AutocompleteMultiple => 1, Default => $ARGS{'Cc'} &></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('Cc'), LabelCols => 2, ValueCols => 9 &>
+ <& /Elements/EmailInput, Name => "Cc", AutocompleteMultiple => 1, Default => $ARGS{'Cc'} &>
+ </&>
- <div class="form-row">
- <div class="label col-2"><&|/l&>Bcc</&>:</div>
- <div class="value col-9"><& /Elements/EmailInput, Name => "Bcc", AutocompleteMultiple => 1, Default => $ARGS{'Bcc'} &></div>
- </div>
+ <&| /Elements/LabeledValue, Label => loc('Bcc'), LabelCols => 2, ValueCols => 9 &>
+ <& /Elements/EmailInput, Name => "Bcc", AutocompleteMultiple => 1, Default => $ARGS{'Bcc'} &>
+ </&>
% if ( $gnupg_widget ) {
- <div class="form-row">
- <span class="label col-2 empty"> </span>
- <div class="value col-9">
+ <&| /Elements/LabeledValue, Label => '', LabelClass => 'label empty', LabelCols => 2, ValueCols => 9 &>
<& /Elements/Crypt/SignEncryptWidget,
self => $gnupg_widget,
TicketObj => $TicketObj,
&>
- </div>
- </div>
+ </&>
% }
<div class="form-group">
diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index bd7ebb080e..cbf759051a 100644
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -86,9 +86,7 @@
<&| /Widgets/TitleBox, title => loc('Update ticket'), class => 'messagedetails' &>
<div>
- <div class="form-row input-row">
- <div class="label col-2"><&|/l&>Update Type</&>:</div>
- <div class="value col-9">
+ <&| /Elements/LabeledValue, Class => 'input-row', Label => loc('Update Type'), LabelCols => 2, ValueCols => 9 &>
<select name="UpdateType" id="UpdateType" class="form-control selectpicker">
% if ($CanComment) {
<option value="private" ><&|/l&>Comments (Not sent to requestors)</&></option>
@@ -98,14 +96,11 @@
% }
</select>
% $m->callback( %ARGS, CallbackName => 'AfterUpdateType' );
- </div>
- </div>
- <div class="form-row input-row">
- <div class="label col-2"><&|/l&>Subject</&>:</div>
- <div class="value col-9"><input class="form-control" type="text" name="UpdateSubject" value="<%$Ticket->Subject%>" />
+ </&>
+ <&| /Elements/LabeledValue, Class => 'input-row', Label => loc('Subject'), LabelCols => 2, ValueCols => 9 &>
+ <input class="form-control" type="text" name="UpdateSubject" value="<%$Ticket->Subject%>" />
% $m->callback( %ARGS, CallbackName => 'AfterSubject' );
- </div>
- </div>
+ </&>
<& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $Ticket, LabelCols => 2 &>
diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 680aedcf24..5f35395be9 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -79,8 +79,8 @@
</&>
% }
-<div class="form-row"><div class="label col-3"><&|/l&>Update Type</&>:</div>
-<div class="value col-9"><select class="form-control selectpicker" name="UpdateType" id="UpdateType">
+<&| /Elements/LabeledValue, Label => loc('Update Type') &>
+<select class="form-control selectpicker" name="UpdateType" id="UpdateType">
% if ($CanComment) {
<option value="private" <% ($ARGS{'UpdateType'} && $ARGS{'UpdateType'} eq "private") ? qq[ selected="selected"] : !$ARGS{'UpdateType'}&&$CommentDefault |n %>><&|/l&>Comments (Not sent to requestors)</&></option>
% }
@@ -90,7 +90,7 @@
</select>
% $m->callback( %ARGS, CallbackName => 'AfterUpdateType' );
-</div></div>
+</&>
<& /Ticket/Elements/EditBasics,
TicketObj => $TicketObj,
@@ -152,27 +152,19 @@
<& /Ticket/Elements/UpdateCc, %ARGS, TicketObj => $TicketObj &>
% if ( $gnupg_widget ) {
-<div class="form-row">
- <div class="label col-2 empty"></div>
- <div class="value col-9">
+<&| /Elements/LabeledValue, Label => '', LabelClass => 'label empty', LabelCols => 2, ValueCols => 9 &>
<& /Elements/Crypt/SignEncryptWidget,
self => $gnupg_widget,
TicketObj => $TicketObj,
&>
- </div>
-</div>
+</&>
% }
% $m->callback( %ARGS, CallbackName => 'AfterGnuPG' );
-<div class="form-row">
- <div class="form-group label col-2">
- <&|/l&>Subject</&>:
- </div>
- <div class="value col-9">
+<&| /Elements/LabeledValue, Label => loc('Subject'), LabelClass => 'form-group label', LabelCols => 2, ValueCols => 9 &>
<input class="form-control" type="text" name="UpdateSubject" value="<% $ARGS{UpdateSubject} || $TicketObj->Subject || '' %>" />
% $m->callback( %ARGS, CallbackName => 'AfterSubject' );
- </div>
-</div>
+</&>
<& /Articles/Elements/BeforeMessageBox, %ARGS &>
<div class="form-group">
<div class="messagebox-container action-<% $type %>">
commit 8c3b842070fd75583098d8af88a9fe285f29371a
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 6 21:48:32 2022 +0800
Re-add the missing Creator row for article display
It was removed during LabeledValue refactor by accident.
diff --git a/share/html/Articles/Article/Display.html b/share/html/Articles/Article/Display.html
index 8b4a96d4a6..f15534ab47 100644
--- a/share/html/Articles/Article/Display.html
+++ b/share/html/Articles/Article/Display.html
@@ -53,7 +53,10 @@
<& /Elements/LabeledValue, Label => loc('Summary'), ValueSpanClass => 'current-value', Value => $article->Summary &>
<& /Elements/LabeledValue, Label => loc('Sort Order'), ValueSpanClass => 'current-value', Value => $article->SortOrder &>
<& /Elements/LabeledValue, Label => loc('Class'), ValueSpanClass => 'current-value', Value => $article->ClassObj->Name &>
-<& /Elements/LabeledValue, Label => loc('Creator'), ValueSpanClass => 'current-value', Value => $article->CreatedObj->AsString &>
+<&| /Elements/LabeledValue, Label => loc('Creator'), ValueSpanClass => 'current-value' &>
+ <& /Elements/ShowUser, User => $article->CreatorObj &>
+</&>
+<& /Elements/LabeledValue, Label => loc('Created'), ValueSpanClass => 'current-value', Value => $article->CreatedObj->AsString &>
<& /Elements/LabeledValue, Label => loc('Updated'), ValueSpanClass => 'current-value', Value => $article->LastUpdatedObj->AsString &>
</&>
commit 5b24f68d64fab3f6a1aee440a2f6d9ed99db7864
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 6 21:42:14 2022 +0800
Make "Merge into" row take half width on ticket ModifyLinks page
Initial LabeledValue refactor dropped cols customization, which caused
the row to take fullwidth on ModifyLinks page, which was too wide. This
commit reverts back to the previous layout.
diff --git a/share/html/Ticket/Elements/EditMerge b/share/html/Ticket/Elements/EditMerge
index 4a2348d62f..270da6ff20 100644
--- a/share/html/Ticket/Elements/EditMerge
+++ b/share/html/Ticket/Elements/EditMerge
@@ -48,7 +48,7 @@
<div class='ticket-merge-text <% $MergeTextClass %>'>
<&|/l&>Warning: merging is a non-reversible action! Enter a single ticket number to be merged into.</&>
</div>
-<&| /Elements/LabeledValue, Label => loc('Merge into') &>
+<&| /Elements/LabeledValue, Label => loc('Merge into'), LabelCols => $LabelCols, ValueCols => $ValueCols &>
<input type="text" class="form-control" name="<% $Name %>" value="<% $Default || '' %>" data-autocomplete="Tickets" data-autocomplete-exclude="<% join( ' ', @excludes) || '' %>" />
</&>
@@ -73,4 +73,6 @@ $Tickets => undef
$Name => ''
$Default => ''
$MergeTextClass => 'ticket-merge-position'
+$LabelCols => 2
+$ValueCols => 4
</%ARGS>
diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index 944cbf01ca..5685e19d15 100644
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -210,7 +210,7 @@ push @extra, (titleright_raw => $links_titleright) if $links_titleright;
<& /Elements/EditLinks, Object => $Ticket, TwoColumn => 0 &>
<h3><&|/l&>Merge</&></h3>
- <& /Ticket/Elements/EditMerge, Ticket => $Ticket, MergeTextClass => '', %ARGS &>
+ <& /Ticket/Elements/EditMerge, Ticket => $Ticket, LabelCols => 3, ValueCols => 9, MergeTextClass => '', %ARGS &>
<div class="form-row">
<div class="col-12 text-right">
commit 23cdfc42067c3395e94df39a6a3b41070d248686
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 6 21:23:27 2022 +0800
Add back the missing current-value span
Otherwise, rows in asset widget on ticket create page would have
alignment issues.
diff --git a/share/html/Elements/ShowRecord b/share/html/Elements/ShowRecord
index 594367226c..976ab525a3 100644
--- a/share/html/Elements/ShowRecord
+++ b/share/html/Elements/ShowRecord
@@ -81,6 +81,7 @@ for my $column (@columns) {
</%perl>
<&| /Elements/LabeledValue,
RawLabel => loc($title),
+ ValueSpanClass => 'current-value',
Class => 'record-field '.
( $Class ? CSSClass("$Class-field")." " : "" ) .
CSSClass($fetch_columnmap->($attr,'attribute',[$attr],'no_escape'))
commit 9c37cb1229d28b3512b3a25f75c414712fbecc21
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 6 18:21:33 2022 +0800
Use LabledValue to generate current-value spans
diff --git a/share/html/Articles/Article/Elements/EditBasics b/share/html/Articles/Article/Elements/EditBasics
index 4f5046a092..53624d62b2 100644
--- a/share/html/Articles/Article/Elements/EditBasics
+++ b/share/html/Articles/Article/Elements/EditBasics
@@ -65,14 +65,14 @@
</&>
% if ($ARGS{'id'} ne 'new') {
- <&| /Elements/LabeledValue, Label => loc('Creator') &>
- <span class="current-value form-control"><& /Elements/ShowUser, User => $ArticleObj->CreatorObj &></span>
+ <&| /Elements/LabeledValue, Label => loc('Creator'), ValueSpanClass => 'current-value from-control' &>
+ <& /Elements/ShowUser, User => $ArticleObj->CreatorObj &>
</&>
- <&| /Elements/LabeledValue, Label => loc('Created') &>
- <span class="current-value form-control"><%$ArticleObj->CreatedObj->AsString%></span>
+ <&| /Elements/LabeledValue, Label => loc('Created'), ValueSpanClass => 'current-value from-control' &>
+ <%$ArticleObj->CreatedObj->AsString%>
</&>
- <&| /Elements/LabeledValue, Label => loc('Updated') &>
- <span class="current-value form-control"><%$ArticleObj->LastUpdatedObj->AsString%></span>
+ <&| /Elements/LabeledValue, Label => loc('Updated'), ValueSpanClass => 'current-value from-control' &>
+ <%$ArticleObj->LastUpdatedObj->AsString%>
</&>
% }
% if ($ARGS{'id'} eq 'new' || $ArticleObj->CurrentUserHasRight('DisableArticle')) {
commit 627ed05c8410b5163034d0666cc226ffead04354
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 6 17:21:08 2022 +0800
Remove unnecessary current-value span
The current-value span is used in forms to align the label/value, so
it's not needed when rows are not in forms.
diff --git a/share/html/Admin/Actions/Elements/ShowBasics b/share/html/Admin/Actions/Elements/ShowBasics
index 75bbf76607..75a30e7add 100644
--- a/share/html/Admin/Actions/Elements/ShowBasics
+++ b/share/html/Admin/Actions/Elements/ShowBasics
@@ -46,16 +46,16 @@
%#
%# END BPS TAGGED BLOCK }}}
<&| /Elements/LabeledValue, Label => loc("Name") &>
- <span class="current-value"><% $ARGS{"Name"} || $Action->Name || '' %></span>
+ <% $ARGS{"Name"} || $Action->Name || '' %>
</&>
<&| /Elements/LabeledValue, Label => loc("Description") &>
- <span class="current-value"><% $ARGS{"Description"} || $Action->Description || '' %></span>
+ <% $ARGS{"Description"} || $Action->Description || '' %>
</&>
<&| /Elements/LabeledValue, Label => loc("Action Module") &>
- <span class="current-value"><% $ARGS{"ExecModule"} || $Action->ExecModule || ''%></span>
+ <% $ARGS{"ExecModule"} || $Action->ExecModule || ''%>
</&>
<&| /Elements/LabeledValue, Label => loc("Parameters to Pass") &>
- <span class="current-value"><% $ARGS{"Argument"} || $Action->Argument || '' %></span>
+ <% $ARGS{"Argument"} || $Action->Argument || '' %>
</&>
<%ARGS>
commit ef5abde64d8d4d7ec281d17d039afe082351532f
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 6 16:22:39 2022 +0800
Fix layout of ticket graph page
The LabeledValue refactor dropped a couple of div opening tags and a css
class by accident, this commit adds them back.
diff --git a/share/html/Ticket/Graphs/Elements/EditGraphProperties b/share/html/Ticket/Graphs/Elements/EditGraphProperties
index f15b7dd787..794240a3e6 100644
--- a/share/html/Ticket/Graphs/Elements/EditGraphProperties
+++ b/share/html/Ticket/Graphs/Elements/EditGraphProperties
@@ -73,8 +73,8 @@
</select>
</&>
- <&| /Elements/LabeledValue, Label => loc('Show as well') &>
-
+ <&| /Elements/LabeledValue, Label => loc('Show as well'), ValueSpanClass => 'current-value' &>
+ <div class="form-row">
% foreach my $type ( @link_types ) {
% my $checked = '';
% $checked = 'checked="checked"' if grep $type eq $_, @ShowLinks;
@@ -172,13 +172,14 @@ my $id = "graph-properties-box-$Level";
my $class = '';
$class = 'class="hidden"' if $Level != 1 && !@Default;
</%INIT>
- <&| /Elements/LabeledValue, Label => loc('Show Tickets Properties on [_1] level', $Level) &>
+ <&| /Elements/LabeledValue, Label => loc('Show Tickets Properties on [_1] level', $Level), ValueSpanClass => 'current-value' &>
(<small><a href="#" onclick="hideshow(<% $id |n,j%>); return false;"><% loc('open/close') %></a></small>):
</&>
<div id="<% $id %>" <% $class |n %>>
% while ( my ($group, $list) = (splice @Available, 0, 2) ) {
- <&| /Elements/LabeledValue, Label => loc($group) &>
+ <&| /Elements/LabeledValue, Label => loc($group), ValueSpanClass => 'current-value' &>
+ <div class="form-row">
% foreach my $prop ( @$list ) {
% my $checked = '';
% $checked = 'checked="checked"' if grep $_ eq $prop, @Default;
commit 4f2550a99fd75d0b8caf2b791d3c36e30ff672f7
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Oct 4 22:15:42 2022 +0800
Drop an extra form-row wrapper as LabeledValue already has one
diff --git a/share/html/Asset/Search/Bulk.html b/share/html/Asset/Search/Bulk.html
index f1331b3af2..97fc0da301 100644
--- a/share/html/Asset/Search/Bulk.html
+++ b/share/html/Asset/Search/Bulk.html
@@ -90,12 +90,10 @@
<&| /Widgets/TitleBox, title => loc("Basics"), class => "asset-basics asset-bulk-basics", title_class => "inverse" &>
<div class="form-row">
<div class="col-6">
- <div class="form-row">
- <&| /Elements/LabeledValue, Label => loc('Catalog') &>
- <& /Asset/Elements/SelectCatalog, Name => 'UpdateCatalog', UpdateSession => 0, ShowNullOption => 1 &>
- </&>
-
-
+ <&| /Elements/LabeledValue, Label => loc('Catalog') &>
+ <& /Asset/Elements/SelectCatalog, Name => 'UpdateCatalog', UpdateSession => 0, ShowNullOption => 1 &>
+ </&>
+ </div>
<div class="col-6">
<&| /Elements/LabeledValue, Label => loc('Name') &>
<input class="form-control" type="text" name="UpdateName" value="<% $ARGS{'Name'}||'' %>" size="40">
commit 9d27450f7712b5867a92810581dd5cd9dcb7a1fa
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Oct 1 05:30:29 2022 +0800
Fix alignment and width of AddWatchers
The LabeledValue refactor added extra css classes there and dropped cols
customization, which caused the issue. This commit fixes both to make
AddWatchers layout the same as before.
diff --git a/share/html/Asset/Elements/AddCatalogPeople b/share/html/Asset/Elements/AddCatalogPeople
index 476684017c..bb096863cb 100644
--- a/share/html/Asset/Elements/AddCatalogPeople
+++ b/share/html/Asset/Elements/AddCatalogPeople
@@ -50,7 +50,10 @@ $Object
</%args>
<div class="add-user">
<h3><&|/l&>Add a person</&></h3>
- <&| /Elements/LabeledValue, RawLabel => $m->scomp('SelectRoleType', Object => $Object, Name => "AddUserRoleMember-Role") &>
+ <&| /Elements/LabeledValue,
+ RawLabel => $m->scomp('SelectRoleType', Object => $Object, Name => "AddUserRoleMember-Role"),
+ LabelClass => '', ValueClass => ''
+ &>
<input type="text" name="AddUserRoleMember"
data-autocomplete="Users"
data-autocomplete-return="Name"
@@ -62,7 +65,7 @@ $Object
<div class="add-group">
<h3><&|/l&>Add a group</&></h3>
- <&| /Elements/LabeledValue, RawLabel => $m->scomp('SelectRoleType', Object => $Object, Name => "AddGroupRoleMember-Role") &>
+ <&| /Elements/LabeledValue, RawLabel => $m->scomp('SelectRoleType', Object => $Object, Name => "AddGroupRoleMember-Role"), LabelClass => '', ValueClass => '' &>
<input type="text" name="AddGroupRoleMember"
data-autocomplete="Groups"
data-autocomplete-return="Name"
diff --git a/share/html/Elements/LabeledValue b/share/html/Elements/LabeledValue
index f711e6e6c6..3603a76742 100644
--- a/share/html/Elements/LabeledValue
+++ b/share/html/Elements/LabeledValue
@@ -54,6 +54,10 @@ $LabelSpanClass => undef
$RawLabel => undef
$RawValue => undef
$LabelTooltip => undef
+$LabelClass => 'label'
+$ValueClass => 'value'
+$LabelCols => 3
+$ValueCols => 9
</%args>
<%init>
if ( !defined($Value) && !defined($RawValue) && $m->content) {
@@ -62,7 +66,7 @@ if ( !defined($Value) && !defined($RawValue) && $m->content) {
</%init>
<div class="<% $Class %> form-row">
- <div class="label col-3">\
+ <div class="<% $LabelClass %> col-<% $LabelCols %>">\
<%perl>
if ($LabelSpanClass) {
$m->out('<span class="'.$m->interp->apply_escapes($LabelSpanClass,"h").'">');
@@ -80,7 +84,7 @@ if ( !defined($Value) && !defined($RawValue) && $m->content) {
$m->out('<span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="'. $m->interp->apply_escapes($LabelTooltip, "h").'"></span>');
}
$m->out('</div>');
- $m->out('<div class="value col-9">');
+ $m->out(qq{<div class="$ValueClass col-$ValueCols">});
if ($ValueSpanClass) {
$m->out('<span class="'.$m->interp->apply_escapes($ValueSpanClass,"h").'">');
}
diff --git a/share/html/Ticket/Elements/AddWatchers b/share/html/Ticket/Elements/AddWatchers
index 8bc64a974f..a319d46bdd 100644
--- a/share/html/Ticket/Elements/AddWatchers
+++ b/share/html/Ticket/Elements/AddWatchers
@@ -59,7 +59,10 @@
<&| /Elements/LabeledValue, RawLabel => $m->scomp("/Elements/SelectWatcherType",
Name => "Ticket-AddWatcher-Principal-". $u->PrincipalId,
Queue => $Ticket->QueueObj),
- ValueSpanClass => "current-value"
+ ValueSpanClass => "current-value",
+ LabelClass => '',
+ ValueClass => '',
+ ValueCols => 6,
&>
<& '/Elements/ShowUser', User => $u, style=>'verbose' &>
</&>
@@ -72,28 +75,32 @@
<&| /Elements/LabeledValue, RawLabel => $m->scomp("/Elements/SelectWatcherType",
Name => "Ticket-AddWatcher-Principal-".$g->PrincipalId,
Queue => $Ticket->QueueObj),
- ValueSpanClass => "current-value"
+ ValueSpanClass => "current-value",
+ LabelClass => '',
+ ValueClass => '',
+ ValueCols => 6,
&>
<%$g->Name%> (<%$g->Description%>)
</&>
% }
% }
- <& /Elements/LabeledValue, Label => loc("Type"), Value => loc("User or Group") &>
+ <& /Elements/LabeledValue, Label => loc("Type"), LabelClass => '', Value => loc("User or Group"), ValueClass => '', ValueCols => 6 &>
% my $counter = 4;
% for my $email (@extras) {
% $counter++;
<&| /Elements/LabeledValue,
RawLabel => $m->scomp('/Elements/SelectWatcherType', Name => "WatcherTypeEmail".$counter, Queue => $Ticket->QueueObj),
- ValueSpanClass => 'current-value' &>
+ ValueSpanClass => "current-value", LabelClass => '', ValueClass => '', ValueCols => 6 &>
<input type="hidden" name="WatcherAddressEmail<%$counter%>" value="<%$email->format%>">
<%$email->format%>
</&>
% }
% for my $i (1 .. 3) {
<&| /Elements/LabeledValue,
- RawLabel => $m->scomp('/Elements/SelectWatcherType', Name => "WatcherTypeEmail".$i, Queue => $Ticket->QueueObj) &>
+ RawLabel => $m->scomp('/Elements/SelectWatcherType', Name => "WatcherTypeEmail" . $i, Queue => $Ticket->QueueObj),
+ LabelClass => '', ValueClass => '', ValueCols => 6 &>
<& /Elements/EmailInput, Name => 'WatcherAddressEmail' . $i, Size => '20', AutocompleteType => 'Principals' &>
</&>
% }
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list