Code Monkey home page Code Monkey logo

Comments (38)

acabal avatar acabal commented on September 28, 2024

@jobcurtis @colagrosso Can you two coordinate via this issue and submit PRs to the new covers branch?

I'm going to be fairly hands off here as I'm extremely busy. But, please feel free to ask me anything. Since we're using a small custom templating system and a not-quite-MVC pattern, some things might not be obvious or well documented.

from web.

colagrosso avatar colagrosso commented on September 28, 2024

Yep, understood. Thanks for the write-up.

from web.

colagrosso avatar colagrosso commented on September 28, 2024

I have a PR for an initial database schema and PHP classes. Still a lot to do on them, but enough for any early feedback.

Not in the PR, but I've been using this test script:

#!/usr/bin/php
<?

require_once('/standardebooks.org/web/lib/Core.php');

use Safe\DateTime;
$artist = new Artist('John McLure Hamilton', new DateTime('1936-01-01'));
$artist->Create();

$artwork = new Artwork($artist, 'Edward Horner Coates, 10th President of the P.A.F.A.', '1913', 'images/covers/filename.jpg', ['man', 'portrait', 'profile']);
$artwork->Create();

which has an example that I took from the first row of this spreadsheet: Standard Ebooks PD Art Research. It works fine, and produces these rows:

MariaDB [se]> select * from Artworks;
+-----------+----------+------------------------------------------------------+-----------------------------------------------------------------------------------+---------------+----------------------------+---------------------+------------+
| ArtworkId | ArtistId | Name                                                 | UrlName                                                                           | CompletedYear | ImageFilesystemPath        | Created             | Status     |
+-----------+----------+------------------------------------------------------+-----------------------------------------------------------------------------------+---------------+----------------------------+---------------------+------------+
|         1 |        1 | Edward Horner Coates, 10th President of the P.A.F.A. | /artworks/john-mclure-hamilton/edward-horner-coates-10th-president-of-the-p-a-f-a | 1913          | images/covers/filename.jpg | 2023-06-11 04:00:49 | unverified |
+-----------+----------+------------------------------------------------------+-----------------------------------------------------------------------------------+---------------+----------------------------+---------------------+------------+
1 row in set (0.00 sec)

MariaDB [se]> select * from Artists;
+----------+----------------------+---------------------+
| ArtistId | Name                 | DeathYear           |
+----------+----------------------+---------------------+
|        1 | John McLure Hamilton | 1936-01-01 00:00:00 |
+----------+----------------------+---------------------+
1 row in set (0.00 sec)

MariaDB [se]> select * from ArtworkTags;
+-----------+------------+
| ArtworkId | SubjectTag |
+-----------+------------+
|         1 | man        |
|         1 | portrait   |
|         1 | profile    |
+-----------+------------+
3 rows in set (0.00 sec)

Obvious shortcomings:

  1. I didn't add the 5 PD fields to the Artworks table yet
  2. Static functions on Artwork and Artist classes to load them from the database. That might also require new indices.
  3. A few more test examples in the script before moving onto a minimal upload form

from web.

jobcurtis avatar jobcurtis commented on September 28, 2024

Hi @colagrosso, as Alex said I've also been working on this a bit. I started with the upload form which is getting pretty close to complete (I should think I'll have a PR ready for tomorrow).

Your PR #235 looks pretty good to me. I'll rebase what I've got onto that so we can keep all our PRs working together. I'm not sure if @acabal wants to merge stuff as it gets done or wait for everything to be complete before reviewing it.

Since I'm almost done with the initial upload form, do you think it would make sense for you to work on loading the artwork from existing books into the database? Or alternatively, the page for admins to review submissions.

from web.

colagrosso avatar colagrosso commented on September 28, 2024

Great to hear from you, Job! Looking forward to working with you. Thanks for your comments on #235 already.

Will your work on the initial upload form cover these two URLs?

  • GET <root>/artworks/new -- artwork submission form
  • POST <root>/artworks -- create new artwork

If so, great. That would let us get an initial milestone working end-to-end where we can use the form and it will insert rows into the database.

In the meantime, I'll work on these two admin URLs so that we don't duplicate work:

  • GET <root>/admin/artworks -- view the queue of unapproved artwork
  • POST <root>/admin/artworks/<artwork-id> -- approve or reject artwork with status=<approved,declined>. Restfully this would be a PATCH request

from web.

jobcurtis avatar jobcurtis commented on September 28, 2024

Yeah that's right. I've also added a very basic page at GET /artworks (pretty much just hello world) so that submitting the form doesn't redirect you to a 404 until we get the real page done.

We should probably agree on how we store PD proof. The simplest way would just be 5 columns on the Artwork table. I think they will all have to be nullable as any given artwork might not have a particular field (and I guess artwork already in use won't have PD proof at all).

Clarifying question about validation; the issue says PD proof should have book publication date plus (link to museum page OR links to pages in books). I was under the impression that a link to a museum page meant it wasn't necessary to find the painting printed in a book. Is that correct?

from web.

acabal avatar acabal commented on September 28, 2024

Clarifying question about validation; the issue says PD proof should have book publication date plus (link to museum page OR links to pages in books). I was under the impression that a link to a museum page meant it wasn't necessary to find the painting printed in a book. Is that correct?

Yes, I made a mistake. Book pub year is not necessary if we have a museum URL.

Do note that if a museum URL is supplied, we should do a simple check on the museum domain to make sure it's on the approved list. So we might need another table, Museums? That could store the base domain for us to check against, and, for implementation at some future date, some kind of URL regex to see if we can normalize museum URLs a little (they often come with search queries and other stuff attached in the query string that are just clutter).

from web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.