public inbox for [email protected]  
help / color / mirror / Atom feed
From: Joao De Almeida Pereira <[email protected]>
To: Murtuza Zabuawala <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin4][RM#3037] Allow user to disable Gravatar image
Date: Mon, 05 Mar 2018 15:27:28 +0000
Message-ID: <CAE+jja=CRKv6vSKPie4Nzrffnzs_YOYpp=GQFmfsPi1MHtzp6w@mail.gmail.com> (raw)
In-Reply-To: <CAKKotZQynh9AcUpyVPj0aVDOBjvUH7mYRJb5Cc1=Spzg_LBD_g@mail.gmail.com>
References: <CAKKotZQynh9AcUpyVPj0aVDOBjvUH7mYRJb5Cc1=Spzg_LBD_g@mail.gmail.com>

Hi Murtuza,

Why are we doing this using templates? Can this be done with a request to
the backend to get the image and then retrieve the Gravatar if it is
defined or return a static image if not?

+
+{% if config.SERVER_MODE %}
 window.onload = function(e){
  setTimeout(function() {
-   var gravatarImg = '<img src="{{ username | gravatar }}" width="18"
height="18" alt="Gravatar image for {{ username }}"> {{ username }} <span
class="caret"></span>';
+   var gravatarImg = {{ IMG.PREPARE_HTML()|safe }}
    //$('#navbar-menu .navbar-right > li > a').html(gravatarImg);
    var navbarRight =
document.getElementById("navbar-menu").getElementsByClassName("navbar-right")[0];
    if (navbarRight) {

what if we have

var gravatarImg = '<img src="/user/{{username}}/gravatar" width="18"
height="18" alt="Gravatar image for {{ username }}"> {{ username }} <span
class="caret"></span>';

And then the endpoint
/user/{{username}}/gravatar
would be responsible for returning a Gravatar or not depending on the
configuration?


Thanks
Joao

On Mon, Mar 5, 2018 at 3:13 AM Murtuza Zabuawala <
[email protected]> wrote:

> Hi,
>
> PFA patch to disable Gravatar image in Server mode.
>
> Requirments & Issues:
> - For security reasons.
> - For systems which do not have internet access.
> - Hangs pgAdmin4 while loading the page if connection has no internet
> access (as described in the ticket)
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


view thread (11+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [pgAdmin4][RM#3037] Allow user to disable Gravatar image
  In-Reply-To: <CAE+jja=CRKv6vSKPie4Nzrffnzs_YOYpp=GQFmfsPi1MHtzp6w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox