diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 1f01180dcfdae4e3c1f429fa9ae5a6876f3c930b..d4b2384fc1b29f8f3a5e1e1a8badcb348a50f323 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -25,7 +25,8 @@ class RequestsController < ApplicationController end def create - url = relationship_flow(params[:request][:destination_url]).values.first + url = relationship_flow(params[:request][:destination_url])[:friend] + @request = current_user.send_friend_request_to(url) unless url.include?('@')|| url == '' if @request flash[:notice] = "a friend request was sent to #{@request.destination_url}" diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index 96e1872a9ab5f94fd9a52e36e67b8289f5af95d4..617cafd1bb533079b8ac114bc54c9c0fdf930728 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -36,7 +36,7 @@ module RequestsHelper def relationship_flow(identifier) unless identifier.include?( '@') - return identifier + return {:friend => identifier} end f = Redfinger.finger(identifier) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 6ddbfe23bed0f63119c83f4acb07e0c0fae0f660..85ca17c53142cdb78ad97dc2e6f916cdb1d3685c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -32,7 +32,7 @@ #session_action - if user_signed_in? - = current_user.real_name + = link_to_person current_user | = link_to "requests (#{@request_count})", requests_path, :class => new_request(@request_count) | diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 8ee7948bf17622ce842bbff4b5300e038122e443..fb70081220383b9002727bfa4a311233410c224e 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -3,7 +3,10 @@ %span.from = link_to_person post.person - %b posted a new photo + %b + posted a new photo to + = link_to post.album.name, object_path(post.album) + %br = link_to (image_tag post.image.url(:thumb_medium)), object_path(post) diff --git a/app/views/requests/_form.haml b/app/views/requests/_form.haml index 319265e29287641d3d7b354d0a04ac6e8ca64998..de088d363405211f9837655dd8bfe69875c0b4c2 100644 --- a/app/views/requests/_form.haml +++ b/app/views/requests/_form.haml @@ -1,9 +1,6 @@ -= form_for @request do |f| += form_for @request do |f| = f.error_messages - %p - = f.label :destination_url + .field_with_submit = f.text_field :destination_url - - %p = f.submit diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index d44bdcea05700924eb8a925672149aa8dec1420d..da924b05e273401fe6a4263200913f338a57d406 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -1,9 +1,7 @@ = form_for @request do |f| = f.error_messages - %p - enter a diaspora url, diaspora username, or random email address: - = f.label :destination_url + enter a diaspora url, diaspora username, or random email address: + .field_with_submit = f.text_field :destination_url - %p = f.submit diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index bd1de6ff045cfe903b08adeca1719ba1771690db..e046187a0ca2f0994234a9e38bb35dd791dba93d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -344,3 +344,7 @@ ul#publisher_content_pickers li { border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; } + +.field_with_submit input[type='text'] { + width: 85%; + display: inline; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 9472299828e7dcc93d4aa32ffa0215e32409bd34..eb19e529725b76ce1038efc26610086de4cf75e7 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -416,3 +416,8 @@ ul#publisher_content_pickers li :-webkit-border-radius 3px :-moz-border-radius 3px +.field_with_submit + input[type='text'] + :width 85% + :display inline +