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 'rake'
|
||||
ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__)
|
||||
|
||||
Diaspora::Application.load_tasks
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@
|
|||
- elsif current_user.pending_requests.find_by_person_id(person.id)
|
||||
= link_to =t('.pending_request'), aspects_manage_path
|
||||
- else
|
||||
= form_tag(requests_path) do
|
||||
= select_tag(:aspect_id, @aspects_dropdown_array.join.html_safe)
|
||||
= hidden_field_tag :destination_handle, :value => person.diaspora_handle
|
||||
= submit_tag t('.add_friend')
|
||||
= render :partial => 'requests/new_request_to_person', :locals => {:aspects => @aspects, :person => person}
|
||||
|
||||
.info
|
||||
= person.diaspora_handle
|
||||
|
|
|
|||
|
|
@ -30,10 +30,7 @@
|
|||
.description
|
||||
= t('.request_people')
|
||||
|
||||
= form_tag(requests_path) do
|
||||
= select_tag(:aspect_id, @aspects_dropdown_array.join.html_safe)
|
||||
= hidden_field_tag :destination_handle, :value => @person.diaspora_handle
|
||||
= submit_tag t('.add_friend')
|
||||
= render :partial =>'requests/new_request_to_person', :locals => {:aspects => @aspects, :person => @person}
|
||||
|
||||
- else
|
||||
%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