Code Monkey home page Code Monkey logo

imperial-painter's People

Contributors

adam-thomas avatar dependabot[bot] avatar

Watchers

 avatar  avatar  avatar

Forkers

adam-thomas-oxb

imperial-painter's Issues

Refactor card loading flow

Currently, CardListReload calls the import_cards management command using call_command, which seems off. A module to store the bulk of the importing code, which could then also be separately tested from the management command, would be a good refactor. Probably also a good opportunity to re-layout some of the code.

Add quantity field

Rather than have to copy out a card multiple times in an Excel spreadsheet, let's add an optional quantity field/column that will cause Painter to display that number of the card.

Fix printer behaviour

Currently, printing requires some faff:

  • The scaling needs to be set to 70% (this seems consistent, so maybe I just have to downsize the site, unless there's a way of forcing a default scaling value).
  • 'Fit to page' works poorly since the cards aren't scaled vertically, hence the need to set to 70%. There may be a way around this.
  • Without background colours turned on (they're usually off by default) the cards look way less good. Worth seeing if I can enable that by default.

Add error checking to the Excel import

Just in case something messes up, the importer should check the layout of the imported Excel file and provide good error output if something fails.

This is also the place to add fallbacks for behaviour I want to allow.

Potential failure cases:

  • Missing name or template headers - Throw an error.
  • Missing card name - Throw an error.
  • Missing template name - Throw an error.
  • Empty rows - Ignore them. (tablib probably has that covered already.)

This will probably be done fully or partially as part of #5.

Support multiple cards per entry

Some in-game entities might have two or more cards associated with them, such as Warmachine's double-sided unit cards with the full rules on the back. I can support that by allowing multiple entries (comma-separated?) in the Template column and rendering both, next to each other.

Add /?load=filename1,filename2 GET arguments

From #9:

  • /?load=filename,filename2 - Refresh using the filenames supplied. (This can be a separate issue.)

Adding the ability to specify which filenames were being loaded from would be very useful. This way, you can avoid using the management command altogether if you like.

General cleanup and modernisation

  • Update to the latest version of Django (4.0.3 at time of writing).
  • Switch to my modern-day code style (double quotes, extra newlines between functions/methods).
  • Sanitise template names being used as CSS classes.
  • Check printing behaviour on both Firefox and Chrome and ensure it's consistent.
  • Document the use of em and CSS element sizing in general.
  • Add (and document) a system for applying custom fonts and other dependencies instead of leaning on the ones in card_display.html.
  • Allow alternate card importers to be plugged in in projects using Painter. Move import_laundry.py to the project it was intended for.
  • Ensure consistent usage across the various projects using Painter.
  • Start versioning changes.

Look into easier packaging/online deployment

Currently, it's a bit of a faff to get Painter up and running on a new machine. A compiled form that only required CSVs and custom templates - whether running locally via Python, or deployed somewhere online - would be much more useful.

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.