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

major hack on getting_started#2 with aspect javascript. reload the page on...

major hack on getting_started#2 with aspect javascript.  reload the page on ajax success on new aspect creation just to get it working.
parent 05c5e770
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -47,7 +47,7 @@ class AspectsController < ApplicationController
def show
@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
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
else
......
......@@ -3,18 +3,29 @@
-# the COPYRIGHT file.
- if current_user.getting_started == true
- content_for :head do
: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}"}
})
$("#new_aspect").live("ajax:success", function(data,stat,xhr){
window.location.reload();
});
$(".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
%h1{:style => "text-align:right;"}
= "Welcome to Diaspora!"
......
......@@ -10,7 +10,7 @@
%h4
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.submit "Add"
......
......@@ -1355,3 +1355,9 @@ ul.aspects
:position absolute
:left 12px
:bottom 12px
#user_photo_uploader
.avatar
:border-radius 5px
:height 100px
:width 100px
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