guix-web.git
3 years agoguix: Fix environment for latest Guix release. master
David Thompson [Wed, 22 Jul 2015 21:09:35 +0000 (17:09 -0400)] 
guix: Fix environment for latest Guix release.

* env.scm: Change package source field to #f.

3 years agojs: packages: Also match against description and location.
Ricardo Wurmus [Tue, 23 Jun 2015 14:37:32 +0000 (16:37 +0200)] 
js: packages: Also match against description and location.

* js/controller/packages.js (filteredPackages): Match search expression
  against "description" and "location" fields in addition to "name" and
  "synopsis".

3 years agoview: json: Add "location" field to JSON representation.
Ricardo Wurmus [Tue, 23 Jun 2015 14:35:16 +0000 (16:35 +0200)] 
view: json: Add "location" field to JSON representation.

* guix/web/view/json.scm (package->json): Add "location" field.

3 years agojs: layout: Add cute footer message.
David Thompson [Tue, 16 Jun 2015 18:16:42 +0000 (14:16 -0400)] 
js: layout: Add cute footer message.

* js/view/layout.js (guix.withLayout): Change footer copyright line.

3 years agojs: packages: Fix empty package list when returning to package list.
David Thompson [Tue, 16 Jun 2015 17:35:42 +0000 (13:35 -0400)] 
js: packages: Fix empty package list when returning to package list.

* js/controller/packages.js (guix.packages.controller)
  [filteredPackages]: Change from observable to property.

3 years agojs: generations: List generations in reverse chronological order.
David Thompson [Tue, 16 Jun 2015 12:59:40 +0000 (08:59 -0400)] 
js: generations: List generations in reverse chronological order.

* js/controller/generations.js (guix.generations.controller): Render
  generations in reverse chronological order.
  [sortedGenerations]: New variable.

3 years agojs: packages: Correctly handle searches that yield no results.
David Thompson [Tue, 16 Jun 2015 02:44:33 +0000 (22:44 -0400)] 
js: packages: Correctly handle searches that yield no results.

* js/controller/packages.js (guix.packages.controller): Do not render
  pagination where there are no search results.
  [emptyPages]: New variable.
  [pages]: Don't chunk when there are no packages.  Return emptyPackages
  instead.

3 years agojs: packages: Fix search results badge.
David Thompson [Tue, 16 Jun 2015 02:28:48 +0000 (22:28 -0400)] 
js: packages: Fix search results badge.

* js/controller/packages.js (guix.packages.controller): Use the filtered
  package list instead of the full package list when rendering.

3 years agoview: json: Gracefully handle license lists and bogus licenses.
David Thompson [Tue, 16 Jun 2015 01:45:23 +0000 (21:45 -0400)] 
view: json: Gracefully handle license lists and bogus licenses.

* guix-web/view/json.scm (license->json): Add 'match' form to handle
  bogus licenses.

Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
3 years agopackage: Adjust profile generation creation to current API.
David Thompson [Tue, 16 Jun 2015 01:40:02 +0000 (21:40 -0400)] 
package: Adjust profile generation creation to current API.

* guix-web/package.scm (install-new-profile-generation): New procedure.
  (package-install): Use it.  Call 'set-guile-for-build' before
  'profile-derivation'.

Written-By: Ludovic Courtès <ludo@gnu.org>
3 years agopackage: Use the right state directory rather than a hardcoded one.
David Thompson [Tue, 16 Jun 2015 01:33:27 +0000 (21:33 -0400)] 
package: Use the right state directory rather than a hardcoded one.

* guix/web/package.scm (%profile): Use %STATE-DIRECTORY, as well as the
  'USER' and 'LOGNAME' environment variables, like 'guix package' does.

Written-By: Ludovic Courtès <ludo@gnu.org>
3 years agoFix configure script.
Ricardo Wurmus [Fri, 12 Jun 2015 09:21:54 +0000 (11:21 +0200)] 
Fix configure script.

* configure.ac: Remove AC_CONFIG_SRCDIR because it set $srcdir to ".."
  instead of ".".

3 years agoAdd "guix" to environment.
Ricardo Wurmus [Fri, 12 Jun 2015 09:20:59 +0000 (11:20 +0200)] 
Add "guix" to environment.

* env.scm: Add "guix" to inputs.

4 years agoI'm dumb.
David Thompson [Mon, 9 Feb 2015 22:44:32 +0000 (17:44 -0500)] 
I'm dumb.

4 years agoUpdate environment.
David Thompson [Mon, 9 Feb 2015 19:33:53 +0000 (14:33 -0500)] 
Update environment.

* env.scm: Update.

4 years agojs: Overhaul UI with FRP!
David Thompson [Mon, 9 Feb 2015 13:34:37 +0000 (08:34 -0500)] 
js: Overhaul UI with FRP!

* css/guix.css: New loading spinner.
* js/lib/kefir.js: New file.
* js/model/packages.js (guix.packages.Packages): Cache result.
  (guix.packages.Sorter, guix.packages.Pager): Delete.
  (guix.packages.installPackage): New function.
* js/utils.js (K): New variable.
  (guix.withEmit, guix.withEmitAttr, guix.makeModule): New functions.
* js/view/ui.js (guix.ui.paginate, guix.ui.spinUntil): New functions.
  (guix.ui.spinner): New variable.
* js/controller/generations.js: Rewrite.
* js/controller/packageInfo.js: Rewrite
* js/controller/packages.js: Rewrite.
* js/view/packages.js: Rewrite.
* js/view/generations.js: Delete.
* js/view/packageInfo.js: Delete.
* js/routes.js: Use new modules.
* guix/web/view/html.scm (javascripts): Update list.

4 years agojs: packages: Filter list oninput rather than onchange.
David Thompson [Sun, 8 Feb 2015 15:46:01 +0000 (10:46 -0500)] 
js: packages: Filter list oninput rather than onchange.

* js/view/packages.js (guix.packages.view): s/onchange/oninput/

4 years agoMove all modules into the 'guix web' namespace.
David Thompson [Sun, 1 Feb 2015 01:54:35 +0000 (20:54 -0500)] 
Move all modules into the 'guix web' namespace.

* guix-web/config.scm: Delete.
* guix-web/controller.scm: Delete.
* guix-web/package.scm: Delete.
* guix-web/render.scm: Delete.
* guix-web/server.scm: Delete.
* guix-web/sxml.scm: Delete.
* guix-web/util.scm: Delete.
* guix-web/view/html.scm: Delete.
* guix-web/view/json.scm: Delete.
* guix/web/config.scm: New file.
* guix/web/controller.scm: New file.
* guix/web/package.scm: New file.
* guix/web/render.scm: New file.
* guix/web/server.scm: New file.
* guix/web/sxml.scm: New file.
* guix/web/util.scm: New file.
* guix/web/view/html.scm: New file.
* guix/web/view/json.scm: New file.
* guix/scripts/web.scm: Tweak imports.
* Makefile.am (SOURCES): Add new files and remove deleted ones.

4 years agoMake guix-web a subcommand of guix.
David Thompson [Sun, 1 Feb 2015 01:23:13 +0000 (20:23 -0500)] 
Make guix-web a subcommand of guix.

* scripts/guix-web: Delete.
* guix/scripts/web.scm: New file.
* Makefile.am (SOURCES): Add it.
  (dev-server): Delete.
* README.md (Use): Tweak usage instructions.

4 years agoRender package details on the client.
David Thompson [Sat, 31 Jan 2015 04:52:52 +0000 (23:52 -0500)] 
Render package details on the client.

* js/routes.js: Add new route.
* js/controller/packageInfo.js: New file.
* js/view/packageInfo.js: New file.
* js/model/packages.js (guix.packages.PackagesByName): New function.
* js/view/ui.js (guix.ui.licenseList): New function.
* js/view/packages.js (guix.packages.view): Render package links as
  Mithril URLs.  Remove factorized inner 'renderLicese' function.
* guix-web/view/html.scm (javascripts): Add new JS files.
  (view-package): Delete.

4 years agoUse JavaScript naming conventions for package JSON fields.
David Thompson [Sat, 31 Jan 2015 04:51:16 +0000 (23:51 -0500)] 
Use JavaScript naming conventions for package JSON fields.

* guix-web/view/json.scm (package->json): Change 'native-inputs' to
  'nativeInputs'.  Change 'propagated-inputs' to 'propagatedInputs'.

4 years agoMake /package a JSON only route.
David Thompson [Sat, 31 Jan 2015 04:49:13 +0000 (23:49 -0500)] 
Make /package a JSON only route.

* guix-web/controller.scm (extract-package-name): New procedure.
  (controller): Only render JSON for '/package' routes.

4 years agojs: layout: Update copyright year in footer.
David Thompson [Fri, 30 Jan 2015 19:16:15 +0000 (14:16 -0500)] 
js: layout: Update copyright year in footer.

* js/view/layout.js (guix.withLayout): Add © 2015.

4 years agojs: Fix package sorting.
David Thompson [Fri, 30 Jan 2015 19:07:13 +0000 (14:07 -0500)] 
js: Fix package sorting.

* js/controllers/packages.js (guix.packages.controller.sortAndPage): New
  function.
  (guix.packages.controller): Use 'sortAndPage'.
  (guix.packages.controller.doSearch): Likewise.

4 years agojs: Fix display when there are 0 search results
David Thompson [Fri, 30 Jan 2015 18:54:41 +0000 (13:54 -0500)] 
js: Fix display when there are 0 search results

* js/controller/packages.js (guix.packages.packages): Default to empty
  array.
* js/model/packages.js (guix.packages.Pager.currentPage): Always return
  an array
* js/view/packages.js (guix.packages.view): Show spinner when there are
  0 packages loaded from the server, not when there are 0 pages of
  results.

4 years agoAdd AUTHORS and THANKS files.
David Thompson [Fri, 30 Jan 2015 14:59:13 +0000 (09:59 -0500)] 
Add AUTHORS and THANKS files.

* AUTHORS: New file.
* THANKS: New file.

4 years agojs: Factorize headerWithBadge function.
David Thompson [Fri, 30 Jan 2015 13:52:16 +0000 (08:52 -0500)] 
js: Factorize headerWithBadge function.

* js/view/ui.js (guix.ui.headerWithBadge): New function.
* js/view/packages.js (guix.view.packages): Use it.
* js/view/generations.js (guix.view.generations): Likewise.

4 years agojs: Extract modal creation function.
David Thompson [Fri, 30 Jan 2015 13:47:41 +0000 (08:47 -0500)] 
js: Extract modal creation function.

* js/view/ui.js: New file.
* guix-web/view/html.scm (javascripts): Add it.
* js/view/packages.js (guix.packages.view): Use 'guix.ui.modal' function.

4 years agoAdd sxml module.
David Thompson [Fri, 30 Jan 2015 13:32:38 +0000 (08:32 -0500)] 
Add sxml module.

* guix-web/sxml.scm: New file.
* Makefile.am (SOURCES): Add it.
* guix-web/render.scm (render-html): Use 'sxml->html'.
* guix-web/view/html.scm (render-javascript): Remove hack.

4 years agoview: html: Rename script-tag to render-javascript.
David Thompson [Fri, 30 Jan 2015 13:30:14 +0000 (08:30 -0500)] 
view: html: Rename script-tag to render-javascript.

* guix-web/view/html.scm (script-tag): Rename to...
  (render-javascript): ...this.
  (all-packages): Use new procedure name.

4 years agoview: html: Add render-stylesheet procedure.
David Thompson [Fri, 30 Jan 2015 13:29:26 +0000 (08:29 -0500)] 
view: html: Add render-stylesheet procedure.

* guix-web/view/html.scm (render-stylesheet): New procedure.
  (main-layout): Use it.
  (stylesheets): New variable.

4 years agoExtract HTML and JSON views to separate modules.
David Thompson [Fri, 30 Jan 2015 13:12:21 +0000 (08:12 -0500)] 
Extract HTML and JSON views to separate modules.

* guix-web/view.scm: Delete.
* guix-web/view/html.scm: New file.
* guix-web/view/json.scm: New file.
* guix-web/controller.scm: Import new modules.
* Makefile.am (SOURCES): Add new files.  Remove deleted one.

4 years agopackage: Add %all-packages.
David Thompson [Fri, 30 Jan 2015 12:26:09 +0000 (07:26 -0500)] 
package: Add %all-packages.

* guix-web/package.scm (%all-packages): New variable.
* guix-web/view.scm (all-packages-json): Use it.

4 years agocss: Improve appearance of counter badges next to headers.
David Thompson [Fri, 30 Jan 2015 01:29:04 +0000 (20:29 -0500)] 
css: Improve appearance of counter badges next to headers.

* css/guix.css (.header .badge): New style.
* js/view/generations.js (guix.generations.view): Add 'header' class to
  h2 element.
* js/view/packages.js (guix.packages.view): Likewise.

4 years agojs: Clean up packageCount function.
David Thompson [Fri, 30 Jan 2015 00:46:38 +0000 (19:46 -0500)] 
js: Clean up packageCount function.

* js/utils.js (guix.add): New function.
* js/controllers/packages.js (guix.packages.controller.packageCount):
  Reimplement.

4 years agoReplace package.scm with env.scm.
David Thompson [Fri, 30 Jan 2015 00:15:27 +0000 (19:15 -0500)] 
Replace package.scm with env.scm.

* env.scm: New file.
* package.scm: Delete.
* README.md (Development): s/package/env/

4 years agojs: Extract pagination model.
David Thompson [Fri, 17 Oct 2014 02:20:04 +0000 (22:20 -0400)] 
js: Extract pagination model.

* js/utils.js (guix.clamp): New function.
* js/controller/packages.js (guix.packages.controller): Remove 'pages',
  'currentPageIndex', and 'pageSize' properties.  Add 'pager' prop.
  Delete 'paginate', 'currentPage', 'isFirstPage', 'isLastPage', and
  'isCurrentPage' methods.
* js/model/packages.js (guix.packages.Pager): New function.
* js/view/packages.js (guix.packages.view): Use new Pager API.

4 years agoAdd generations view.
David Thompson [Thu, 16 Oct 2014 04:01:23 +0000 (00:01 -0400)] 
Add generations view.

* guix-web/controller.scm (controller): Add '/generations' route.
* guix-web/package.scm (profile-generations*): New procedure.
* guix-web/view.scm (generations-json): New procedure.
  (javascripts): Add new JS files.
* js/model/generations.js: New file.
* js/controller/generations.js: New file.
* js/view/generations.js: New file.
* js/view/layout.js (guix.withLayout): Add 'Generations' navbar entry.
* js/routes.js: Add '/generations' route.

4 years agojs: Hook up navbar to routes.
David Thompson [Thu, 16 Oct 2014 02:39:40 +0000 (22:39 -0400)] 
js: Hook up navbar to routes.

* js/view/layout.js (guix.withLayout): Add click handler for 'Packages'
  link.

4 years agojs: Add loading spinner to packages page.
David Thompson [Thu, 16 Oct 2014 02:36:58 +0000 (22:36 -0400)] 
js: Add loading spinner to packages page.

* css/guix.css: Add spinner styles.
* js/controller/packages.js (guix.packages.view): Explicitly redraw
  after loading packages.
* js/model/packages.js (guix.packages.Packages): Load packages in the
  background.
* js/view/layout.js (guix.withLayout): Cast elem to array if needed.
* js/view/packages.js (guix.packages.view): Render spinner when there
  are no packages to display.

4 years agolibrejs: Render full path to file on weblabels page.
David Thompson [Thu, 16 Oct 2014 01:17:18 +0000 (21:17 -0400)] 
librejs: Render full path to file on weblabels page.

* guix-web/view.scm (librejs): Show full path in first table column.

4 years agoRender footer on client instead of server.
David Thompson [Thu, 16 Oct 2014 01:13:01 +0000 (21:13 -0400)] 
Render footer on client instead of server.

* guix-web/view.scm (main-layout): Remove footer.
  (all-packages): Remove '#guix' div.
  (librejs): Add container and logo.
* js/view/layout.js (guix.withLayout): Render footer.

4 years agojs: utils file initializes guix namespace with certainty.
David Thompson [Thu, 16 Oct 2014 00:37:35 +0000 (20:37 -0400)] 
js: utils file initializes guix namespace with certainty.

* js/utils.js (guix): Don't check for existing value (there isn't one).

4 years agojs: Break package components into model/view/controller files.
David Thompson [Thu, 16 Oct 2014 00:36:12 +0000 (20:36 -0400)] 
js: Break package components into model/view/controller files.

* js/packages.js: Delete.
* js/model/packages.js: New file.
* js/view/packages.js: New file.
* js/controller/packages.js: New file.
* js/routes.js: Use new namespace for packages.
* guix-web/view.scm (javascripts): Add new JS files.

