Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
23039388
Commit
23039388
authored
9 years ago
by
Mateus Rambo Strey
Browse files
Options
Downloads
Patches
Plain Diff
fix user page when user is not logged in
parent
c3f7d484
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/helpers/users_helper.rb
+3
-2
3 additions, 2 deletions
app/helpers/users_helper.rb
app/views/follows/_button.html.erb
+4
-2
4 additions, 2 deletions
app/views/follows/_button.html.erb
app/views/users/_header.html.erb
+1
-1
1 addition, 1 deletion
app/views/users/_header.html.erb
with
8 additions
and
5 deletions
app/helpers/users_helper.rb
+
3
−
2
View file @
23039388
module
UsersHelper
def
current_user_page?
(
user
)
current_user
.
id
==
user
.
id
return
current_user
.
id
==
user
.
id
if
user_signed_in?
false
end
def
learning_objects_number
(
learning_objects
)
...
...
@@ -23,4 +24,4 @@ module UsersHelper
render
"users/user_horizontal"
,
user:
user
end
end
\ No newline at end of file
end
This diff is collapsed.
Click to expand it.
app/views/follows/_button.html.erb
+
4
−
2
View file @
23039388
<%
follow_text
=
current_user
.
following?
(
followable
)
?
'Deixar de seguir'
:
'Seguir'
%>
<%=
link_to
follow_text
,
follow_user_path
(
id:
current_user
.
id
,
followable_type:
followable
.
class
.
name
,
followable_id:
followable
.
id
),
method: :post
,
remote:
true
,
class:
'btn btn-default follow-button'
%>
<%
if
user_signed_in?
%>
<%
follow_text
=
current_user
.
following?
(
followable
)
?
'Deixar de seguir'
:
'Seguir'
%>
<%=
link_to
follow_text
,
follow_user_path
(
id:
current_user
.
id
,
followable_type:
followable
.
class
.
name
,
followable_id:
followable
.
id
),
method: :post
,
remote:
true
,
class:
'btn btn-default follow-button'
%>
<%
end
%>
This diff is collapsed.
Click to expand it.
app/views/users/_header.html.erb
+
1
−
1
View file @
23039388
...
...
@@ -2,7 +2,7 @@
<div
class=
"col-md-6"
>
<div
class=
"media"
>
<div
class=
"media-left"
>
<%
if
current_user
.
id
==
user
.
id
and
current_user
.
provider
==
"email"
%>
<%
if
user_signed_in?
&&
current_user
.
id
==
user
.
id
&&
current_user
.
provider
==
"email"
%>
<%=
link_to
edit_user_registration_path
do
image_tag
user
.
avatar
.
url
(
:thumb
),
class:
'user-image'
end
%>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment