Changes between Version 15 and Version 16 of Development/Plugins/WebUi/Examples
- Timestamp:
- 09/21/2008 07:51:49 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Development/Plugins/WebUi/Examples
v15 v16 52 52 }}} 53 53 54 === Test the new method. ===54 === Test the new core-plugin method. === 55 55 create ~/prj/deluge/plugins/df/Df/test.py ; Contents: 56 56 {{{ … … 62 62 }}} 63 63 64 === Execute test === 64 Terminal: 65 65 {{{ 66 66 cd ~/prj/deluge/plugins/Df/df … … 80 80 === Webui plugin === 81 81 Edit ~/prj/deluge/plugins/Df/df/webui.py and add this above ConfigForm 82 83 Note that api.render.df automatically maps to df.html , because of the call to api.render.register_template_path (see http://webpy.org/) 82 84 {{{ 83 85 #!python … … 113 115 killall deluge & deluge -u web & 114 116 }}} 117 Read the output to the console, there could be some errors there. 115 118 116 119 visit http://localhost:8112/df 117 120 121 Execute test until there are no more errors, and the page displays the desired result. 122 118 123 === Add to top menu === 124 We added a page, but the user can't navigate to it, let's fix that : 125 119 126 Add 2 lines for register/unregister of the menu-items. 120 127 {{{ 128 #!python 121 129 def enable(self): 122 130 api.config_page_manager.register('plugins','df',ConfigForm) … … 133 141 134 142 === Pretty template === 143 We're allmost ready, but the current template doesn't look right. 144 145 Adding a header/footer and menu to the template: 135 146 {{{ 136 147 $def with (df_result) … … 145 156 </div> 146 157 $:render.footer() 158 147 159 }}} 148 160 … … 150 162 * (template_dir/path) is a convention, it will be automagic somewhere in the future. 151 163 * all webui unregister_* methods will be renamed to deregister_* 152 * basic outline of developing a webui plugin is explained, todo: add some words to make the text flow.