4 years agoRestructure JavaScript files.
David Thompson [Thu, 16 Oct 2014 00:11:49 +0000 (20:11 -0400)] 
Restructure JavaScript files.

* js/guix-packages.js: Delete.
* js/mithril.js: Delete.
* js/underscore.js: Delete.
* js/lib/mithril.js: New file.
* js/lib/underscore.js: New file.
* js/packages.js: New file.
* js/routes.js: New file.
* js/utils.js: New file.
* js/view/layout.js: New file.
* guix-web/view.scm (javascripts): Add new files.  Delete old ones.
* css/guix.css (logo): New class.
* images/logo.png: Shrink logo.

4 years agoAllow hostname customization.
David Thompson [Tue, 14 Oct 2014 01:34:44 +0000 (21:34 -0400)] 
Allow hostname customization.

* guix-web/config.scm (guix-web-host): New variable.
* guix-web/render.scm (render-static-asset, redirect): Use
  'guix-web-host'.

4 years agoFix 404 rendering for static assets.
David Thompson [Mon, 13 Oct 2014 21:56:04 +0000 (17:56 -0400)] 
Fix 404 rendering for static assets.

* guix-web/render.scm (render-static-asset): Build proper URI.

4 years agoview: Fix 'format' warning.
David Thompson [Sun, 12 Oct 2014 13:50:20 +0000 (09:50 -0400)] 
view: Fix 'format' warning.

* guix-web/view.scm: Import (ice-9 format).

4 years agoDecouple static asset rendering from core server logic.
David Thompson [Sun, 12 Oct 2014 13:15:23 +0000 (09:15 -0400)] 
Decouple static asset rendering from core server logic.

* guix-web/server.scm (file-mime-types, serve-static-asset): Delete.
* guix-web/render.scm (file-mine-types): New variable.
  (render-static-asset): New procedure.
* guix-web/controller.scm (controller): Add static asset rendering.

4 years agocontroller: Use match-lambda.
David Thompson [Sun, 12 Oct 2014 13:03:11 +0000 (09:03 -0400)] 
controller: Use match-lambda.

* guix-web/controller.scm (controller): Use 'match-lambda'.

4 years agoAdd configurable HTTP server port.
David Thompson [Sun, 12 Oct 2014 12:56:10 +0000 (08:56 -0400)] 
Add configurable HTTP server port.

* guix-web/config.scm (guix-web-port): New variable.
* guix-web/render.scm (redirect): Use it.
* guix-web/server.scm (start-guix-web): Ditto.

4 years agoAdd development package.
David Thompson [Sun, 12 Oct 2014 02:53:40 +0000 (22:53 -0400)] 
Add development package.

* package.scm: New file.
* README.md ('Development'): New section.

4 years agoMakefile: Add 'dev-server' target.
David Thompson [Sun, 12 Oct 2014 02:27:39 +0000 (22:27 -0400)] 
Makefile: Add 'dev-server' target.

* Makefile.am (dev-server): New target.
* README.md ('Use'): Document it.

4 years agotest: Add coverage for render module.
David Thompson [Sat, 13 Sep 2014 01:39:35 +0000 (21:39 -0400)] 
test: Add coverage for render module.

* tests/guix-web/render.scm: New file.

4 years agotest: Fix directory? test.
David Thompson [Sat, 13 Sep 2014 01:08:30 +0000 (21:08 -0400)] 
test: Fix directory? test.

* tests/guix-web/util.scm ("directory?"): Use getcwd instead of ".".

4 years agojs: Extract more rendering to functions.
David Thompson [Sat, 30 Aug 2014 15:06:15 +0000 (11:06 -0400)] 
js: Extract more rendering to functions.

* js/guix-packages.js (guix.view): Extract renderPackageTable and
  renderSearchBox functions.

4 years agoAdd basic autotools files.
David Thompson [Sat, 30 Aug 2014 13:11:14 +0000 (09:11 -0400)] 
Add basic autotools files.

* Makefile.am: New file.
* autogen.sh: New file.
* configure.ac: New file.
* env.in: New file.
* guile.am: New file.
* pre-inst-env.in: New file.
* .gitignore: Ignore auto-generated files.

4 years agoIgnore .go files.
David Thompson [Sat, 30 Aug 2014 04:01:05 +0000 (00:01 -0400)] 
Ignore .go files.

* .gitignore: New file.

4 years agopackage: Do not open store connection upon module load.
David Thompson [Sat, 30 Aug 2014 03:58:59 +0000 (23:58 -0400)] 
package: Do not open store connection upon module load.

* guix-web/package.scm (%store): Delete it.
  (package-install): Use with-store.

4 years agoAdd first unit tests.
David Thompson [Sat, 30 Aug 2014 03:44:55 +0000 (23:44 -0400)] 
Add first unit tests.

* tests/guix-web/util.scm: New file.

4 years agoREADME: Add screenshot.
David Thompson [Sun, 17 Aug 2014 00:22:14 +0000 (20:22 -0400)] 
README: Add screenshot.

* README.md: Add screenshot.

4 years agoUse unquote-splicing feature of guile-json 0.4.0.
David Thompson [Sat, 16 Aug 2014 23:37:50 +0000 (19:37 -0400)] 
Use unquote-splicing feature of guile-json 0.4.0.

* README.md ("Dependencies"): Specify guile-json >= 0.4.0.
* guix-web/view.scm (package->json): Use unquote-splicing to dedupe code.

4 years agoAdd a currently useless abort button to the package install modal.
David Thompson [Fri, 15 Aug 2014 20:27:19 +0000 (16:27 -0400)] 
Add a currently useless abort button to the package install modal.

* js/guix-packages.js (guix.view): Render abort button in derivation phase.

4 years agoUse the current user's guix profile.
David Thompson [Fri, 15 Aug 2014 13:25:33 +0000 (09:25 -0400)] 
Use the current user's guix profile.

* guix-web/package.scm (%profile): Use the per-user profile of $USER.

4 years agoTweak messaging during package installation.
David Thompson [Fri, 15 Aug 2014 13:20:36 +0000 (09:20 -0400)] 
Tweak messaging during package installation.

* js/guix-packages.js (guix.view): Tweak messaging during derivation phase.

4 years agoAlways return to the first page of results after searching.
David Thompson [Fri, 15 Aug 2014 13:19:02 +0000 (09:19 -0400)] 
Always return to the first page of results after searching.

* js/guix-packages.js (guix.controller.prototype.doSearch): Reset
  currentPageIndex to 0.

4 years agoShow close button on modal when installation fails.
David Thompson [Fri, 15 Aug 2014 13:12:39 +0000 (09:12 -0400)] 
Show close button on modal when installation fails.

* js/guix-packages.js (guix.view): Show close button on the error phase.

4 years agoWrap controller procedure in a trampoline.
David Thompson [Fri, 15 Aug 2014 13:01:08 +0000 (09:01 -0400)] 
Wrap controller procedure in a trampoline.

* scripts/guix-web: Trampoline it.

4 years agoAdd basic, hacky package installation.
David Thompson [Fri, 15 Aug 2014 12:57:29 +0000 (08:57 -0400)] 
Add basic, hacky package installation.

* guix-web/controller.scm (controller): Add package installation route.
* guix-web/package.scm: New file.
* guix-web/render.scm (unprocessable-entity, created): New procedures.
* js/guix-packages.js (guix.PHASE_NONE, guix.PHASE_PROMPT,
  guix.PHASE_DERIVATION, guix.PHASE_SUCCESS, guix.PHASE_ERROR): New variables.
  (guix.controller.phase, guix.controller.selectedPackage): New properties.
  (guix.controller.prototype.installSelectedPackage): New method.
  (guix.view): Add modal for package installation UI.

4 years agoBetter encapsulate JS data types.
David Thompson [Thu, 14 Aug 2014 03:03:12 +0000 (23:03 -0400)] 
Better encapsulate JS data types.

* js/guix-packages.js (guix.Sorter, guix.controller): Use module pattern
  to encapsulate data type creation.

4 years agoMake logo link to package list.
David Thompson [Thu, 14 Aug 2014 02:58:02 +0000 (22:58 -0400)] 
Make logo link to package list.

* guix-web/view.scm (main-layout): Wrap image tag in anchor tag.

4 years agoAdd javascript record type.
David Thompson [Thu, 14 Aug 2014 00:50:07 +0000 (20:50 -0400)] 
Add javascript record type.

* guix-web/view.scm (<javascript>): New record type.
  (javascript, javascript?, javascript-source-uri, javascript-license,
  javascript-license-uri): New procedures.
  (javascripts): Use javascript constructor.
  (script-tag, librejs): Use new javascript procedures.

4 years agoAdd column sorting to package table.
David Thompson [Thu, 14 Aug 2014 00:23:54 +0000 (20:23 -0400)] 
Add column sorting to package table.

* css/guix.css: New file.
* guix-web/view.scm (main-layout): Include guix.css.
* js/guix-packages.js (guix.Sorter.prototype.reverse): New method.
  (guix.controller.sorter): Make property.
  (guix.controller.columns): New variable.
  (guix.controller.prototype.paginate): Use sorter property.
  (guix.controller.prototype.sortBy): New method.
  (guix.view): Render column sorting UI.

4 years agoAdd package sorting.
David Thompson [Wed, 13 Aug 2014 22:06:19 +0000 (18:06 -0400)] 
Add package sorting.

* guix-packages.js (guix.Sorter): New data type.
  (guix.Soter.prototype.sort): New method.
  (guix.controller): Sort by name by default.

4 years agoMove pagination function to controller prototype.
David Thompson [Wed, 13 Aug 2014 22:02:27 +0000 (18:02 -0400)] 
Move pagination function to controller prototype.

* js/guix-packages.js (guix.paginate): Delete it.
  (guix.controller): Use new paginate method.
  (guix.controller.prototype.paginate): New method.

4 years agoAdd copyright and licensing information to page footer.
David Thompson [Tue, 12 Aug 2014 01:57:02 +0000 (21:57 -0400)] 
Add copyright and licensing information to page footer.

4 years agoCreate utility module.
David Thompson [Sun, 10 Aug 2014 02:42:58 +0000 (22:42 -0400)] 
Create utility module.

* guix-web/server.scm (file-extension, directory?,
  request-path-components): Delete them.
* guix-web/util.scm: New module.

4 years agoFix view-package.
David Thompson [Sat, 9 Aug 2014 19:11:50 +0000 (15:11 -0400)] 
Fix view-package.

* guix-web/view.scm (view-package): Filter out non-package inputs.

4 years agoREADME: Rephrase features.
David Thompson [Sat, 9 Aug 2014 19:11:22 +0000 (15:11 -0400)] 
README: Rephrase features.

* README.md ("Features"): Rephrase.

4 years agoAdd JSON endpoint for a specific package name.
David Thompson [Sat, 9 Aug 2014 17:15:11 +0000 (13:15 -0400)] 
Add JSON endpoint for a specific package name.

* guix-web/controller.scm (controller): Allow use of '.json' file extension.
* guix-web/view.scm (view-package-json, license->json, package->json):
  New procedures.
  (all-packages-json): Refactor.
  (view-package): Filter out non-package inputs.

4 years agoREADME: Expand features and wishlist.
David Thompson [Sat, 9 Aug 2014 15:54:40 +0000 (11:54 -0400)] 
README: Expand features and wishlist.

* README.md ("Features"): Add LibreJS compatibility.
  ("Wishlist"): Add more desired features.

4 years agoREADME: Fix formatting of copyright information.
David Thompson [Sat, 9 Aug 2014 15:49:40 +0000 (11:49 -0400)] 
README: Fix formatting of copyright information.

* README.md ("Copyright"): Fix formatting.

4 years agoUpdate README.
David Thompson [Sat, 9 Aug 2014 15:46:21 +0000 (11:46 -0400)] 
Update README.

README.md ("Features", "Wishlist", "Dependencies"): New sections.

4 years agoShow package inputs when viewing package details.
David Thompson [Sat, 9 Aug 2014 14:06:28 +0000 (10:06 -0400)] 
Show package inputs when viewing package details.

* guix-web/view.scm (view-package): Display inputs, native inputs, and
  propagated inputs when present.

4 years agoRemove unused variable guix-web-router.
David Thompson [Sat, 9 Aug 2014 13:53:17 +0000 (09:53 -0400)] 
Remove unused variable guix-web-router.

* guix-web/config.scm (guix-web-router): Delete it.

4 years agoMove controller methods to prototype.
David Thompson [Sat, 9 Aug 2014 13:27:56 +0000 (09:27 -0400)] 
Move controller methods to prototype.

* js/guix-packages.js: Move functions defined on each instance of
  guix.controller to guix.controller's prototype.

4 years agoAdd pagination.
David Thompson [Sat, 9 Aug 2014 13:20:44 +0000 (09:20 -0400)] 
Add pagination.

* js/guix-packages.js: (guix.chunk): New function.
  (guix.paginate): New function.
  (guix.controller.pages, guix.controller.currentPageIndex,
  guix.controller.pageSize): New variables.
  (guix.controller.currentPage, guix.controller.isFirstPage,
  guix.controller.isLastPage, guix.controller.isCurrentPage,
  guix.controller.packageCount): New functions.
  (guix.controller.doSearch): Paginate.
  (guix.view): Render pagination UI.

4 years agoPerform case insensitive search.
David Thompson [Fri, 8 Aug 2014 11:47:58 +0000 (07:47 -0400)] 
Perform case insensitive search.

* js/guix-packages.js: Specify case insensitive mode when creating regexp.

4 years agoAdd Emacs local variable compile-command setting.
David Thompson [Fri, 8 Aug 2014 11:46:34 +0000 (07:46 -0400)] 
Add Emacs local variable compile-command setting.

* scripts/guix-web: Add it.

4 years agoRemove extraneous parens.
David Thompson [Fri, 8 Aug 2014 11:46:12 +0000 (07:46 -0400)] 
Remove extraneous parens.

* scripts/guix-web: Remove them.

4 years agoDisplay visible packages in badge on package search page.
David Thompson [Fri, 8 Aug 2014 01:27:25 +0000 (21:27 -0400)] 
Display visible packages in badge on package search page.

* js/guix-packages.js (guix.view): Display ctrl.visiblePackages() in badge.

4 years agoBreak guix-web script into many modules.
David Thompson [Fri, 8 Aug 2014 01:20:32 +0000 (21:20 -0400)] 
Break guix-web script into many modules.

* guix-web/config.scm: New file.
* guix-web/controller.scm: New file.
* guix-web/render.scm: New file.
* guix-web/server.scm: New file.
* guix-web/view.scm: New file.
* scripts/guix-web: Remove extracted code.

4 years agoMove guix-web to scripts directory.
David Thompson [Thu, 7 Aug 2014 21:45:27 +0000 (17:45 -0400)] 
Move guix-web to scripts directory.

* README.md ("Use"): Update.
* guix-web: Moved.
* pre-inst-env: New file.
* scripts/guix-web: New file.

4 years agoRename guix-web.js to guix-packages.js.
David Thompson [Thu, 7 Aug 2014 21:33:13 +0000 (17:33 -0400)] 
Rename guix-web.js to guix-packages.js.

* guix-web (javascripts): Update.
* js/guix-packages.js: New file.
* js/guix-web.js: Delete it.

4 years agoAllow connections from any computer on the network.
David Thompson [Thu, 7 Aug 2014 21:32:18 +0000 (17:32 -0400)] 
Allow connections from any computer on the network.

* guix-web: use INADDR_ANY for http server addr.

4 years agoRename weblabels to librejs.
David Thompson [Thu, 7 Aug 2014 21:30:57 +0000 (17:30 -0400)] 
Rename weblabels to librejs.

* guix-web (run-route): Call librejs.
  (weblabels): Renamed.
  (librejs): New procedure.

4 years agoExtract common page layout to procedure.
David Thompson [Thu, 7 Aug 2014 21:29:34 +0000 (17:29 -0400)] 
Extract common page layout to procedure.

* guix-web (main-layout): New procedure.
  (all-packages, view-package, weblabels): Use main-layout.

4 years agoAdd "versions" to package count badge.
David Thompson [Thu, 7 Aug 2014 13:28:51 +0000 (09:28 -0400)] 
Add "versions" to package count badge.

* guix-web (view-package): Pluralize "version" if needed and render next
  to package count.

4 years agoAdd /package endpoint.
David Thompson [Thu, 7 Aug 2014 13:21:34 +0000 (09:21 -0400)] 
Add /package endpoint.

* guix-web (file-mime-types): Add image/png.
  (run-route): Add /package endpoint.
  (license-link): Delete it.
  (render-package-license): New procedure.
  (view-package): New procedure.
* images/logo.png: New file.

4 years agoAllow binary files to be served.
David Thompson [Thu, 7 Aug 2014 13:20:19 +0000 (09:20 -0400)] 
Allow binary files to be served.

* guix-web (serve-static-asset): Read file as bytevector instead of string.