From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tatiana Sholokhova Subject: Re: GSoC: Adding a web interface similar to the Hydra web interface Date: Thu, 24 May 2018 00:06:48 +0300 Message-ID: References: <87vac3twbe.fsf@gnu.org> <87o9hog2ye.fsf@elephly.net> <87d0xyn9zs.fsf@elephly.net> <87d0xswvls.fsf@elephly.net> <87r2m4ntk4.fsf@mdc-berlin.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c5e9a9056ce5e906" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLayE-0004dv-42 for guix-devel@gnu.org; Wed, 23 May 2018 17:06:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLayC-00047V-G3 for guix-devel@gnu.org; Wed, 23 May 2018 17:06:54 -0400 In-Reply-To: <87r2m4ntk4.fsf@mdc-berlin.de> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel --000000000000c5e9a9056ce5e906 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ricardo, Thanks for the helpful answer. Now I almost figured out how to serve static files. I have committed the first HTML template page (with table of specifications stored in the database) to web-interface branch. Can you please review it? I am a bit confused about the database structure. As far as I understand, there are project_name (project) and branch_name (jobset) properties, but project_name is a primary key, so a project can't have several branches? I'm working on static file serving but I don't know how to set the path of the static file directory. Now I just wrote my absolute path to the style.css file. So, I have two questions. 1. Where should I place the static files? 2. How can I execute getcwd function (as you do it in rcas-web/rcas/config.scm.in)? I tried to add something like (define-public %current-directory `(,(getcwd))) to my config.scm.in but it does not work. Best regards, Tatiana Sholokhova 2018-05-22 8:33 GMT+03:00 Ricardo Wurmus : > > Hi Tatiana, > > > I have already created a small module implementing basic HTML templates > in > > Scheme. Also, I have made an extension to the Cuirass Web API. It > responds > > on the "/status" request and generates a page with a minimalistic HTML > > table displaying the list of specifications stored in the database. > > Excellent. > > > My login on Savannah is "TSholokhova". I am looking forward to making m= y > > first commit. I would be glad to receive comments on my code to be sure > > that I am moving in the right direction. > > The Cuirass repository is available at > http://git.savannah.gnu.org/cgit/guix/guix-cuirass.git > > I have added your account to the group, so you should have write access > to the repository now. Please push your commits to a new branch on that > repository. Please also read the section =E2=80=9CCoding Style=E2=80=9D = in the Guix > manual. > > You are welcome to rewrite your own published commits in your own > branch, but not in other branches. When you want us to comment on your > work, please let us know the range of commits that you would like us to > review. Ideally, we would be able to merge your work into the =E2=80=9Cm= aster=E2=80=9D > branch regularly. > > > You have mentioned that many users would prefer an interface working > > without javascript running. Am I right that we would like to have a > > non-interactive (js-free) interface working and also add some > functionality > > (e. g. search tools for tables) via javascript? > > Yes, this sounds like a good idea. It is not absolutely necessary, but > it would be nice if basic features of the interface would still be > usable even when JavaScript is disabled. > > > Also, I have a couple of questions regarding the frontend part. What > > frontend framework we would prefer? If I get it right, Hydra uses > > Bootstrap. > > It is fine to use Bootstrap. Please include the unminified Bootstrap > CSS and JS files to the repository. It is easy to minify them later, > but it is virtually impossible to turn minified code into something > readable. > > > For the frontend implementation, we need to include some static > > css&js files in the interface and serve them somehow. Is it a good idea > to > > serve the static files by Cuirass web server in Scheme? > > Yes, this can be done by the Cuirass web server in Scheme. > > In the web interface for RCAS I=E2=80=99m dispatching to =E2=80=9Crender-= static-asset=E2=80=9D > in the controller: > > https://github.com/BIMSBbioinfo/rcas-web/blob/ > master/rcas/web/controller.scm > > =E2=80=9Crender-static-asset=E2=80=9D is defined here: > > https://github.com/BIMSBbioinfo/rcas-web/blob/ > master/rcas/web/render.scm#L65 > > As you can see, this module defines a bunch of mime types and includes > the appropriate type in the headers along with the contents of the file > it serves. > > Hope this helps! > > -- > Ricardo > > > --000000000000c5e9a9056ce5e906 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ricardo,

