Repository navigation
A simple link to Shelfmark? Edit: Or not #1620
|
Since shelfmark is like a companion app and even promoted on the readme, could we add a link to a shelfmark instance on the main cwa page? Same as shelfmark has on their main page leading to calibre/cwa. Possibly under "Feature Configuration" on the Basic Configuration page. Something like "Show link to Shelfmark" with a checkbox, then a text box to type in the URL of shelfmark. If you don't want to be too closely associated, it could be "Show link to external resource". Once it's filled in, there's another icon in the top right, near tasks, refresh, settings, etc. Edit: So, I know that the sql records are there, I just can't access them outside of those two pages. I know the hardcover token can be accessed other places (that's what I based a lot of my edits off of) as well as other config_ records. I'm assuming it has something to do with Flask and how it's calling it? Any help would be greatly appreciated. I have a fork I can make public for anyone that wants to check it out. Thank you! |
Replies: 1 comment 3 replies
|
return render_template(instance=config.config_calibre_web_title, sidebar=sidebar, simple=simple,
accept=config.config_upload_formats.split(','),
shelfmark_url=config.config_shelfmark_url,
magic_shelf_routes=magic_shelf_routes,
duplicate_notification=duplicate_notification,
*args, **kwargs)and then use |
configinside a Jinja template is Flask's own template global (app.config), unless the view passes its ownconfig=into the render context. The admin views do:cps/admin.pycallsrender_title_template("admin.html", ..., config=config, ...)(and the same forconfig_edit.htmland a few others), which shadows the global with Calibre-Web'sconfigobject. That's why{{ config.config_shelfmark_url }}resolves on/admin/viewand/admin/config. On every other page the nameconfigis Flask's config dict, the lookup finds no such key and renders an empty string.render_title_template()incps/render_template.pypassesinstance,sidebar,simple,accept,magic_shelf_routesandduplicate_notificationto