diff --git a/app/views/user/settings.volt b/app/views/user/settings.volt index 6ff4dc6..3f3af81 100644 --- a/app/views/user/settings.volt +++ b/app/views/user/settings.volt @@ -1,3 +1,10 @@ +{% + set social_links = [ + 'github' : [ 'connected': user.getGithubId() > 0 ], + 'gitlab' : [ 'connected': user.getGitlabId() > 0, 'class': 'text-gitlab' ], + 'google' : [ 'connected': user.getGoogleId() > 0, 'class': 'text-google' ] + ] +%}
@@ -44,33 +51,17 @@
+ {% for name,info in social_links %}
-
{{ icon('brand/github', [ '3x' ]) }}
- {% if user.getGithubId() > 0 %} - Disconnect + {% set class = info['class'] | default(false) %} + {{ icon('brand/' ~ name, [ '3x' ]) }}
+ {% if info['connected'] %} + Disconnect {% else %} - Connect + Connect {% endif %}
- -
-
{{ icon('brand/gitlab', [ '3x' ]) }}
- {% if user.getGitlabId() > 0 %} - Disconnect - {% else %} - Connect - {% endif %} -
- -
-
{{ icon('brand/google', [ '3x' ]) }}
- {% if user.getGoogleId() > 0 %} - Disconnect - {% else %} - Connect - {% endif %} - -
+ {% endfor %}