pulled new aspect into modal window
This commit is contained in:
parent
a9a1280e17
commit
c200c386fb
8 changed files with 19 additions and 18 deletions
|
|
@ -7,9 +7,8 @@ class AspectsController < ApplicationController
|
||||||
before_filter :save_sort_order, :only => :index
|
before_filter :save_sort_order, :only => :index
|
||||||
before_filter :ensure_page, :only => :index
|
before_filter :ensure_page, :only => :index
|
||||||
|
|
||||||
respond_to :html
|
respond_to :html, :js
|
||||||
respond_to :json, :only => [:show, :create]
|
respond_to :json, :only => [:show, :create]
|
||||||
respond_to :js
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if params[:a_ids]
|
if params[:a_ids]
|
||||||
|
|
@ -84,6 +83,8 @@ class AspectsController < ApplicationController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@aspect = Aspect.new
|
@aspect = Aspect.new
|
||||||
|
@person_id = params[:person_id]
|
||||||
|
render :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,10 @@
|
||||||
%h4
|
%h4
|
||||||
= t('aspects.manage.add_a_new_aspect')
|
= t('aspects.manage.add_a_new_aspect')
|
||||||
|
|
||||||
= form_for Aspect.new do |aspect|
|
= form_for(Aspect.new, :remote => (defined?(remote) && remote) ) do |aspect|
|
||||||
= aspect.error_messages
|
= aspect.error_messages
|
||||||
|
- if defined?(person_id)
|
||||||
|
= aspect.hidden_field :person_id, :value => person_id
|
||||||
%p
|
%p
|
||||||
= aspect.label :name , t('.name')
|
= aspect.label :name , t('.name')
|
||||||
= aspect.text_field :name, :maxlength => 20
|
= aspect.text_field :name, :maxlength => 20
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
$('ul.dropdown_list[data-person_id=<%= @person.id %>] .newItem').before("<%= escape_javascript( render('contacts/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>");
|
$('ul.dropdown_list[data-person_id=<%= @person.id %>] .newItem').before("<%= escape_javascript( render('contacts/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>");
|
||||||
|
$.facebox.close();
|
||||||
|
$('#profile .dropdown').toggleClass("active");
|
||||||
|
|
||||||
|
|
|
||||||
5
app/views/aspects/new.haml
Normal file
5
app/views/aspects/new.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
= render 'new', :remote => true, :person_id => @person_id
|
||||||
|
|
@ -14,15 +14,4 @@
|
||||||
|
|
||||||
%li.newItem
|
%li.newItem
|
||||||
.add_aspect
|
.add_aspect
|
||||||
= form_for(Aspect.new, :remote => true) do |aspect|
|
= link_to "Add a new aspect", new_aspect_path(:person_id => person.id), :rel => 'facebox'
|
||||||
= aspect.error_messages
|
|
||||||
= aspect.hidden_field :person_id, :value => person.id if person
|
|
||||||
= aspect.hidden_field :share_with, :value => true
|
|
||||||
%p
|
|
||||||
= aspect.text_field :name, :style => "display:inline;"
|
|
||||||
%p.checkbox_select
|
|
||||||
= aspect.label :contacts_visible, t('aspects.edit.make_aspect_list_visible')
|
|
||||||
= aspect.check_box :contacts_visible, :checked => true, :default => true
|
|
||||||
.right
|
|
||||||
= aspect.submit t('contacts.share_with_pane.add_new_aspect'), :class => 'button'
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,4 +58,4 @@
|
||||||
|
|
||||||
.facebox_content
|
.facebox_content
|
||||||
#add_aspect_pane
|
#add_aspect_pane
|
||||||
= render "aspects/new_aspect"
|
= render "aspects/new"
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ en:
|
||||||
no_requests: "No new requests"
|
no_requests: "No new requests"
|
||||||
manage_aspects: "Manage aspects"
|
manage_aspects: "Manage aspects"
|
||||||
drag_to_add: "Drag to add people"
|
drag_to_add: "Drag to add people"
|
||||||
new_aspect:
|
new:
|
||||||
name: "Name"
|
name: "Name"
|
||||||
create: "Create"
|
create: "Create"
|
||||||
create:
|
create:
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,9 @@ Feature: sending and receiving requests
|
||||||
When I sign in as "alice@alice.alice"
|
When I sign in as "alice@alice.alice"
|
||||||
And I am on "bob@bob.bob"'s page
|
And I am on "bob@bob.bob"'s page
|
||||||
|
|
||||||
And I press the first ".share_with.button" within "#author_info"
|
And I press the first ".toggle.button"
|
||||||
|
And I press the first "a" within ".add_aspect"
|
||||||
|
And I wait for the ajax to finish
|
||||||
|
|
||||||
And I fill in "Name" with "Super People" in the modal window
|
And I fill in "Name" with "Super People" in the modal window
|
||||||
And I press "aspect_submit" in the modal window
|
And I press "aspect_submit" in the modal window
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue