small view cleanups

This commit is contained in:
danielvincent 2010-10-17 21:55:03 -07:00
parent 2f5547626e
commit eca37e1a28
16 changed files with 59 additions and 120 deletions

View file

@ -2,19 +2,15 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
.back= link_to "⇧ #{@album.name}", @album
%h1.big_text
= "#{t('.editing')} #{@album.name}"
%h2= "#{t('.editing')} #{@album.name}"
.sub_header
="#{t('.updated')} #{how_long_ago(@album)}"
- form_for @album do |album|
= album.error_messages
- form_for @album do |a|
= a.error_messages
%p
%b album name:
= a.text_field :name
%h4
Album name
= album.text_field :name
- for photo in @album.photos
.photo_edit_block= image_tag photo.url(:thumb_medium)
@ -22,11 +18,8 @@
.submit_block
= link_to t('.cancel'), root_path
or
= a.submit
= album.submit
.button.delete
= link_to t('.delete_album'), @album, :confirm => t('.are_you_sure'), :method => :delete
#content_bottom
.back
= link_to "⇧ #{@album.name}", @album

View file

@ -17,7 +17,7 @@
.right
= link_to t('.new_album'), '#new_album_pane', {:class => "button", :id => "add_album_button"}
.yo{:style => "display:none;" }
.fancybox_content
#new_album_pane
= render "albums/new_album", :aspect => params[:aspect]

View file

@ -3,9 +3,9 @@
-# the COPYRIGHT file.
%h1=t('.add_a_new_aspect')
= form_for Aspect.new do |f|
= f.error_messages
= form_for Aspect.new do |aspect|
= aspect.error_messages
%p
= f.label :name
= f.text_field :name
= f.submit t('.create'), :class => 'button'
= aspect.label :name
= aspect.text_field :name
= aspect.submit t('.create'), :class => 'button'

View file

@ -42,7 +42,6 @@
%ul.tools
%li= link_to t('.add_a_new_friend'), "#add_request_pane_#{aspect.id}", :class => 'add_request_button'
/%li= link_to t('.show'), aspect_path(aspect)
%li!= remove_link(aspect)
%ul.dropzone{:id => aspect.id}
@ -57,7 +56,8 @@
= person_image_tag(person)
.name
= link_to person.real_name, person
.yo{:style => 'display:none'}
.fancybox_content
%div{:id => "add_request_pane_#{aspect.id}"}
= render "requests/new_request", :aspect => aspect

View file

@ -1,22 +0,0 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= link_to "photos", albums_path(:aspect => @aspect)
- content_for :left_pane do
= render "shared/aspect_friends"
- content_for :publish do
- if
= render "shared/publisher", :aspect_ids => :all
%ul#stream
- for post in @posts
= render type_partial(post), :post => post unless post.class == Album
#pagination
= will_paginate @posts

View file

@ -2,10 +2,12 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= form_for Comment.new, :remote => true do |f|
= form_for Comment.new, :remote => true do |comment|
%p
%label{:for => "comment_text_on_#{post.id}"} Comment
= f.text_area :text, :rows => 1, :id => "comment_text_on_#{post.id}", :class => "comment_box"
= f.hidden_field :post_id, :value => post.id
= label_tag "comment_text_on_#{post.id}", "Comment"
= comment.text_area :text, :rows => 1, :id => "comment_text_on_#{post.id}", :class => "comment_box"
= comment.hidden_field :post_id, :value => post.id
%p{:style => "text-align:right;"}
= f.submit t('.comment'), :class => "comment_submit button"
= comment.submit t('.comment'), :class => "comment_submit button"

View file

@ -1,11 +1,13 @@
%h2 Send invitation
= form_for User.new, :url => invitation_path(User) do |f|
= form_for User.new, :url => invitation_path(User) do |invite|
%p
= f.label :email
= f.text_field :email
To
- if @aspect == :all
= f.select(:aspects, @aspects_dropdown_array)
- else
= f.select(:aspects, @aspects_dropdown_array, :selected => [@aspect.to_s, @aspect_id])
%p= f.submit "Send an invitation"
= invite.label :email
= invite.text_field :email
To
- if @aspect == :all
= invite.select(:aspects, @aspects_dropdown_array)
- else
= invite.select(:aspects, @aspects_dropdown_array, :selected => @aspect.id)
%p= invite.submit "Send an invitation"

View file

@ -1,30 +0,0 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- title=t('.new_person')
= form_for @person do |f|
= f.error_messages
%p
= f.label :diaspora_handle
%br
= f.text_field :diaspora_handle
%p
= f.label :url
%br
= f.text_field :url
=f.fields_for :profile do |p|
%p
= p.label :first_name
%br
= p.text_field :first_name
%p
= p.label :last_name
%br
= p.text_field :last_name
= f.submit
%p= link_to t('.back_to_list'), people_path

View file

@ -27,7 +27,6 @@
= link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button"
.span-20.last
.span-19.last
- if @posts
%ul#stream

View file

@ -2,20 +2,16 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h1.big_text
.back
= link_to "⇧ #{@album.name}", album_path(@album)
= "#{t('.editing')} #{@photo.image}"
%h2= "#{t('.editing')} #{@photo.image}"
%div{:id => @photo.id}
#show_photo
= linked_scaled_photo @photo, @album
= form_for @photo do |p|
= p.label :caption
= p.text_field :caption, :value => @photo.caption
= p.submit
= form_for @photo do |photo|
= photo.label :caption
= photo.text_field :caption, :value => @photo.caption
= photo.submit
%div{:class => 'clear'}
#content_bottom

View file

@ -30,7 +30,6 @@
//show form to add description
$(".edit-desc").click(function(){
$(".edit_photo").toggle();
//$(".caption").toggle();
});
//Add a description with ajax request
@ -40,7 +39,6 @@
var url = $(".edit_photo").attr("action");
var data = $(".edit_photo").serialize();
$(".description").text($("#photo_caption").val());
//$(".caption").toggle();
$(".edit_photo").toggle();
$.ajax({
@ -80,13 +78,13 @@
#show_photo
= linked_scaled_photo @photo, @album
.caption
-if current_user.owns? @album
-if current_user.owns? @photo
-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
-if current_user.owns? @photo
%div{:class => 'clear'}
-if !@photo.caption or @photo.caption == ""
= link_to 'Add a description','javascript:void(0)', :id => "add-description", :class => "edit-desc"

View file

@ -6,16 +6,16 @@
=t('.add_a_new_friend_to')
%i= aspect.name
= form_for Request.new do |f|
= f.error_messages
= form_for Request.new do |fr_request|
= fr_request.error_messages
=t('.enter_a_diaspora_username')
%br
%i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
%p
= f.label :destination_url, t(".friends_username")
= f.text_field :destination_url
= f.hidden_field :aspect_id, :value => aspect.id
= f.submit
= fr_request.label :destination_url, t(".friends_username")
= fr_request.text_field :destination_url
= fr_request.hidden_field :aspect_id, :value => aspect.id
= fr_request.submit

View file

@ -13,10 +13,10 @@
- @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends")
- @fb_friends[:data].each do |friend|
= image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" )
-unless (@aspect == :all) || (@aspect == :public)
-unless (@aspect == :all)
= link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button'
.yo{:style => 'display:none'}
.fancybox_content
#add_request_pane
= render "requests/new_request", :aspect => @aspect
-else

View file

@ -12,17 +12,17 @@
#publisher
= owner_image_tag
= form_for StatusMessage.new, :remote => true do |f|
= f.error_messages
= form_for StatusMessage.new, :remote => true do |status|
= status.error_messages
%p
= f.label :message, "Post a message to #{@aspect}"
= f.text_area :message, :rows => 2, :value => params[:prefill]
= status.label :message, "Post a message to #{@aspect}"
= status.text_area :message, :rows => 2, :value => params[:prefill]
= f.hidden_field :to, :value => (@aspect == :all ? @aspect : @aspect.id)
= status.hidden_field :to, :value => (@aspect == :all ? @aspect : @aspect.id)
- if @aspect == :all
.public_toggle
= f.check_box( :public, :value => false )
= status.check_box( :public, :value => false )
make public
= link_to '(?)', "#question_mark_pane", :class => 'question_mark'
@ -31,7 +31,7 @@
= render 'shared/public_explain'
- if @aspect == :all
= f.submit t('.share'), :title => "Share with all aspects"
= status.submit t('.share'), :title => "Share with all aspects"
- else
= f.submit t('.share'), :title => "Share with #{@aspect.name}"
= status.submit t('.share'), :title => "Share with #{@aspect}"

View file

@ -8,8 +8,6 @@
%h2
- if @aspect == :all
= link_to "Everyone", root_path
- elsif @aspect == :public
= "Public"
- elsif @aspect == :manage
= link_to t('.manage_aspects'), root_path
- else

View file

@ -1054,3 +1054,6 @@ header
.fancybox_content
:display none
.edit_photo
:display none