[Rt-commit] rt branch, 4.0/forbid-user-pref-in-squished-css, created. rt-4.0.4-234-g7fc9859

? sunnavy sunnavy at bestpractical.com
Tue Jan 24 17:25:27 EST 2012


The branch, 4.0/forbid-user-pref-in-squished-css has been created
        at  7fc9859bcb6d757167caa9a17f07d196595123a3 (commit)

- Log -----------------------------------------------------------------
commit 572992daf738204370b226446774a77da18bc8db
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jan 25 05:35:32 2012 +0800

    move css related to user pref "UseSideBySideLayout" out of squished css
    
    we can't use user preferences in squished css because it's cached.
    the first user to hit the empty squished CSS cache will cause
    every user thereafter to inherit their UseSideBySideLayout preference
    (until the child is reaped and the cache clear agains)
    
    see also #19302

diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index 4b0c2b8..0979510 100755
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -134,6 +134,16 @@ else {
     @css_files = "$style-squished-$key.css";
 }
 
+if ( RT->Config->Get("UseSideBySideLayout", $session{'CurrentUser'}) ) {
+    if ( $m->comp_exists("/NoAuth/css/$style/ticket-form-side-by-side.css") ) {
+        push @css_files, '$style/ticket-form-side-by-side.css';
+    }
+    else {
+        push @css_files, 'base/ticket-form-side-by-side.css';
+    }
+}
+
+
 </%INIT>
 
 <%ARGS>
diff --git a/share/html/NoAuth/css/base/ticket-form.css b/share/html/NoAuth/css/base/ticket-form-side-by-side.css
similarity index 75%
copy from share/html/NoAuth/css/base/ticket-form.css
copy to share/html/NoAuth/css/base/ticket-form-side-by-side.css
index daab263..68295b5 100644
--- a/share/html/NoAuth/css/base/ticket-form.css
+++ b/share/html/NoAuth/css/base/ticket-form-side-by-side.css
@@ -45,48 +45,6 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-.ticket-info-basics input[name="Subject"] {
-    width: 20em;
-}
-
-#ticket-create-metadata .cflabel .name,
-#ticket-update-metadata .cflabel .name {
-    font-weight: normal;
-}
-
-#ticket-create-message .messagedetails,
-#ticket-update-message .messagedetails
-{
-    margin-bottom: 0.5em;
-}
-
-#ticket-create-message .messagedetails input[type="text"],
-#ticket-update-message .messagedetails input[type="text"] {
-    width: 90%;
-}
-
-#ticket-create-message #SubmitTicket,
-#ticket-update-message #SubmitTicket {
-    padding-bottom: 2em;
-}
-
-.ticket-info-squelch ul, #previewscrips ul {
-    list-style: none;
-}
-
-iframe.richtext-editor {
-    background-color: white !important;
-}
-
-.messagebox-container.action-response textarea,
-.messagebox-container.action-response iframe
-{
-    background-color: #fcc !important;
-} 
-
-/*
-% if ( RT->Config->Get("UseSideBySideLayout", $session{'CurrentUser'}) ) {
-*/
 
 #ticket-create-metadata,
 #ticket-update-metadata {
@@ -124,6 +82,3 @@ iframe.richtext-editor {
     float: right;
 }
 
-/*
-% }
-*/
diff --git a/share/html/NoAuth/css/base/ticket-form.css b/share/html/NoAuth/css/base/ticket-form.css
index daab263..4f076c3 100644
--- a/share/html/NoAuth/css/base/ticket-form.css
+++ b/share/html/NoAuth/css/base/ticket-form.css
@@ -84,46 +84,3 @@ iframe.richtext-editor {
     background-color: #fcc !important;
 } 
 
-/*
-% if ( RT->Config->Get("UseSideBySideLayout", $session{'CurrentUser'}) ) {
-*/
-
-#ticket-create-metadata,
-#ticket-update-metadata {
-    float: right;
-    width: 40%;
-    clear: right;
-}
-
-#ticket-create-message,
-#ticket-update-message {
-    float: left;
-    width: 58%;
-    clear: left;
-}
-
- at media (max-width: 950px) {
-    /* Revert to a single column when we're less than 1000px wide */
-    #ticket-create-metadata,
-    #ticket-update-metadata,
-    #ticket-create-message,
-    #ticket-update-message
-    {
-        float: none;
-        width: auto;
-        clear: both;
-    }
-}
-
-#comp-Ticket-Update #body {
-    padding-top: 3em;
-}
-
-#ticket-create-message .button[name="AddMoreAttach"],
-#ticket-update-message .button[name="AddMoreAttach"] {
-    float: right;
-}
-
-/*
-% }
-*/

commit 7fc9859bcb6d757167caa9a17f07d196595123a3
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jan 25 06:04:43 2012 +0800

    test of UseSideBySedeLayout

diff --git a/t/web/side_by_side_layout.t b/t/web/side_by_side_layout.t
new file mode 100644
index 0000000..f85a17e
--- /dev/null
+++ b/t/web/side_by_side_layout.t
@@ -0,0 +1,42 @@
+use strict;
+use warnings;
+use RT::Test tests => 11;
+
+RT->Config->Set( UseSideBySideLayout => 0 );
+
+my $root = RT::Test->load_or_create_user( Name => 'root', );
+my ( $status, $msg ) = $root->SetPreferences(
+    $RT::System => {
+        %{ $root->Preferences($RT::System) || {} }, 'UseSideBySideLayout' => 1
+    }
+);
+ok( $status, 'use side by side layout for root' );
+
+my $user_a = RT::Test->load_or_create_user(
+    Name     => 'user_a',
+    Password => 'password',
+);
+ok( $user_a->id, 'created user_a' );
+
+ok(
+    RT::Test->set_rights(
+        {
+            Principal => $user_a,
+            Right     => ['CreateTicket']
+        },
+    ),
+    'granted user_a the right of CreateTicket'
+);
+
+my ( $url, $m ) = RT::Test->started_ok;
+$m->login;
+$m->get_ok( $url . '/Ticket/Create.html?Queue=1', "root's ticket create page" );
+$m->content_contains( 'ticket-form-side-by-side.css',
+    'found side by side css for root' );
+
+my $m_a = RT::Test::Web->new;
+ok $m_a->login( 'user_a', 'password' ), 'logged in as user_a';
+$m_a->get_ok( $url . '/Ticket/Create.html?Queue=1', "user_a's ticket create page" );
+$m_a->content_lacks( 'ticket-form-side-by-side.css',
+    "didn't find side by side css for user_a" );
+

-----------------------------------------------------------------------


More information about the Rt-commit mailing list