简体   繁体   English

[C] 无法在CKAN中使用Javascript

[英][Ckan]. Can't make Javascript work in CKAN

I'm trying to follow the example reported here: Ckan theming - Javascript in order to understand how I can add some javascript to my pages. 我正在尝试遵循此处报告的示例: Ckan主题-Javascript以了解如何向页面添加一些JavaScript。 Unfortunately, I can't make the example work. 不幸的是,我无法使该示例生效。 I have a theme called theme , and I'd like to modify that one. 我有一个名为theme的主题 ,我想对该主题进行修改。 So in my ckanext-theme/ckanext/theme/fanstatic/ folder, I add the theme_popover.js file, as per the example (I changed all the file names accordingly). 因此,根据示例,在我的ckanext-theme / ckanext / theme / fanstatic /文件夹中,添加了theme_popover.js文件(我相应地更改了所有文件名)。 I also put in ckanext-theme/ckanext/theme/templates/snippets/ the package_item.html defined as shown in the example (and changed to match the file names I got). 我还输入了如示例所示定义的ckanext-theme / ckanext / theme / templates / snippets / package_item.html (并更改为与我得到的文件名匹配)。

When I reload my /dataset/ page, all I got is an "internal server error". 当我重新加载/ dataset /页面时,我得到的只是一个“内部服务器错误”。 I searched the logs for further explanation, and here the error I got in my ckan_default.error.log file: 我搜索了日志以获取进一步的解释,在这里,我的ckan_default.error.log文件中出现了错误:

Blockquote [Tue May 30 10:43:17.351659 2017] [wsgi:error] [pid 24241:tid 140295054444288] [remote 172.17.0.1:31237] Error - : invalid literal for int() with base 10: '' [Tue May 30 10:43:17.545679 2017] [wsgi:error] [pid 24241:tid 140295054444288] [remote 172.17.0.1:31237] URL: http://localhost:10080/dataset Blockquote [Tue May 30 10:43:17.351659 2017] [wsgi:error] [pid 24241:tid 140295054444288] [remote 172.17.0.1:31237]错误-:int()以10为底的无效文字:''[Tue May 30 10:43:17.545679 2017] [wsgi:error] [pid 24241:tid 140295054444288] [远程172.17.0.1:31237] URL: http:// localhost:10080 / dataset

I can't quite grasp what it means and what should I fix to make it work. 我不太清楚这意味着什么,应该如何解决才能使其正常工作。 Can somebody help me? 有人可以帮我吗? Thanks a lot! 非常感谢!

Actually, it was my fault. 其实这是我的错。 I had not added the toolkit.add_resource('fanstatic', 'theme') line to my plugin file. 我没有将toolkit.add_resource('fanstatic','theme')行添加到我的插件文件中。 I added that and everything works fine now! 我补充说,现在一切正常!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM