r12273 - in mb_server/trunk: lib/MusicBrainz/Server/Controller root root/main root/static/styles

View: New views
1 Messages — Rating Filter:   Alert me  

r12273 - in mb_server/trunk: lib/MusicBrainz/Server/Controller root root/main root/static/styles

by root-97 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Author: acid2
Date: 2009-10-31 12:29:06 +0000 (Sat, 31 Oct 2009)
New Revision: 12273

Added:
   mb_server/trunk/root/main/frame.tt
Modified:
   mb_server/trunk/lib/MusicBrainz/Server/Controller/Root.pm
   mb_server/trunk/root/layout.tt
   mb_server/trunk/root/static/styles/layout.css
Log:
Chrome Frame suppport. See review 446

Merge branch 'chrome-frame'

Modified: mb_server/trunk/lib/MusicBrainz/Server/Controller/Root.pm
===================================================================
--- mb_server/trunk/lib/MusicBrainz/Server/Controller/Root.pm 2009-10-31 12:28:23 UTC (rev 12272)
+++ mb_server/trunk/lib/MusicBrainz/Server/Controller/Root.pm 2009-10-31 12:29:06 UTC (rev 12273)
@@ -106,6 +106,11 @@
         }
     }
 
+    if ($c->req->user_agent =~ /MSIE/i) {
+        $c->stash->{looks_like_ie} = 1;
+        $c->stash->{needs_chrome} = !($c->req->user_agent =~ /chromeframe/i);
+    }
+
     # Setup the searchs on the sidebar
     $c->form( sidebar_search => 'Search::Search' );
 
@@ -210,6 +215,12 @@
     $c->stash->{various_artist_mbid} = ModDefs::VARTIST_MBID;
 }
 
+sub chrome_frame : Local
+{
+    my ($self, $c) = @_;
+    $c->stash( template => 'main/frame.tt' );
+}
+
 =head1 LICENSE
 
 This software is provided "as is", without warranty of any kind, express or

Modified: mb_server/trunk/root/layout.tt
===================================================================
--- mb_server/trunk/root/layout.tt 2009-10-31 12:28:23 UTC (rev 12272)
+++ mb_server/trunk/root/layout.tt 2009-10-31 12:29:06 UTC (rev 12273)
@@ -2,6 +2,9 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        [%- IF looks_like_ie -%]
+        <meta http-equiv="X-UA-Compatible" content="chrome=1">
+        [%- END -%]
         <title>[% title %][% " - " IF title %]MusicBrainz.org</title>
         <link rel="stylesheet" type="text/css" href="/static/main.css" />
         <link rel="search" type="application/opensearchdescription+xml" title="[%- l("MusicBrainz: Artist") -%]" href="[% c.uri_for('/static/search_plugins/opensearch/musicbrainz_artist.xml') %]" />
@@ -39,6 +42,14 @@
             </div></div>
         </div>
 
+        [%- IF needs_chrome -%]
+        <div id="chrome-prompt">
+          It looks like you're using Internet Explorer but do not have Google Chrome installed.
+          We highly recommend the use of Google Chrome Frame!<br />
+          <a href="/chrome_frame">More information…</a>
+        </div>
+        [%- END -%]
+
         <div class="page[% IF full_width %] fullwidth[% END %]">
         [%- content -%]
         <div class="br"></div><div class="bl"></div><div class="tr"></div><div class="tl"></div>

Modified: mb_server/trunk/root/static/styles/layout.css
===================================================================
--- mb_server/trunk/root/static/styles/layout.css 2009-10-31 12:28:23 UTC (rev 12272)
+++ mb_server/trunk/root/static/styles/layout.css 2009-10-31 12:29:06 UTC (rev 12273)
@@ -677,3 +677,12 @@
 #rightSide ul#blog li {
     list-style-type: none;
 }
+
+#chrome-prompt {
+    margin: 6pt 0;
+    text-align: center;
+    font-weight: bold;
+    background: #FFBA58;
+    padding: 4pt;
+    border: 2px solid #FC6714;
+}
\ No newline at end of file


_______________________________________________
MusicBrainz-commits mailing list
MusicBrainz-commits@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-commits