]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_blocks_controller.rb
Use resourceful routes for api messages in/outbox
[rails.git] / app / controllers / user_blocks_controller.rb
index 7d61366be9e071f0cd0360d48bf00ba22b968635..551371794240836b53110059bd945b979c9cc287 100644 (file)
@@ -25,11 +25,11 @@ class UserBlocksController < ApplicationController
     @show_user_name = true
     @show_creator_name = true
 
-    render :partial => "blocks" if turbo_frame_request_id == "pagination"
+    render :partial => "page" if turbo_frame_request_id == "pagination"
   end
 
   def show
-    if current_user && current_user == @user_block.user
+    if current_user && current_user == @user_block.user && !@user_block.deactivates_at
       @user_block.needs_view = false
       @user_block.deactivates_at = [@user_block.ends_at, Time.now.utc].max
       @user_block.save!
@@ -64,7 +64,7 @@ class UserBlocksController < ApplicationController
         render :action => "new"
       end
     else
-      redirect_to new_user_block_path(:display_name => params[:display_name])
+      redirect_to new_user_block_path(params[:display_name])
     end
   end
 
@@ -101,7 +101,7 @@ class UserBlocksController < ApplicationController
         end
       end
     else
-      redirect_to edit_user_block_path(:id => params[:id])
+      redirect_to edit_user_block_path(params[:id])
     end
   end
 
@@ -127,7 +127,7 @@ class UserBlocksController < ApplicationController
     @show_user_name = false
     @show_creator_name = true
 
-    render :partial => "blocks" if turbo_frame_request_id == "pagination"
+    render :partial => "page" if turbo_frame_request_id == "pagination"
   end
 
   ##
@@ -142,7 +142,7 @@ class UserBlocksController < ApplicationController
     @show_user_name = true
     @show_creator_name = false
 
-    render :partial => "blocks" if turbo_frame_request_id == "pagination"
+    render :partial => "page" if turbo_frame_request_id == "pagination"
   end
 
   private