Skip to content
Extraits de code Groupes Projets
Valider f696ffc3 rédigé par maxwell's avatar maxwell
Parcourir les fichiers

fixed up some views, but some stuff feels like it broke

parent a0417d13
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de avec 51 ajouts et 18 suppressions
......@@ -2,5 +2,4 @@ class ApplicationController < ActionController::Base
protect_from_forgery :except => :receive
layout 'application'
end
......@@ -29,4 +29,7 @@ module ApplicationHelper
end
end
def mine?(post)
post.owner == User.first.email
end
end
......@@ -2,7 +2,7 @@ module DashboardHelper
def type_partial(post)
class_name = post.class.name.to_s.underscore
"#{class_name.pluralize}/pane"
"#{class_name.pluralize}/#{class_name}"
end
end
%li.message
%li.message{:class => ("mine" if mine?(post))}
%span.from
= link_to post.owner, "#"
%b wrote a new blog post
......@@ -6,6 +6,6 @@
%b= post.title
%br
= post.body
%div.time
= "#{time_ago_in_words(post.updated_at)} ago"
%div.time= link_to "#{time_ago_in_words(post.updated_at)} ago", blog_path(post)
- if mine?(post)
= link_to 'Destroy', blog_path(post), :confirm => 'Are you sure?', :method => :delete
\ No newline at end of file
......@@ -2,4 +2,4 @@
%ul#stream
- for blog in @blogs
= render "pane", :post => blog
= render "blog", :post => blog
%li.message
%li.message{:class => ("mine" if mine?(post))}
%span.from
= link_to post.owner, "#"
%b shared a link
%br
= post.title
= link_to post.link
%div.time= "#{time_ago_in_words(post.updated_at)} ago"
%div.time= link_to "#{time_ago_in_words(post.updated_at)} ago", bookmark_path(post)
- if mine?(post)
= link_to 'Destroy', bookmark_path(post), :confirm => 'Are you sure?', :method => :delete
......@@ -2,4 +2,4 @@
%ul#stream
- for bookmark in @bookmarks
= render "pane", :post => bookmark
= render "bookmark", :post => bookmark
!!!
%html
%head
%title
= yield(:title) || "Untitled"
......@@ -11,7 +10,7 @@
= javascript_include_tag 'jquery142'
/= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"
= javascript_include_tag 'rails'
= javascript_include_tag 'socket'
= javascript_include_tag 'socket' if user_signed_in?
= csrf_meta_tag
= yield(:head)
......@@ -28,7 +27,6 @@
$(this).fadeTo(80, 1);
});
});
%body
%header
......
%li.message
%li.message{:class => ("mine" if mine?(post))}
%span.from
= link_to post.owner, "#"
= post.message
%div.time
= "#{time_ago_in_words(post.updated_at)} ago"
- if mine?(post)
= link_to 'Destroy', status_message_path(post), :confirm => 'Are you sure?', :method => :delete
%h1.big_text= link_to "new status message", new_status_message_path
%ul#stream
- for status_message in @status_messages
= render "pane", :post => status_message
= render "status_message", :post => status_message
......@@ -7,16 +7,13 @@ module WebSocket
EM.next_tick {
EM.add_timer(0.1) do
#puts "channel set"
@channel = EM::Channel.new
end
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080, :debug => true) do |ws|
ws.onopen {
sid = @channel.subscribe { |msg| ws.send msg }
#@channel.push "#{sid} connectdfged!"
puts @channel.inspect
ws.onmessage { |msg|
@channel.push "#{msg}"
}
......@@ -30,10 +27,7 @@ module WebSocket
}
#this should get folded into message queue i think?
def self.update_clients(json)
#EM.add_timer(5) do
#puts @channel
@channel.push json
#end
@channel.push(json) if @channel
end
end
......@@ -3,7 +3,6 @@ Diaspora::Application.routes.draw do |map|
resources :bookmarks
resources :friends
resources :status_messages
resources :status_messages
#routes for devise, not really sure you will need to mess with this in the future, lets put default,
#non mutable stuff in anohter file
......
......@@ -131,7 +131,8 @@ li.message {
line-height: 140%;
font-size: 120%;
font-family: "Lucida Grande";
color: #999999; }
color: #999999;
margin-bottom: 5px; }
li.message span.from {
color: black;
font-weight: bold;
......@@ -140,6 +141,9 @@ li.message {
color: #bababa;
font-size: 70%; }
.mine {
background-color: rgba(202, 237, 204, 0.5); }
h1 {
position: relative;
font-size: 24px;
......
......@@ -158,6 +158,7 @@ li.message
:size 120%
:family 'Lucida Grande'
:color #999
:margin-bottom 5px
span.from
:color #000
......@@ -169,6 +170,8 @@ li.message
div.time
:color #bababa
:font-size 70%
.mine
:background-color rgba(202, 237, 204, 0.5)
h1
:position relative
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter