major hack on getting_started#2 with aspect javascript. reload the page on ajax success on new aspect creation just to get it working.
This commit is contained in:
parent
05c5e770ee
commit
db1a753add
4 changed files with 28 additions and 11 deletions
|
|
@ -47,7 +47,7 @@ class AspectsController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@aspect = current_user.aspect_by_id params[:id]
|
@aspect = current_user.aspect_by_id params[:id]
|
||||||
@friends_not_in_aspect = current_user.friends_not_in_aspect(@aspect)
|
@friends_not_in_aspect = current_user.friends #current_user.friends_not_in_aspect(@aspect)
|
||||||
unless @aspect
|
unless @aspect
|
||||||
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,29 @@
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
||||||
- if current_user.getting_started == true
|
- content_for :head do
|
||||||
:javascript
|
:javascript
|
||||||
$("#getting_started_skip").live("click", function(evt){
|
$("#new_aspect").live("ajax:success", function(data,stat,xhr){
|
||||||
evt.preventDefault();
|
window.location.reload();
|
||||||
$.ajax({
|
|
||||||
type: "PUT",
|
|
||||||
url: "/users/#{current_user.id}",
|
|
||||||
data: {"user":{"getting_started":'false'}},
|
|
||||||
success: function() { window.location = "#{root_path}"}
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".aspects li").find(".delete").live("click", function(){
|
||||||
|
var aspectElement = $(this).parent("li");
|
||||||
|
aspectElement.fadeOut(300, function(){aspectElement.remove();});
|
||||||
|
});
|
||||||
|
|
||||||
|
- if current_user.getting_started == true
|
||||||
|
:javascript
|
||||||
|
$("#getting_started_skip").live("click", function(evt){
|
||||||
|
evt.preventDefault();
|
||||||
|
$.ajax({
|
||||||
|
type: "PUT",
|
||||||
|
url: "/users/#{current_user.id}",
|
||||||
|
data: {"user":{"getting_started":'false'}},
|
||||||
|
success: function() { window.location = "#{root_path}"}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
.span-8.append-1.last
|
.span-8.append-1.last
|
||||||
%h1{:style => "text-align:right;"}
|
%h1{:style => "text-align:right;"}
|
||||||
= "Welcome to Diaspora!"
|
= "Welcome to Diaspora!"
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
%h4
|
%h4
|
||||||
Aspect name
|
Aspect name
|
||||||
- form_for Aspect.new, :remote => true do |aspect|
|
- form_for Aspect.new, :remote => true, :format => :json do |aspect|
|
||||||
= aspect.text_field :name, :style => "display:inline;"
|
= aspect.text_field :name, :style => "display:inline;"
|
||||||
= aspect.submit "Add"
|
= aspect.submit "Add"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1355,3 +1355,9 @@ ul.aspects
|
||||||
:position absolute
|
:position absolute
|
||||||
:left 12px
|
:left 12px
|
||||||
:bottom 12px
|
:bottom 12px
|
||||||
|
|
||||||
|
#user_photo_uploader
|
||||||
|
.avatar
|
||||||
|
:border-radius 5px
|
||||||
|
:height 100px
|
||||||
|
:width 100px
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue