[Rt-commit] [rtir] 06/06: Better style some text buttons as buttons

Jesse Vincent jesse at bestpractical.com
Sun Mar 15 21:47:22 EDT 2015


This is an automated email from the git hooks/post-receive script.

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit 53d90294402684105331e02a9f3b4ab2ed24a9ba
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sun Mar 15 18:46:49 2015 -0700

    Better style some text buttons as buttons
---
 html/RTIR/Elements/ShowIncidents      | 8 ++++----
 lib/RT/IR/Test/Web.pm                 | 8 ++++----
 t/020-incident-and-investigation.t    | 2 +-
 t/constituency/propagation-inherit.t  | 2 +-
 t/constituency/propagation-reject.t   | 2 +-
 t/custom-fields/defaults-on-linking.t | 2 +-
 t/searches/menu.t                     | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index 5c7ca08..957ad53 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -57,10 +57,10 @@
 &>
 <div class="actions">
 % unless ( $action ) {
-<b><a href="<% RT::IR->HREFTo('Link/ToIncident/?id='. $id ) %>">[Link]</a></b>
-<b><a href="<% RT::IR->HREFTo('Incident/Create.html?Child='. $id ) %>">[New]</a></b>
+<a class="button" href="<% RT::IR->HREFTo('Link/ToIncident/?id='. $id ) %>">Link</a>
+<a class="button" href="<% RT::IR->HREFTo('Incident/Create.html?Child='. $id ) %>">New</a>
 % } elsif ( $action ne 'No' ) {
-<a href="<% RT::IR->HREFTo('Display.html?Action='. $action.'&id='. $id) %>">[<% loc( $action ) %>]</a>
+<a class="button" href="<% RT::IR->HREFTo('Display.html?Action='. $action.'&id='. $id) %>"><% loc( $action ) %></a>
 % }
 </div>
 </span>
@@ -98,7 +98,7 @@ my $query = RT::IR->RelevantIncidentsQuery( $Ticket );
 my $format = RT->Config->Get('RTIRSearchResultFormats')->{'ListIncidents'};
 my $dformat = $format;
 if ( $show_unlink ) {
-    $dformat .= ", '<a href=\"". RT::IR->HREFTo("Display.html?id=$id&DeleteLink--MemberOf-__id__=1").\">". loc('Unlink') ."</a>/TITLE:'";
+    $dformat .= ", '<a class=\"button\" href=\"". RT::IR->HREFTo("Display.html?id=$id&DeleteLink--MemberOf-__id__=1").\">". loc('Unlink') ."</a>/TITLE:'";
 }
 </%INIT>
 
diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 31c26e6..169de45 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -144,8 +144,8 @@ sub create_incident_for_ir {
     $self->display_ticket( $ir_id );
 
     # Select the "New" link from the Display page
-    $self->follow_link_ok({text => "[New]"}, "Followed 'New (Incident)' link")
-        or diag $self->content;
+    $self->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link")
+        or Test::More::diag $self->content;
 
     $self->form_number(3);
 
@@ -226,7 +226,7 @@ sub LinkChildToIncident {
     $self->display_ticket( $id);
 
     # Select the "Link" link from the Display page
-    $self->follow_link_ok({text => "[Link]", n => "1"}, "Followed 'Link(to Incident)' link");
+    $self->follow_link_ok({text => "Link", n => "1"}, "Followed 'Link(to Incident)' link");
 
     
     # Check that the desired incident occurs in the list of available incidents; if not, keep
@@ -260,7 +260,7 @@ sub create_incident_and_investigation {
     if($ir_id) {
         $self->display_ticket( $ir_id );
         # Select the "New" link from the Display page
-        $self->follow_link_ok({text => "[New]"}, "Followed 'New (Incident)' link");
+        $self->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link");
     }
     else 
     {
diff --git a/t/020-incident-and-investigation.t b/t/020-incident-and-investigation.t
index 2ca8c31..d4a7dc4 100755
--- a/t/020-incident-and-investigation.t
+++ b/t/020-incident-and-investigation.t
@@ -20,7 +20,7 @@ $agent->display_ticket( $ir);
 # of an empty correspondents field, while the above function tests if the creation succeeded,
 # and thus will fail if we get the result we want, and succeed if we don't!
 {
-    $agent->follow_link_ok({text => "[New]"}, "Followed 'New (Incident)' link");
+    $agent->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link");
     $agent->form_number(3);
     $agent->field('Subject', 'Incident for testing empty Investigation correspondent');
     $agent->field('InvestigationSubject', 'Investigation for testing empty Investigation correspondent');
diff --git a/t/constituency/propagation-inherit.t b/t/constituency/propagation-inherit.t
index 6f6b827..8e18a1d 100644
--- a/t/constituency/propagation-inherit.t
+++ b/t/constituency/propagation-inherit.t
@@ -61,7 +61,7 @@ diag "create an IR and check that we couldn't change constituency"
     is $ticket->FirstCustomFieldValue('Constituency'), 'GOVNET', 'correct value';
 
     # click [new] near 'incident', set another constituency and create
-    $agent->follow_link_ok({text => '[New]'}, "go to 'New Incident' page");
+    $agent->follow_link_ok({text => 'New'}, "go to 'New Incident' page");
     $agent->form_number(3);
     my $form = $agent->form_number(3);
     ok $form->find_input( $form->value('Constituency'), 'hidden'), 'constituency field is hidden';
diff --git a/t/constituency/propagation-reject.t b/t/constituency/propagation-reject.t
index fe37cf8..fbde32e 100644
--- a/t/constituency/propagation-reject.t
+++ b/t/constituency/propagation-reject.t
@@ -61,7 +61,7 @@ diag "create an IR and check that we couldn't change constituency"
     is $ticket->FirstCustomFieldValue('Constituency'), 'GOVNET', 'correct value';
 
     # click [new] near 'incident', set another constituency and create
-    $agent->follow_link_ok({text => '[New]'}, "go to 'New Incident' page");
+    $agent->follow_link_ok({text => 'New'}, "go to 'New Incident' page");
     my $form = $agent->form_number(3);
     ok $form->find_input( $form->value('Constituency'), 'hidden'), 'constituency field is hidden';
     $agent->click('CreateIncident');
diff --git a/t/custom-fields/defaults-on-linking.t b/t/custom-fields/defaults-on-linking.t
index a26af78..d6e23b6 100644
--- a/t/custom-fields/defaults-on-linking.t
+++ b/t/custom-fields/defaults-on-linking.t
@@ -53,7 +53,7 @@ my $agent = default_agent();
 
     {
         $agent->display_ticket( $ir_id );
-        $agent->follow_link_ok({text => "[New]"}, "Followed 'New (Incident)' link")
+        $agent->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link")
             or diag $agent->content;
         $agent->form_number(3);
 
diff --git a/t/searches/menu.t b/t/searches/menu.t
index 05985b4..6ff2448 100644
--- a/t/searches/menu.t
+++ b/t/searches/menu.t
@@ -67,7 +67,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
 {
 
     $m->display_ticket( $ticket{ir}[0] );
-    $m->follow_link_ok( { text => '[Link]' } );
+    $m->follow_link_ok( { text => 'Link' } );
     $m->title_is("Link Report #$ticket{ir}[0] to selected Incident");
 
     ok( !$m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$ticket{incident}[0]$} ),

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list