RS, DG; latest_status thing now works, started putting signup back in
This commit is contained in:
parent
a48fbaaf59
commit
9947a2abb8
9 changed files with 49 additions and 42 deletions
|
|
@ -19,7 +19,7 @@ class ApplicationController < ActionController::Base
|
|||
if current_user
|
||||
@groups = current_user.groups
|
||||
@friends = current_user.friends
|
||||
@latest_status_message = StatusMessage.newest_for(current_user)
|
||||
@latest_status_message = StatusMessage.newest_for(current_user.person)
|
||||
@group = params[:group] ? current_user.groups.first(:id => params[:group]) : current_user.groups.first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,4 +25,20 @@ class UsersController < ApplicationController
|
|||
render :action => 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@user = User.new(params[:user])
|
||||
|
||||
if @user.save!
|
||||
flash[:notice] = "Successfully signed up."
|
||||
redirect_to root_path
|
||||
else
|
||||
render :action => 'new'
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@user = User.new
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ module SocketsHelper
|
|||
action_hash[:photo_hash] = object.thumb_hash
|
||||
elsif object.is_a? StatusMessage
|
||||
action_hash[:status_message_hash] = object.latest_hash
|
||||
action_hash[:status_message_hash][:mine?] = true if object.person.owner_id == uid
|
||||
end
|
||||
|
||||
action_hash.to_json
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class StatusMessage < Post
|
|||
end
|
||||
|
||||
def latest_hash
|
||||
{:mine? => self.person == User.owner, :text => message}
|
||||
{ :text => message}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
|
||||
function processStatusMessage(className, html, messageHash){
|
||||
processPost(className, html);
|
||||
console.log(messageHash)
|
||||
if(messageHash['mine?']){
|
||||
updateMyLatestStatus(messageHash);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@
|
|||
= link_to current_user.real_name, root_path
|
||||
%span#latest_message
|
||||
= my_latest_message
|
||||
- unless @latest_status_message.nil?
|
||||
%span{:style => "font-size: small", :id => 'latest_message_time'}
|
||||
= " - #{how_long_ago @latest_status_message}"
|
||||
%span{:style => "font-size: small", :id => 'latest_message_time'}
|
||||
- unless @latest_status_message.nil?
|
||||
= "- #{how_long_ago @latest_status_message}"
|
||||
|
||||
%ul.nav
|
||||
%li= link_to "home", root_path
|
||||
|
|
|
|||
|
|
@ -44,14 +44,8 @@
|
|||
|
||||
- flash.each do |name, msg|
|
||||
= content_tag :div, msg, :id => "flash_#{name}"
|
||||
- if User.owner
|
||||
%div#huge_text
|
||||
welcome back,
|
||||
%span
|
||||
= User.owner.real_name.downcase
|
||||
= yield
|
||||
-else
|
||||
%div#huge_text
|
||||
%span
|
||||
you need to add a user first!
|
||||
%div#huge_text
|
||||
diaspora
|
||||
= yield
|
||||
|
||||
= link_to "signup", "/signup"
|
||||
|
|
|
|||
|
|
@ -12,21 +12,20 @@ Diaspora::Application.routes.draw do |map|
|
|||
|
||||
match "/images/files/*path" => "gridfs#serve"
|
||||
|
||||
match 'warzombie', :to => "dev_utilities#warzombie"
|
||||
match 'zombiefriends', :to => "dev_utilities#zombiefriends"
|
||||
match 'warzombie', :to => "dev_utilities#warzombie"
|
||||
match 'zombiefriends', :to => "dev_utilities#zombiefriends"
|
||||
match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept"
|
||||
|
||||
#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
|
||||
devise_for :users, :path_names => {:sign_up => "signup", :sign_in => "login", :sign_out => "logout"}
|
||||
match 'login', :to => 'devise/sessions#new', :as => "new_user_session"
|
||||
match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session"
|
||||
#match 'signup', :to => 'devise/registrations#new', :as => "new_user_registration"
|
||||
resources :users
|
||||
match 'login', :to => 'devise/sessions#new', :as => "new_user_session"
|
||||
match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session"
|
||||
match 'signup', :to => 'devise/registrations#new', :as => "new_user_registration"
|
||||
|
||||
|
||||
#public routes
|
||||
match 'receive/users/:id', :to => 'publics#receive'
|
||||
match 'receive/users/:id', :to => 'publics#receive'
|
||||
match '.well-known/host-meta',:to => 'publics#host_meta'
|
||||
match 'webfinger', :to => 'publics#webfinger'
|
||||
match 'hcard', :to => 'publics#hcard'
|
||||
|
|
|
|||
|
|
@ -1,24 +1,20 @@
|
|||
$(document).ready( function() {
|
||||
$(document).ready( function() {
|
||||
|
||||
$("#publisher_content_pickers .status_message").click(selectPublisherTab);
|
||||
$("#publisher_content_pickers .bookmark").click(selectPublisherTab);
|
||||
$("#publisher_content_pickers .blog").click(selectPublisherTab);
|
||||
$("#publisher_content_pickers .photo").click(selectPublisherTab);
|
||||
$("#publisher_content_pickers .status_message").click(selectPublisherTab);
|
||||
$("#publisher_content_pickers .bookmark").click(selectPublisherTab);
|
||||
$("#publisher_content_pickers .blog").click(selectPublisherTab);
|
||||
$("#publisher_content_pickers .photo").click(selectPublisherTab);
|
||||
|
||||
$("#new_status_message").submit(function() {
|
||||
function selectPublisherTab(evt){
|
||||
evt.preventDefault();
|
||||
var form_id = "#new_" + this.className
|
||||
if( $(form_id).css("display") == "none" ) {
|
||||
$("#publisher_content_pickers").children("li").removeClass("selected");
|
||||
$("#publisher_form form").fadeOut(50);
|
||||
|
||||
});
|
||||
|
||||
function selectPublisherTab(evt){
|
||||
evt.preventDefault();
|
||||
var form_id = "#new_" + this.className
|
||||
if( $(form_id).css("display") == "none" ) {
|
||||
$("#publisher_content_pickers").children("li").removeClass("selected");
|
||||
$("#publisher_form form").fadeOut(50);
|
||||
|
||||
$(this).toggleClass("selected");
|
||||
$(form_id).delay(50).fadeIn(200);
|
||||
}
|
||||
$(this).toggleClass("selected");
|
||||
$(form_id).delay(50).fadeIn(200);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue