cmu-lib / archive_plugin

Janeway plugin for managing journal archiving.
MIT License
8 stars 2 forks source link

feat: static markup for archive_plugin browse template #11

Closed pfulton closed 5 years ago

pfulton commented 5 years ago

This writes HTML for the archive_plugin's "browses" template. Currently, this is "static" and is meant to serve as a base for how the markup should be rendered when the plugin fetches its results and displays them in alphabetic order.

@hachacha @mdlincoln: I've commented out the code that was in here previously, as it looks like it was meant to loop over and display results according to the elements/journal/box_article.html template. We'll need to wire up this template to display the results as suggested in the mockup. I'm happy to take care of that, but I don't have the experience of having done that in Python/Django.

Screenshot of how actual results should render:

localhost_8000_cmesh_plugins_archive_plugin_browse_entries_

pfulton commented 5 years ago

Assigning this PR to @hachacha - we can either merge this as is and come back to it, or we can add commits onto this branch. Either way, I'm going to PR and merge in the Sass for the components used on this page.

pfulton commented 5 years ago

~One additional note here is that I'll probably need to consult with someone as to how we'll be wiring up the piece that I'm calling a "secondary nav" (https://github.com/dSHARP-CMU/archive_plugin/pull/11/files#diff-05fceb671552bfce417b4f036779abdbR68)~

pfulton commented 5 years ago

We can strike that last note ☝️ there. I found what I was looking for 🎉

hachacha commented 5 years ago

tricky... So the browse.html template in this archive plugin is essentially the same as the articles page and is just supposed to hook up to the box_article.html element to display each individual article in a list. However, our design is different but it should be rendered independently from the archive plugin. IE the title of the page is Table of Contents and not Browse, the articles are shown just as article title and author name. Also, box_article.html is used to display individual articles in a list in several other places on the website. There are some options to solving this:

@mdlincoln please sanity check me: best option:

second best option:

Other options:

mdlincoln commented 5 years ago

Hm, one thought - I know if the archive plugin were a regular Django app, we could override its template in our CMESH theme - that way the archive plugin stays the same, and we can restrict the CMESH-specific customizations to the one place where those customizations definitely belong: the CMESH theme repo.

That said, I suppose that would depend on whether Janeway allows themes to override templates provided by plugins, or if, on the other hand, it loads the plugins later and so allows the plugins to override the themes. I can experiment with this today, unless you've already explored that route @hachacha ?

mdlincoln commented 5 years ago

Success! @pfulton I made a draft PR just to show where you want to place the new "browse" template within the CMESH theme, under CMESH/templates/archive_plugin/browse.html: https://github.com/dSHARP-CMU/cmesh_theme/pull/13

hachacha commented 5 years ago

ah perfect! Thank you @mdlincoln !

ajrbyers commented 5 years ago

For all intents and purposes, the plugin is a regular django app, the only difference is its added to urls.py and installed_apps at runtime...

On Tue, 26 Feb 2019 at 14:47, Matthew Lincoln notifications@github.com wrote:

Hm, one thought - I know if the archive plugin were a regular Django app, we could override https://docs.djangoproject.com/en/2.1/howto/overriding-templates/ its template in our CMESH theme - that way the archive plugin stays the same, and we can restrict the CMESH-specific customizations to the one place where those customizations definitely belong: the CMESH theme repo.

That said, I suppose that would depend on whether Janeway allows themes to override templates provided by plugins, or if, on the other hand, it loads the plugins later and so allows the plugins to override the themes. I can experiment with this today, unless you've already explored that route @hachacha https://github.com/hachacha ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dSHARP-CMU/archive_plugin/pull/11#issuecomment-467466011, or mute the thread https://github.com/notifications/unsubscribe-auth/AH75Ygv_GdSdbY8eYKDRnK7apTpVCkGqks5vRUjsgaJpZM4bOBZq .

-- Senior Publishing Technology Developer Birkbeck, University of London

mdlincoln commented 5 years ago

Yep, I'm starting to understand it now @ajrbyers.

pfulton commented 5 years ago

Closing in favor of #14