Closed pfulton closed 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.
~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)~
We can strike that last note ☝️ there. I found what I was looking for 🎉
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:
box_article.html
in a big if/else to display one way if you're rendering through the pluginHm, 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 ?
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
ah perfect! Thank you @mdlincoln !
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
Yep, I'm starting to understand it now @ajrbyers.
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: