Skip to content

Commit 9eda6a2

Browse files
committed
Check if addresses are NULL or empty to display
1 parent 780f4e8 commit 9eda6a2

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/views/admin/accounts/index.html.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
= image_tag "/images/icones/check.svg", alt: "Actif", title: "Actif", width: "16px"
2929
%br
3030
= account.email
31-
- if account.user.homesite
31+
- if account.user.homesite.present?
3232
%br
3333
= account.user.homesite
34-
- if account.user.jabber_id
34+
- if account.user.jabber_id.present?
3535
%br
3636
= account.user.jabber_id
37-
- if account.user.mastodon_url
37+
- if account.user.mastodon_url.present?
3838
%br
3939
= account.user.mastodon_url
4040
%td= account.karma

app/views/users/_recent.html.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
%li Dernière connexion : #{a.current_sign_in_at ? l(@user.account.current_sign_in_at) : "-"}
1212
%li Dernière action : #{a.updated_at ? l(@user.account.updated_at) : "-"}
1313
%li Karma : #{a.karma} (minimum : #{a.min_karma}, maximum : #{a.max_karma})
14-
- if @user.homesite
14+
- if @user.homesite.present?
1515
%li Site perso : #{@user.homesite}
16-
- if @user.jabber_id
16+
- if @user.jabber_id.present?
1717
%li XMPP : #{@user.jabber_id}
18-
- if @user.mastodon_url
18+
- if @user.mastodon_url.present?
1919
%li Mastodon : #{@user.mastodon_url}
2020
- if current_account.admin?
2121
%p Visibilité

app/views/users/_user.html.haml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
- unless user.account && user.account.active_for_authentication?
77
%p
88
Compte fermé
9-
- if user.homesite
9+
- if user.homesite.present?
1010
%p
1111
Site Web personnel : #{link_to user.homesite, user.homesite, class: 'url me'}
12-
- if current_account && user.jabber_id
12+
- if current_account && user.jabber_id.present?
1313
%p
1414
Adresse XMPP : #{link_to 'xmpp:' + user.jabber_id, 'xmpp:' + user.jabber_id, class: 'url'}
15-
- if current_account && user.mastodon_url
15+
- if current_account && user.mastodon_url.present?
1616
%p
1717
Adresse Mastodon : #{link_to 'Mastodon', user.mastodon_url, class: 'url'}

app/views/users/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
=h1 "#{@user.name} a écrit #{pluralize @nodes.total_count, "contenu"} de type dépêche ou journal"
66
- feed "Flux Atom de #{@user.name}", "/users/#{@user.to_param}.atom"
7-
- if @user.mastodon_url and @user.account.try(:karma).to_i > 0
7+
- if @user.mastodon_url.present? and @user.account.try(:karma).to_i > 0
88
- link "me", @user.mastodon_url
99
- filter_pagination_params ['id', 'order', 'page']
1010
= paginated_nodes @nodes

0 commit comments

Comments
 (0)