Skip to content

Commit

Permalink
Move user info elements and add switch for beta program
Browse files Browse the repository at this point in the history
  • Loading branch information
saraycp committed Aug 21, 2019
1 parent d26f5c9 commit e213a49
Showing 1 changed file with 38 additions and 36 deletions.
74 changes: 38 additions & 36 deletions src/api/app/views/webui2/webui/user/_info.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
.card-body
= image_tag_for(user)

- if is_user && user.in_beta?
%p.bg-info.text-light.text-center
In public beta program
%h4.mb-0.mt-4#home-realname
= user.realname
%h5.d-inline-block.mb-0.align-middle.text-muted#home-login= user.login
%h5.d-inline-block.mb-0.align-middle.text-muted#home-login
= user.login
- if User.session
= mail_to(user.email, title: "Send mail to #{user.name}", class: 'd-block') do
%i.fas.fa-envelope
= user.email
- role_titles.each do |title|
%span.badge.badge-secondary
= title.upcase

- if groups.any?
.my-3
.mt-4
Member of the #{'group'.pluralize(groups.size)}
%ul
- groups.each do |group|
Expand All @@ -23,37 +25,37 @@
%span.badge.badge-primary.align-baseline
#{group.tasks} #{'task'.pluralize(group.tasks)}

- if User.session
= mail_to(user.email, title: "Send mail to #{user.name}", class: 'd-block') do
%i.fas.fa-envelope
= user.email
- if is_user
- if user.in_beta?
= link_to(user_save_path(user: { login: user.login, in_beta: 0 }), method: :post, class: 'd-block') do
%i.fas.fa-sign-out-alt
Leave public beta program
- else
= link_to(user_save_path(user: { login: user.login, in_beta: 1 }), method: :post, class: 'd-block') do
%i.fas.fa-sign-in-alt
Join public beta program
- if configuration.accounts_editable?(user)
- if account_edit_link.present?
= link_to(account_edit_link, class: 'd-block') do
%i.fas.fa-user-edit
Edit your account
.mt-4
- if user.in_beta?
= link_to(user_save_path(user: { login: user.login, in_beta: 0 }), method: :post) do
%i.fas.fa-toggle-on.text-primary
%span Leave public beta program
- else
= link_to('#', data: { toggle: 'modal', target: '#edit-modal' }, class: 'd-block') do
%i.fas.fa-user-edit
Edit your account
- if configuration.passwords_changable?(user)
= link_to('#', data: { toggle: 'modal', target: '#password-modal' }, class: 'd-block') do
%i.fas.fa-key
Change your password
= link_to(user_notifications_path, class: 'd-block') do
%i.fas.fa-bell
Change your notifications
- if user.rss_token
= link_to(user_rss_notifications_path(token: user.rss_token.string, format: 'rss'), title: 'RSS Feed for Notifications', class: 'd-block') do
%i.fas.fa-rss-square
RSS for notifications
= link_to(user_save_path(user: { login: user.login, in_beta: 1 }), method: :post) do
%i.fas.fa-toggle-off.text-primary
%span Join public beta program

.mt-4
- if configuration.accounts_editable?(user)
- if account_edit_link.present?
= link_to(account_edit_link, class: 'd-block') do
%i.fas.fa-user-edit
Edit your account
- else
= link_to('#', data: { toggle: 'modal', target: '#edit-modal' }, class: 'd-block') do
%i.fas.fa-user-edit
Edit your account
- if configuration.passwords_changable?(user)
= link_to('#', data: { toggle: 'modal', target: '#password-modal' }, class: 'd-block') do
%i.fas.fa-key
Change your password
= link_to(user_notifications_path, class: 'd-block') do
%i.fas.fa-bell
Change your notifications
- if user.rss_token
= link_to(user_rss_notifications_path(token: user.rss_token.string, format: 'rss'),
title: 'RSS Feed for Notifications', class: 'd-block') do
%i.fas.fa-rss-square
RSS for notifications

0 comments on commit e213a49

Please sign in to comment.