public inbox for [email protected]
help / color / mirror / Atom feedFrom: Murtuza Zabuawala <[email protected]>
To: Joao De Almeida Pereira <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin4][RM#3037] Allow user to disable Gravatar image
Date: Mon, 5 Mar 2018 21:51:30 +0530
Message-ID: <CAKKotZR3c-hJ=AkRQ=jA4sp3CNQoY787du1G-nrmnOA2GheK3w@mail.gmail.com> (raw)
In-Reply-To: <CAE+jja=CRKv6vSKPie4Nzrffnzs_YOYpp=GQFmfsPi1MHtzp6w@mail.gmail.com>
References: <CAKKotZQynh9AcUpyVPj0aVDOBjvUH7mYRJb5Cc1=Spzg_LBD_g@mail.gmail.com>
<CAE+jja=CRKv6vSKPie4Nzrffnzs_YOYpp=GQFmfsPi1MHtzp6w@mail.gmail.com>
Hi Joao,
We are using Flask-Gravatar <https://pythonhosted.org/Flask-Gravatar/;
module for this and it is designed to work with template only.
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Mon, Mar 5, 2018 at 8:57 PM, Joao De Almeida Pereira <
[email protected]> wrote:
> 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 <murtuza.zabuawala@
> enterprisedb.com> 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: <CAKKotZR3c-hJ=AkRQ=jA4sp3CNQoY787du1G-nrmnOA2GheK3w@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