Added welcome and profile actions to the my controller

This commit is contained in:
Christoph Haas 2017-04-23 13:37:48 +02:00
parent 8e4dd058b6
commit 020a864736
12 changed files with 125 additions and 19 deletions

11
app/views/my/_menu.slim Normal file
View file

@ -0,0 +1,11 @@
.menu-centered
ul.menu.icon-top
li class=('active' if action_name=='profile')
= link_to my_profile_path
= fa_icon 'user-o 2x', text: 'Myself'
li
a href='#'
= fa_icon 'image 2x', text: 'My uploads'
li
= link_to destroy_user_session_path, :method => :delete
= fa_icon 'lock 2x', text: 'Logout'

31
app/views/my/profile.slim Normal file
View file

@ -0,0 +1,31 @@
.row
= render partial: 'menu'
h1 As far as we know
h2 Your name
= text_field_tag 'name', current_user.name
p.help-text
' Your name will be shown to others along with the images you upload.
' Feel free to change it.
h2 Your email address
p = current_user.email
p.help-text
' This web site recognizes you by your email address.
' Don't worry - it will not be shown or given to anyone.
h2 Single-sign-on provider
p You logged in using #{current_user.pretty_provider}.
h2 The first time you were here was
p = current_user.created_at.to_formatted_s(:long_ordinal)
h2 Number of screenshots you uploaded
p = current_user.screenshots.count
- if current_user.is_admin?
h2 Admin
p Apparently you are an administrator. Be careful with that thing!

View file

@ -1,20 +1,24 @@
.row
= render partial: 'menu'
.small-8.columns.small-centered
h1 Welcome
.callout.success
h1 Welcome
- if current_user.provider == 'debian-sso'
p
'You have just logged in using your Debian SSO certificate which proves that
'you are associated to the Debian project. So you are invited to upload any
'screenshots. Your uploads will instantly be published and visible in applications
'and web sites that use this service.
- else
p
'You are now logged in. We will associate all your future uploads of screenshots
'with your account. So others can see what you contributed to this site.
- if current_user.provider == 'debian-sso'
p
'You have just logged in using your Debian SSO certificate which proves that
'you are associated to the Debian project. So you are invited to upload any
'screenshots. Your uploads will instantly be published and visible in applications
'and web sites that use this service.
- else
p
'You are now logged in. We will associate all your future uploads of screenshots
'with your account. So others can see what you contributed to this site.
p
' If you want to help then check out the
a href="/packages?show=without" packages that have no screenshots
' yet.
p
' If you want to help then check out the
a href="/packages?show=without" packages that have no screenshots
' yet.