From d893ac5d01de529823fd54d48fc471adc3471925 Mon Sep 17 00:00:00 2001 From: mishudark Date: Thu, 16 Sep 2010 17:04:26 -0500 Subject: [PATCH 1/5] 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/5] 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/5] 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/5] 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/5] 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"