From d893ac5d01de529823fd54d48fc471adc3471925 Mon Sep 17 00:00:00 2001 From: mishudark Date: Thu, 16 Sep 2010 17:04:26 -0500 Subject: [PATCH 1/8] change font size --- public/stylesheets/application.css | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index fdef9e4b9..cf7939e60 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -13,12 +13,11 @@ body { a { color: #556270; color: #107fc9; - color: #019dbe; + color: #069; text-decoration: none; } a:hover { - color: white; - background-color: #556270; - background-color: #019dbe; } + color: #2276CC; + } h1 { font-size: 21px; @@ -161,10 +160,13 @@ li.message { li.message .content span.from { color: black; font-weight: normal; - font-size: 110%; } + font-size: 120%; } + li.message .content span.from a{ + font-weight:bold; + } li.message .content div.info { color: #bababa; - font-size: 70%; } + font-size: 90%; } form { position: relative; @@ -227,7 +229,7 @@ ul.comment_set { font-size: 1em; } ul.comment_set li.comment div.time { color: #666666; - font-size: 70%; } + font-size: 90%; } ul.comment_set li.comment form { margin-top: -5px; margin-bottom: 0; @@ -299,8 +301,8 @@ ul.comment_set { color: #cccccc; } input[type='text'], textarea { - font-family: "lucida grande", "sans-serif"; - font-size: 14px; + font-family: "Arial"; + font-size: 15px; padding: 0.3em; display: block; width: 66%; @@ -380,10 +382,14 @@ label { bottom: 20px; font-size: 18px; text-shadow: 0 2px 0 black; } + .album .name a {color:#AAA; + font-weight:normal !important;} .album .name .time { + color:#069; font-size: 12px; } .album .name .time a { - font-weight: normal; } + color:#AAA; + font-weight: normal !important; } .album div.image_cycle img { display: none; } From 910bd71c78fc31b42ea909c0bef0e7c1bf190899 Mon Sep 17 00:00:00 2001 From: mishudark Date: Sat, 18 Sep 2010 03:32:37 -0500 Subject: [PATCH 2/8] prevent photho redirect next,prev if textarea has focus --- app/views/photos/show.html.haml | 18 ++++++++++++++++-- public/stylesheets/application.css | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 654bea892..77ef6da1f 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -7,14 +7,28 @@ $(document).keydown(function(e){ switch(e.keyCode) { case 37: - window.location.replace( "#{url_to_prev(@photo,@album)}" ); + if(flag){//prevent redirect if textarea has focus + window.location.replace( "#{url_to_prev(@photo,@album)}" ); + } break; case 39: - window.location.replace( "#{url_to_next(@photo,@album)}" ); + if(flag){ + window.location.replace( "#{url_to_next(@photo,@album)}" ); + } break; } }); + //asign a flag to determine if textarea has focus + $(document).ready(function(){ + $("textarea").live('focus',function(){ + flag = 0; + }); + $("textarea").live('blur',function(){ + flag = 1; + }); + }); + = content_for :page_title do = link_to "◂ #{@photo.album.name}", @photo.album diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 83b6bfc80..ed7dae38e 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -610,3 +610,6 @@ h1.big_text { #fancybox-close:hover { background-color: transparent; } +#photo_caption{ + margin:auto;} + From b7bc4b86154d8ca5244f45d3bac412556b1cc5bc Mon Sep 17 00:00:00 2001 From: mishudark Date: Sat, 18 Sep 2010 04:14:44 -0500 Subject: [PATCH 3/8] prevent next prev when youre add writting --- app/views/photos/show.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 77ef6da1f..bbef1cbef 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -7,12 +7,12 @@ $(document).keydown(function(e){ switch(e.keyCode) { case 37: - if(flag){//prevent redirect if textarea has focus + if(!$("textarea").hasClass("hasfocus")){//prevent redirect if textarea has focus window.location.replace( "#{url_to_prev(@photo,@album)}" ); } break; case 39: - if(flag){ + if(!$("textarea").hasClass("hasfocus")){ window.location.replace( "#{url_to_next(@photo,@album)}" ); } break; @@ -22,10 +22,10 @@ //asign a flag to determine if textarea has focus $(document).ready(function(){ $("textarea").live('focus',function(){ - flag = 0; + $(this).addClass("hasfocus"); }); $("textarea").live('blur',function(){ - flag = 1; + $(this).removeClass("hasfocus"); }); }); From c46ad0d7fa3c9806f26796b4284ae1440d8c198e Mon Sep 17 00:00:00 2001 From: mishudark Date: Sat, 18 Sep 2010 12:33:22 -0500 Subject: [PATCH 4/8] photo description with ajax request --- app/views/photos/edit.html.haml | 1 + app/views/photos/show.html.haml | 48 ++++++++++++++++++++++++++++-- public/stylesheets/application.css | 21 ++++++++++++- 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index f695f850d..107b67944 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -16,6 +16,7 @@ = form_for @photo do |p| = p.text_field :caption, :value => @photo.caption = p.submit + %div{:class => 'clear'} #content_bottom .back diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index bbef1cbef..29b494441 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -19,15 +19,43 @@ } }); - //asign a flag to determine if textarea has focus $(document).ready(function(){ + //add a clas to verify if a textarea has focus $("textarea").live('focus',function(){ $(this).addClass("hasfocus"); }); $("textarea").live('blur',function(){ $(this).removeClass("hasfocus"); }); - }); + + //show form to add description + $(".edit-desc").click(function(){ + $(".edit_photo").toggle(); + //$(".caption").toggle(); + }); + + //Add a description with ajax request + $("#photo_submit").click(function(evenet){ + event.preventDefault(); + var method = $(".edit_photo").attr("method"); + var url = $(".edit_photo").attr("action"); + var data = $(".edit_photo").serialize(); + $(".description").text($("#photo_caption").val()); + //$(".caption").toggle(); + $(".edit_photo").toggle(); + + $.ajax({ + type: method, + url: url, + data: data, + success: function(response){ + $("#add-description").remove(); + } + }); + + }); + + });//end document ready = content_for :page_title do = link_to "◂ #{@photo.album.name}", @photo.album @@ -54,7 +82,21 @@ #show_photo = linked_scaled_photo @photo, @album .caption - = @photo.caption + -if current_user.owns? @album + -if @photo.caption and @photo.caption != "" + = link_to 'Edit','javascript:void(0)', :id => "edit-desc", :class => "edit-desc" + .description + = @photo.caption + + -if current_user.owns? @album + %div{:class => 'clear'} + -if !@photo.caption or @photo.caption == "" + = link_to 'Add a description','javascript:void(0)', :id => "add-description", :class => "edit-desc" + + = form_for @photo do |p| + = p.text_field :caption, :value => @photo.caption + = p.submit + %div{:class => 'clear'} #content_bottom .back diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index ed7dae38e..05c09b3f1 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -610,6 +610,25 @@ h1.big_text { #fancybox-close:hover { background-color: transparent; } +.edit_photo{ + display:none;} #photo_caption{ + width:100%; margin:auto;} - +.caption .description{ + text-align:left; + margin-left:3em; + display:block + width:90%;} +.caption a{ + float:left; +} +#add-description{ + width:100%;} +.caption, .edit_photo{ + margin:auto; + width:70%;} +#photo_submit{ + float:right;} +.clear{ + clear:both;} From 7ecc94d7b2f4b772fb770f28c0a375b460463173 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 7 Oct 2010 14:03:18 -0700 Subject: [PATCH 5/8] added the password route to make email reset password work --- config/routes.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 2827c4cc7..bcb237671 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,9 @@ Diaspora::Application.routes.draw do resources :requests, :except => [:edit, :update] resources :photos, :except => [:index] resources :albums - + + devise_for :users, :controllers => {:registrations => "registrations", + :password => "devise/passwords"} # added public route to user match 'public/:username', :to => 'users#public' resources :users, :except => [:create, :new, :show] @@ -31,7 +33,6 @@ Diaspora::Application.routes.draw do match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" #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, :controllers => {:registrations => "registrations"} match 'login', :to => 'devise/sessions#new', :as => "new_user_session" match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" match 'signup', :to => 'registrations#new', :as => "new_user_registration" From 09dad2d80fafa5fd7e5aea02bc31f26ed11efcfd Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 7 Oct 2010 14:10:14 -0700 Subject: [PATCH 6/8] DG MS; exporter includes comments. exporter spec --- lib/diaspora/exporter.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/diaspora/exporter.rb b/lib/diaspora/exporter.rb index 9e2f719a5..106c94bb0 100644 --- a/lib/diaspora/exporter.rb +++ b/lib/diaspora/exporter.rb @@ -4,11 +4,6 @@ module Diaspora - def self.bone(user) - exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML) - exporter.execute(user) - end - class Exporter def initialize(strategy) self.class.send(:include, strategy) @@ -22,7 +17,7 @@ module Diaspora xml.user { xml.username user.username xml.serialized_private_key user.serialized_private_key - xml.person user.person.to_xml + xml.parent << user.person.to_xml xml.aspects { user.aspects.each do |aspect| @@ -36,8 +31,14 @@ module Diaspora end } xml.posts { - aspect.posts.each do |post| - xml.post post.to_xml if post.respond_to? :to_xml + aspect.posts.find_all_by_person_id(user.person.id).each do |post| + post_doc = post.to_xml + + post.comments.each do |comment| + post_doc << comment.to_xml + end + + xml.post post_doc end } } From 2451ac49575c58391cbafcc14b5fabb2e48a4266 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 7 Oct 2010 14:20:31 -0700 Subject: [PATCH 7/8] moved the SMTP setting into app_config.yml --- config/environments/development.rb | 16 ++++++++-------- config/environments/production.rb | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 15d1fc2bb..d848ad4e9 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -24,15 +24,15 @@ Diaspora::Application.configure do config.active_support.deprecation = :log config.middleware.use MongoMapper::ClearDevMemory #config.threadsafe! - config.action_mailer.delivery_method = :smtp - config.action_mailer.default_url_options = {:host => 'localhost:3000'} + config.action_mailer.delivery_method = :smtp + config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} config.action_mailer.smtp_settings = { - :address => 'smtp.gmail.com', - :port => 587, - :domain => 'mail.joindiaspora.com', - :authentication => 'plain', - :user_name => 'diaspora-pivots@joindiaspora.com', - :password => "xy289|]G+R*-kA", + :address => APP_CONFIG[:smtp_address], + :port => APP_CONFIG[:smtp_port], + :domain => APP_CONFIG[:smtp_domain], + :authentication => APP_CONFIG[:smtp_authentication], + :user_name => APP_CONFIG[:smtp_username], + :password => APP_CONFIG[:smtp_password], :enable_starttls_auto => true } end diff --git a/config/environments/production.rb b/config/environments/production.rb index cb13c1d1c..6b081b164 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -49,14 +49,14 @@ Diaspora::Application.configure do config.threadsafe! config.action_mailer.delivery_method = :smtp - config.action_mailer.default_url_options = {:host => 'pivots.joindiaspora.com'} + config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} config.action_mailer.smtp_settings = { - :address => 'smtp.gmail.com', - :port => 587, - :domain => 'mail.joindiaspora.com', - :authentication => 'plain', - :user_name => 'diaspora-pivots@joindiaspora.com', - :password => "xy289|]G+R*-kA", + :address => APP_CONFIG[:smtp_address], + :port => APP_CONFIG[:smtp_port], + :domain => APP_CONFIG[:smtp_domain], + :authentication => APP_CONFIG[:smtp_authentication], + :user_name => APP_CONFIG[:smtp_username], + :password => APP_CONFIG[:smtp_password], :enable_starttls_auto => true } end From 8f1973815e9dbe32ed6c9e4dbee1461b2a601e24 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 7 Oct 2010 14:21:53 -0700 Subject: [PATCH 8/8] DG MS; added route for exported xml --- app/controllers/users_controller.rb | 6 ++++++ config/routes.rb | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9b41b1fc9..0ee354dfb 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -4,6 +4,7 @@ class UsersController < ApplicationController require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) + require File.expand_path('../../../lib/diaspora/exporter', __FILE__) before_filter :authenticate_user!, :except => [:new, :create, :public] @@ -56,6 +57,11 @@ class UsersController < ApplicationController end end + def export + exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML) + render :xml => exporter.execute(current_user) + end + private def prep_image_url(params) url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' diff --git a/config/routes.rb b/config/routes.rb index bcb237671..6f9f529db 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,7 +14,8 @@ Diaspora::Application.routes.draw do :password => "devise/passwords"} # added public route to user match 'public/:username', :to => 'users#public' - resources :users, :except => [:create, :new, :show] + match 'users/export', :to => 'users#export' + resources :users, :except => [:create, :new, :show] match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend'