Skip to content
Extraits de code Groupes Projets
application.html.haml 3,02 ko
Newer Older
    %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
    %meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" }
    
danielvincent's avatar
danielvincent a validé
    = stylesheet_link_tag "blueprint/screen", :media => 'screen'
    = stylesheet_link_tag "application"
maxwell's avatar
maxwell a validé
    /= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"
maxwell's avatar
maxwell a validé
    = javascript_include_tag 'jquery142', 'rails', 'view'
    = javascript_include_tag 'tiny_mce/tiny_mce.js'
maxwell's avatar
maxwell a validé

    
    - unless request.user_agent.include? "Safari" ||"Chrome"
maxwell's avatar
maxwell a validé
      = javascript_include_tag 'FABridge', 'swfobject', 'web_socket'
      :javascript
          WebSocket.__swfLocation = "/javascripts/WebSocketMain.swf";
    
    
    = csrf_meta_tag
    = yield(:head)
danielvincent's avatar
danielvincent a validé

    -  if user_signed_in?
      :javascript
        $(document).ready(function(){
          function debug(str){ $("#debug").append("<p>" +  str); };

          ws = new WebSocket("ws://#{request.host}:8080/");
          ws.onmessage = function(evt) { 
            var obj = jQuery.parseJSON(evt.data);
             if((location.href.indexOf(obj['class']) != -1 ) || (location.pathname == '/')) {
                $("#stream").prepend($(obj['html']).fadeIn("fast")); 
             };
          }
          ws.onclose = function() { debug("socket closed"); };
          ws.onopen = function() {
          debug("connected...");
          };


          $('#show_filters').hover( function() {
            $("#stream_filters").fadeIn(80);
          },
          function() {
            $("#stream_filters").fadeOut(100);
    - flash.each do |name, msg|
      = content_tag :div, msg, :id => "flash_#{name}"
    
danielvincent's avatar
danielvincent a validé
    %header
danielvincent's avatar
danielvincent a validé
      .container
        %a#diaspora_text{:href => root_path}
          %img{:src => '/images/diaspora_white.png'}

          #session_action
            - if user_signed_in?
              =User.first.email
              |
              = link_to "logout", destroy_user_session_path
            - else
              = link_to "login", new_user_session_path
danielvincent's avatar
danielvincent a validé

danielvincent's avatar
danielvincent a validé
    #header_below
danielvincent's avatar
danielvincent a validé
      .container
        - if user_signed_in?
          %h1#user_name
            = link_to User.first.real_name, root_url
            %span.description
              = my_latest_message
danielvincent's avatar
danielvincent a validé

danielvincent's avatar
danielvincent a validé
    .container
      #content.span-24.last
        .span-3.append-1.last
            %a{ :href => root_path, :title => "Your network stream."}
              %li home
            %a{ :href => status_messages_path, :title => "Recent status messages."}
              %li status messages
            %a{ :href => bookmarks_path, :title => "Recently shared links."}
              %li bookmarks
            %a{ :href => blogs_path, :title => "Recent blog posts."}
              %li blogs
            %a{ :href => friends_path, :title => "Your list of connections with other seeds."}
              %li friends
danielvincent's avatar
danielvincent a validé
        .span-15.append-1.last
          = yield
          = render "posts/debug"
        .span-3.last
          = render 'friends/sidebar' if user_signed_in?