twers/re-education

View on GitHub
app/views/layouts/application.html.haml

Summary

Maintainability
Test Coverage
!!!
%html{ :lang => "en", 'ng-app' => 'openClass'}
  %head
    %meta{ :charset => "utf-8" }
    %meta{ :name => "viewport", :content => "width=device-width, initial-scale=1.0" }
    %title #{ @title ? @title : "新的课堂" }
    = csrf_meta_tags
    = qiniu_request_token_tag

    = stylesheet_link_tag    "application", :media => "all"
    = javascript_include_tag "application"

    :erb
      <!--[if IE]>
      <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
      <![endif]-->
      <script type="text/javascript">
        (function(){
          if(navigator.userAgent.indexOf("MSIE 6.0")>0 || navigator.userAgent.indexOf("MSIE 7.0")>0)
          {
            location.href='/ie.html';
          }
        })();
      </script>
    
  %body
    = render 'shared/header'
    = yield
    = render 'shared/footer'
    :javascript
      var _gaq = _gaq || [];
      if (location.port === '') {
        _gaq.push(['_setAccount', 'UA-38816897-1']);
      }
      else {
        _gaq.push(['_setAccount', 'Test Account']);
      }
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
      _gaq.push(['_trackEvent', 'Port', location.port]);