Thanks for the h= elpful answer. Now I almost figured=C2=A0out how to serve static files.

I have committed the first HTML template page (with t= able of specifications stored in the database) to web-interface branch. Can= you please review it?

I am a bit confused about t= he database structure. As far as I understand, there are project_name (proj= ect) and branch_name (jobset) properties, but project_name is a primary key= , so a project can't have several branches?=C2=A0

<= div>I'm working on static file serving but I don't know how to set = the path of the static file directory. Now I just wrote my absolute path to= the style.css file. So, I have two questions. 1. Where should I place the = static files? 2. How can I execute getcwd function (as you do it in rcas-we= b/rcas/config.scm.in)? I tried to add = something=C2=A0like

(define-public %cur= rent-directory
`(,(getcw= d)))=C2=A0

to my config.scm.in but it does not work.

Bes= t regards,=C2=A0
Tatiana Sholokhova

2018-05-22 8:33 GMT+03:00 Ricardo W= urmus <rekado@elephly.net>:

Hi Tatiana,

> I have already created a small module implementing basic HTML template= s in
> Scheme. Also, I have made an extension to the Cuirass Web API. It resp= onds
> on the "/status" request and generates a page with a minimal= istic HTML
> table displaying the list of specifications stored in the database.
Excellent.

> My login on Savannah is "TSholokhova". I am looking forward = to making my
> first commit. I would be glad to receive comments on my code to be sur= e
> that I am moving in the right direction.

The Cuirass repository is available at
http://git.savannah.gnu.org/cgit/guix/gui= x-cuirass.git

I have added your account to the group, so you should have write access
to the repository now.=C2=A0 Please push your commits to a new branch on th= at
repository.=C2=A0 Please also read the section =E2=80=9CCoding Style=E2=80= =9D in the Guix
manual.

You are welcome to rewrite your own published commits in your own
branch, but not in other branches.=C2=A0 When you want us to comment on you= r
work, please let us know the range of commits that you would like us to
review.=C2=A0 Ideally, we would be able to merge your work into the =E2=80= =9Cmaster=E2=80=9D
branch regularly.

> You have mentioned that many users would prefer an interface working > without javascript running. Am I right that we would like to have a > non-interactive (js-free) interface working and also add some function= ality
> (e. g. search tools for tables) via javascript?

Yes, this sounds like a good idea.=C2=A0 It is not absolutely necess= ary, but
it would be nice if basic features of the interface would still be
usable even when JavaScript is disabled.

> Also, I have a couple of questions regarding the frontend part. What > frontend framework we would prefer? If I get it right, Hydra uses
> Bootstrap.

It is fine to use Bootstrap.=C2=A0 Please include the unminified Boo= tstrap
CSS and JS files to the repository.=C2=A0 It is easy to minify them later,<= br> but it is virtually impossible to turn minified code into something
readable.

> For the frontend implementation, we need to include some static
> css&js files in the interface and serve them somehow. Is it a good= idea to
> serve the static files by Cuirass web server in Scheme?

Yes, this can be done by the Cuirass web server in Scheme.

In the web interface for RCAS I=E2=80=99m dispatching to =E2=80=9Crender-st= atic-asset=E2=80=9D
in the controller:

=C2=A0 =C2=A0 https://gi= thub.com/BIMSBbioinfo/rcas-web/blob/master/rcas/web/controller.sc= m

=E2=80=9Crender-static-asset=E2=80=9D is defined here:

=C2=A0 =C2=A0 https://gi= thub.com/BIMSBbioinfo/rcas-web/blob/master/rcas/web/render.scm#L6= 5

As you can see, this module defines a bunch of mime types and includes
the appropriate type in the headers along with the contents of the file
it serves.

Hope this helps!

--
Ricardo



--000000000000c5e9a9056ce5e906--