Fix request views, refactor identical forms into partial.
This commit is contained in:
parent
8232a92ca0
commit
d62a7c4ce2
4 changed files with 12 additions and 9 deletions
1
Rakefile
1
Rakefile
|
|
@ -7,6 +7,5 @@
|
||||||
|
|
||||||
require File.expand_path('../config/application', __FILE__)
|
require File.expand_path('../config/application', __FILE__)
|
||||||
require 'rake'
|
require 'rake'
|
||||||
ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__)
|
|
||||||
|
|
||||||
Diaspora::Application.load_tasks
|
Diaspora::Application.load_tasks
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,7 @@
|
||||||
- elsif current_user.pending_requests.find_by_person_id(person.id)
|
- elsif current_user.pending_requests.find_by_person_id(person.id)
|
||||||
= link_to =t('.pending_request'), aspects_manage_path
|
= link_to =t('.pending_request'), aspects_manage_path
|
||||||
- else
|
- else
|
||||||
= form_tag(requests_path) do
|
= render :partial => 'requests/new_request_to_person', :locals => {:aspects => @aspects, :person => person}
|
||||||
= select_tag(:aspect_id, @aspects_dropdown_array.join.html_safe)
|
|
||||||
= hidden_field_tag :destination_handle, :value => person.diaspora_handle
|
|
||||||
= submit_tag t('.add_friend')
|
|
||||||
|
|
||||||
.info
|
.info
|
||||||
= person.diaspora_handle
|
= person.diaspora_handle
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,7 @@
|
||||||
.description
|
.description
|
||||||
= t('.request_people')
|
= t('.request_people')
|
||||||
|
|
||||||
= form_tag(requests_path) do
|
= render :partial =>'requests/new_request_to_person', :locals => {:aspects => @aspects, :person => @person}
|
||||||
= select_tag(:aspect_id, @aspects_dropdown_array.join.html_safe)
|
|
||||||
= hidden_field_tag :destination_handle, :value => @person.diaspora_handle
|
|
||||||
= submit_tag t('.add_friend')
|
|
||||||
|
|
||||||
- else
|
- else
|
||||||
%h3
|
%h3
|
||||||
|
|
|
||||||
10
app/views/requests/_new_request_to_person.haml
Normal file
10
app/views/requests/_new_request_to_person.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
= form_tag(requests_path) do
|
||||||
|
- pp person
|
||||||
|
- pp aspects
|
||||||
|
= select_tag(:aspect_id, options_from_collection_for_select(aspects, "id", "name"))
|
||||||
|
= hidden_field_tag :destination_handle, :value => person.diaspora_handle
|
||||||
|
= submit_tag t('people.person.add_friend')
|
||||||
Loading…
Reference in a new issue