]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Encourage people to complete their profile on the profile page
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Nov 2020 17:29:31 +0000 (17:29 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Nov 2020 17:29:31 +0000 (17:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/people/index.html
src/templates/people/user.html
src/web/people.py

index ad461e156f2dd8acf756bcb4f08d1ea0ac03831c..bbf4ab8b9b523bd28d0a97d83bb48752b6e9182c 100644 (file)
                </div>
 
                {% if not current_user.consents_to_promotional_emails %}
-                       <div class="card glow-primary border-primary">
-                               <div class="card-body">
-                                       <h6>{{ _("You are currently not subscribed to important updates from the IPFire Project") }}</h6>
-
-                       <div class="row">
-                           <div class="col-2 d-flex align-items-center justify-content-center">
-                               <i class="fas fa-envelope-open-text fa-3x text-primary"></i>
-                           </div>
-
-                           <div class="col-10 col-lg-6 mb-3 mb-lg-0">
-                               <p class="card-text">
-                                   {{ _("Subscribe to receive notifications about important security updates of IPFire and other news from inside the project") }}
-                               </p>
-                           </div>
-
-                           <div class="col-12 col-lg-4">
-                                                       <form action="/subscribe" method="POST">
-                                                               {% raw xsrf_form_html() %}
-
-                                                               <button type="submit" class="btn btn-success btn-block">
-                                                                       {{ _("Subscribe Now") }}
-                                                               </button>
-                                                       </form>
-                           </div>
-                       </div>
-                               </div>
-                       </div>
-               {% end %}
-
-               {% if hints %}
-                       <div class="card my-5">
+                       <div class="card border-primary">
                                <div class="card-body">
                                        <div class="row">
-                                               <div class="col-12 col-md-2 text-center">
-                                                       <i class="far fa-smile-wink fa-4x my-3"></i>
+                                               <div class="col-2 d-flex align-items-center justify-content-center">
+                                                       <i class="fas fa-envelope-open-text fa-3x text-primary"></i>
                                                </div>
 
-                                               <div class="col-12 col-md-10">
-                                                       <h4 class="mb-0">{{ _("Tell us more about you!") }}</h4>
-                                                       <p>
-                                                               {{ _("Become a part of our community and allow other people to connect with you!") }}
+                                               <div class="col-10 mb-3">
+                                                       <h6 class="card-title">{{ _("You are currently not subscribed to important updates from the IPFire Project") }}</h6>
+
+                                                       <p class="card-text">
+                                                               {{ _("Subscribe to receive notifications about important security updates of IPFire and other news from inside the project") }}
                                                        </p>
                                                </div>
                                        </div>
-                               </div>
-
-                               <div class="list-group list-group-flush">
-                                       {% for hint in hints %}
-                                               <a class="list-group-item list-group-item-action" href="/users/{{ current_user.uid }}/edit">
-                                                       {% if hint == "avatar" %}
-                                                               <h6 class="mb-0">{{ _("Upload an avatar!") }}</h6>
 
-                                                               <p class="card-text">
-                                                                       {{ _("A picture says more than a thousand words.") }}
-                                                               </p>
-                                                       {% elif hint == "description" %}
-                                                               <h6 class="mb-0">{{ _("Tell Us Who You Are!" ) }}</h6>
+                                       <form action="/subscribe" method="POST">
+                                               {% raw xsrf_form_html() %}
 
-                                                               <p class="card-text">
-                                                                       {{ _("Add a couple of lines about yourself to your profile so that others get to know you better!") }}
-                                                               </p>
-                                                       {% end %}
-                                               </a>
-                                       {% end %}
+                                               <button type="submit" class="btn btn-success btn-block">
+                                                       {{ _("Subscribe Now") }}
+                                               </button>
+                                       </form>
                                </div>
                        </div>
                {% end %}
index 1ab1a15972d870a4ac98911e09bb9f1031da924c..7623be2111d252833312f9b365f2a659c5549147 100644 (file)
@@ -1,5 +1,7 @@
 {% extends "../base.html" %}
 
+{% block title %}{{ account }}{% end block %}
+
 {% block container %}
        {% import phonenumbers %}
 
        {% if current_user == account or current_user.is_staff() %}
                <div class="container">
                        <section>
+                               {% if account == current_user %}
+                                       {# Suggest adding a description #}
+                                       {% if not current_user.description %}
+                                               <div class="alert alert-info">
+                                                       <h6 class="alert-heading">{{ _("Tell Us About Yourself" ) }}</h6>
+
+                                                       <p class="mb-0">
+                                                               {{ _("Add a couple of lines about yourself to your profile so that others get to know you better") }}
+
+                                                               <a class="alert-link" href="/users/{{ account.uid }}/edit#description">{{ _("Edit Profile") }}</a>
+                                                       </p>
+                                               </div>
+
+                                       {# Suggest uploading an avatar if this user does not have one #}
+                                       {% elif not current_user.has_avatar() %}
+                                               <div class="alert alert-info">
+                                                       <h6 class="alert-heading">{{ _("Upload An Avatar" ) }}</h6>
+
+                                                       <p class="mb-0">
+                                                               {{ _("A picture says more than a thousand words") }}
+
+                                                               <a class="alert-link" href="/users/{{ account.uid }}/edit#avatar">{{ _("Upload Avatar") }}</a>
+                                                       </p>
+                                               </div>
+                                       {% end %}
+                               {% end %}
+
                                <div class="row">
                                        <div class="col-12 col-lg-6">
                                                {% if current_user.is_staff() %}
index 9622aca347aed00b334381e8e617cf718b0691a9..5a3f3da63141ad8fbc591b8143825b4ff74cae5a 100644 (file)
@@ -22,17 +22,7 @@ COLOUR_DARK  = (49,53,60)
 class IndexHandler(auth.CacheMixin, base.BaseHandler):
        @tornado.web.authenticated
        def get(self):
-               hints = []
-
-               # Suggest uploading an avatar if this user does not have one
-               if not self.current_user.has_avatar():
-                       hints.append("avatar")
-
-               # Suggest adding a description
-               if not self.current_user.description:
-                       hints.append("description")
-
-               self.render("people/index.html", hints=hints)
+               self.render("people/index.html")
 
 
 class AvatarHandler(base.BaseHandler):