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

removed javascript slider. made each getting_started section its own page. ...

removed javascript slider.  made each getting_started section its own page.  added bio to profile (and changed xml_accessors to xml_readers).
parent f23d1992
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -66,7 +66,16 @@ class UsersController < ApplicationController
end
def getting_started
render 'users/getting_started'
@aspect = :getting_started
@user = current_user
@profile = current_user.profile
@photos = current_user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC'
if params[:id].to_i < 4
render "users/getting_started/#{params[:id]}"
else
render "users/getting_started/1"
end
end
def export
......
......@@ -9,13 +9,15 @@ class Profile
include ROXML
xml_reader :person_id
xml_accessor :first_name
xml_accessor :last_name
xml_accessor :image_url
xml_reader :first_name
xml_reader :last_name
xml_reader :image_url
xml_reader :bio
key :first_name, String
key :last_name, String
key :image_url, String
key :bio, String
validates_presence_of :first_name, :last_name
after_validation :strip_names
......
......@@ -40,6 +40,8 @@ class User
key :invite_messages, Hash
key :getting_started, Boolean, :default => false
before_validation :strip_username, :on => :create
validates_presence_of :username
validates_uniqueness_of :username, :case_sensitive => false
......
......@@ -30,7 +30,6 @@
= javascript_include_tag 'fileuploader'
= javascript_include_tag 'view', 'image_picker', 'stream'
= javascript_include_tag 'easySlider1.7'
= render 'js/websocket_js'
......@@ -68,3 +67,6 @@
.span-24.last
= render "posts/debug"
#getting_started_button
= link_to "Getting started", getting_started_path(1)
......@@ -20,11 +20,11 @@
%h4
Your birthday
%br
= select_date
= select_date Time.now, :order => [:month, :day, :year]
%h4
Your bio
= text_area_tag :bio, nil, :placeholder => "Fill me out"
= profile.text_area :bio, :value => @profile.bio, :rows => 5, :placeholder => "Fill me out"
%h4
Your photo
......
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h1
= "Welcome, #{current_user.real_name}!"
.description
Do the stuff below to further complete some things.
#slider
%ul
%li
%h2
%u
Edit your profile
Define your aspects ➔
Find your friends
%h3
Your Profile
.description
This info will be available to whomever you connect with on Diaspora.
%h4
Your name
= text_field_tag :first_name, nil, :placeholder => "First name"
= text_field_tag :last_name, nil, :placeholder => "Last name"
%h4
Your birthday
%br
= select_date
%h4
Your bio
= text_area_tag :bio, nil, :placeholder => "Fill me out"
%h4
Your photo
%br
= file_field_tag :photo
%li
%h2
Edit your profile ➔
%u
Define your aspects
Find your friends
%h3
Your aspects
.description
These will be blah blah blah blah and some stuff.
%h4
Aspect name
= text_field_tag :aspect_name, nil, :placeholder => "New aspect"
%li
%h2
Edit your profile ➔
Define your aspects ➔
%u
Find your friends
%h3
Your friends
.description
Find your friends on Diaspora, Facebook, or send them an invite via email.
.span-5
%h4
On Diaspora
= text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle"
.span-5
%h4
On Facebook
= text_field_tag :facebook_handle, nil, :placeholder => "Name"
.span-5
%h4
Invite
= text_field_tag :email, nil, :placeholder => "Email", :type => "email"
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h1
= "Welcome, #{current_user.real_name}!"
.description
Do the stuff below to further complete some things.
%h2
%u
Edit your profile
Define your aspects ➔
Find your friends
= render 'users/profile'
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h1
= "Welcome, #{current_user.real_name}!"
.description
Do the stuff below to further complete some things.
%h2
Edit your profile ➔
%u
Define your aspects
Find your friends
%h3
Your aspects
.description
These will be blah blah blah blah and some stuff.
%h4
Aspect name
= text_field_tag :aspect_name, nil, :placeholder => "New aspect"
%ul.aspects
- for aspect in @aspects
%li
= aspect
.friend_pictures.horizontal
- for friend in @friends
= person_image_link(friend)
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h1
= "Welcome, #{current_user.real_name}!"
.description
Do the stuff below to further complete some things.
%h2
Edit your profile ➔
Define your aspects ➔
%u
Find your friends
%h3
Your friends
.description
Find your friends on Diaspora, Facebook, or send them an invite via email.
.span-5
%h4
On Diaspora
= text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle"
.span-5
%h4
On Facebook
= text_field_tag :facebook_handle, nil, :placeholder => "Name"
.span-5
%h4
Invite
= text_field_tag :email, nil, :placeholder => "Email", :type => "email"
......@@ -17,12 +17,12 @@ Diaspora::Application.routes.draw do
:password => "devise/passwords",
:invitations => "invitations"}
# added public route to user
match 'public/:username', :to => 'users#public'
match 'users/getting_started', :to => 'users#getting_started'
match 'users/export', :to => 'users#export'
match 'users/import', :to => 'users#import'
match 'users/export_photos', :to => 'users#export_photos'
resources :users, :except => [:create, :new, :show]
match 'public/:username', :to => 'users#public'
match 'users/getting_started/:id', :to => 'users#getting_started', :as => 'getting_started'
match 'users/export', :to => 'users#export'
match 'users/import', :to => 'users#import'
match 'users/export_photos', :to => 'users#export_photos'
resources :users, :except => [:create, :new, :show]
match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend'
match 'aspects/add_to_aspect',:to => 'aspects#add_to_aspect', :as => 'add_to_aspect'
......
/*
* Easy Slider 1.7 - jQuery plugin
* written by Alen Grakalic
* http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
*
* Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Built for jQuery library
* http://jquery.com
*
*/
/*
* markup example for $("#slider").easySlider();
*
* <div id="slider">
* <ul>
* <li><img src="images/01.jpg" alt="" /></li>
* <li><img src="images/02.jpg" alt="" /></li>
* <li><img src="images/03.jpg" alt="" /></li>
* <li><img src="images/04.jpg" alt="" /></li>
* <li><img src="images/05.jpg" alt="" /></li>
* </ul>
* </div>
*
*/
(function($) {
$.fn.easySlider = function(options){
// default configuration properties
var defaults = {
prevId: 'prevBtn',
prevText: 'Previous',
nextId: 'nextBtn',
nextText: 'Next',
controlsShow: true,
controlsBefore: '',
controlsAfter: '',
controlsFade: true,
firstId: 'firstBtn',
firstText: 'First',
firstShow: false,
lastId: 'lastBtn',
lastText: 'Last',
lastShow: false,
vertical: false,
speed: 800,
auto: false,
pause: 2000,
continuous: false,
numeric: false,
numericId: 'controls'
};
var options = $.extend(defaults, options);
this.each(function() {
var obj = $(this);
var s = $("li", obj).length;
var w = $("li", obj).width();
var h = $("li", obj).height();
var clickable = true;
obj.width(w);
obj.height(h);
obj.css("overflow","hidden");
var ts = s-1;
var t = 0;
$("ul", obj).css('width',s*w);
if(options.continuous){
$("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px"));
$("ul", obj).append($("ul li:nth-child(2)", obj).clone());
$("ul", obj).css('width',(s+1)*w);
};
if(!options.vertical) $("li", obj).css('float','left');
if(options.controlsShow){
var html = options.controlsBefore;
if(options.numeric){
html += '<ol id="'+ options.numericId +'"></ol>';
} else {
if(options.firstShow) html += '<span id="'+ options.firstId +'"><a href=\"javascript:void(0);\">'+ options.firstText +'</a></span>';
html += ' <span id="'+ options.prevId +'"><a href=\"javascript:void(0);\">'+ options.prevText +'</a></span>';
html += ' <span id="'+ options.nextId +'"><a href=\"javascript:void(0);\">'+ options.nextText +'</a></span>';
if(options.lastShow) html += ' <span id="'+ options.lastId +'"><a href=\"javascript:void(0);\">'+ options.lastText +'</a></span>';
};
html += options.controlsAfter;
$(obj).after(html);
};
if(options.numeric){
for(var i=0;i<s;i++){
$(document.createElement("li"))
.attr('id',options.numericId + (i+1))
.html('<a rel='+ i +' href=\"javascript:void(0);\">'+ (i+1) +'</a>')
.appendTo($("#"+ options.numericId))
.click(function(){
animate($("a",$(this)).attr('rel'),true);
});
};
} else {
$("a","#"+options.nextId).click(function(){
animate("next",true);
});
$("a","#"+options.prevId).click(function(){
animate("prev",true);
});
$("a","#"+options.firstId).click(function(){
animate("first",true);
});
$("a","#"+options.lastId).click(function(){
animate("last",true);
});
};
function setCurrent(i){
i = parseInt(i)+1;
$("li", "#" + options.numericId).removeClass("current");
$("li#" + options.numericId + i).addClass("current");
};
function adjust(){
if(t>ts) t=0;
if(t<0) t=ts;
if(!options.vertical) {
$("ul",obj).css("margin-left",(t*w*-1));
} else {
$("ul",obj).css("margin-left",(t*h*-1));
}
clickable = true;
if(options.numeric) setCurrent(t);
};
function animate(dir,clicked){
if (clickable){
clickable = false;
var ot = t;
switch(dir){
case "next":
t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1;
break;
case "prev":
t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1;
break;
case "first":
t = 0;
break;
case "last":
t = ts;
break;
default:
t = dir;
break;
};
var diff = Math.abs(ot-t);
var speed = diff*options.speed;
if(!options.vertical) {
p = (t*w*-1);
$("ul",obj).animate(
{ marginLeft: p },
{ queue:false, duration:speed, complete:adjust }
);
} else {
p = (t*h*-1);
$("ul",obj).animate(
{ marginTop: p },
{ queue:false, duration:speed, complete:adjust }
);
};
if(!options.continuous && options.controlsFade){
if(t==ts){
$("a","#"+options.nextId).hide();
$("a","#"+options.lastId).hide();
} else {
$("a","#"+options.nextId).show();
$("a","#"+options.lastId).show();
};
if(t==0){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
} else {
$("a","#"+options.prevId).show();
$("a","#"+options.firstId).show();
};
};
if(clicked) clearTimeout(timeout);
if(options.auto && dir=="next" && !clicked){;
timeout = setTimeout(function(){
animate("next",false);
},diff*options.speed+options.pause);
};
};
};
// init
var timeout;
if(options.auto){;
timeout = setTimeout(function(){
animate("next",false);
},options.pause);
};
if(options.numeric) setCurrent(0);
if(!options.continuous && options.controlsFade){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
};
});
};
})(jQuery);
......@@ -74,7 +74,7 @@ $(document).ready(function(){
};
});
$("#slider").easySlider({speed:400, numeric:true});
//$("#slider").easySlider({speed:400});
$("img", "#left_pane").tipsy({live:true});
......
......@@ -393,6 +393,8 @@ li.message
form
:position relative
:font
:size 14px
#user_name
:margin
......@@ -442,7 +444,6 @@ form
> li
:background none
:border none
#stream ul.comments
:display none
......@@ -453,6 +454,10 @@ form
:margin
:right 10px
form
:margin
:right 12px
input.comment_submit
:display none
:margin
......@@ -635,7 +640,6 @@ label
:width 100%
:margin
:bottom 10px
:top -14px
:border
:bottom 2px #777 solid
......@@ -674,14 +678,14 @@ label
:bottom -2px
input[type='submit']
:position absolute
:right -13px
:right 0
:top 5px
:width 75px
input
:display inline
.public_toggle
:width 300px
:margin
:left -3px
:font
:size smaller
:style italic
......@@ -1074,16 +1078,6 @@ ul#settings_nav
:width 30px
:height 30px
.friend_pictures.horizontal
:display inline
:margin
:left 20px
img
:width 30px
:height 30px
:margin-right -4px
#thumbnails
:line-height 14px
......@@ -1244,11 +1238,34 @@ ul#breadcrumb
&:after
:content ''
#slider ul, #slider li
#getting_started_button
:position fixed
:bottom 4px
:margin
:left 680px
a
:padding 10px
:background #333
:color #eee
:-webkit-border-radius 5px 5px 0 0
:-moz-border-radius 5px 5px 0 0
:border-radius 5px 5px 0 0
:-webkit-box-shadow 0 0 2px #666
ul.aspects
:margin 0
:padding 0
:list-style none
:width 67%
:color #999
:font
:size 24px
> li
:padding 12px 0
:border
:bottom 1px solid #eee
#slider, #slider li
:width 1000px
:overflow hidden
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