From ffd2416c5636917c0da0a3376342d6c465bb1954 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Sat, 16 Apr 2016 09:28:04 -0400 Subject: Make a user available for the user variable --- app/controllers/help_controller.rb | 6 ++++++ app/views/help/ui.html.haml | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 55050615473..406142f29c7 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -51,6 +51,12 @@ class HelpController < ApplicationController end def ui + # this will work on gitlab.com + @some_user = User.find_by(username: 'dzaporozhets') + if @some_user.nil? + # this will work in dev + @some_user = User.find(1) + end end private diff --git a/app/views/help/ui.html.haml b/app/views/help/ui.html.haml index d084559abc3..64414f5d8b2 100644 --- a/app/views/help/ui.html.haml +++ b/app/views/help/ui.html.haml @@ -345,11 +345,11 @@ %ul %li %a.dropdown-menu-user-link.is-active{href: "#"} - = link_to_member_avatar(current_user, size: 30) + = link_to_member_avatar(@some_user, size: 30) %strong.dropdown-menu-user-full-name - = current_user.name + = @some_user.name .dropdown-menu-user-username - = current_user.to_reference + = @some_user.to_reference .example %div @@ -372,11 +372,11 @@ %ul %li %a.dropdown-menu-user-link.is-active{href: "#"} - = link_to_member_avatar(current_user, size: 30) + = link_to_member_avatar(@some_user, size: 30) %strong.dropdown-menu-user-full-name - = current_user.name + = @some_user.name .dropdown-menu-user-username - = current_user.to_reference + = @some_user.to_reference .dropdown-page-two .dropdown-title %button.dropdown-title-button.dropdown-menu-back{aria: {label: "Go back"}} -- cgit v1.2.1 From e79b0dd762719828203bd48c253a88d876bcf61a Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Sat, 16 Apr 2016 16:00:30 -0400 Subject: Simplify random user generation. --- app/controllers/help_controller.rb | 7 +------ app/views/help/ui.html.haml | 12 ++++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 406142f29c7..9b5c43b17e2 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -51,12 +51,7 @@ class HelpController < ApplicationController end def ui - # this will work on gitlab.com - @some_user = User.find_by(username: 'dzaporozhets') - if @some_user.nil? - # this will work in dev - @some_user = User.find(1) - end + @user = User.new(id: 0, name: 'John Doe', username: '@johndoe') end private diff --git a/app/views/help/ui.html.haml b/app/views/help/ui.html.haml index 64414f5d8b2..f12df5c8ffe 100644 --- a/app/views/help/ui.html.haml +++ b/app/views/help/ui.html.haml @@ -345,11 +345,11 @@ %ul %li %a.dropdown-menu-user-link.is-active{href: "#"} - = link_to_member_avatar(@some_user, size: 30) + = link_to_member_avatar(@user, size: 30) %strong.dropdown-menu-user-full-name - = @some_user.name + = @user.name .dropdown-menu-user-username - = @some_user.to_reference + = @user.to_reference .example %div @@ -372,11 +372,11 @@ %ul %li %a.dropdown-menu-user-link.is-active{href: "#"} - = link_to_member_avatar(@some_user, size: 30) + = link_to_member_avatar(@user, size: 30) %strong.dropdown-menu-user-full-name - = @some_user.name + = @user.name .dropdown-menu-user-username - = @some_user.to_reference + = @user.to_reference .dropdown-page-two .dropdown-title %button.dropdown-title-button.dropdown-menu-back{aria: {label: "Go back"}} -- cgit v1.2.1