Commit 54fbd9c044a320ca106dc8d5e592b0afb8e93c7c
Committed by
Lucas Kanashiro
1 parent
492d6fa0
Exists in
master
and in
8 other branches
Updated plugins documentation
- Updated how the URL should be formatted Signed-off-by: Lucas Moura <lucas.moura128@gmail.com> Signed-off-by: Matheus Faria <matheus.sousa.faria@gmail.com>
Showing
1 changed file
with
13 additions
and
6 deletions
Show diff stats
docs/source/user.rst
... | ... | @@ -65,7 +65,7 @@ Add a new plugin |
65 | 65 | |
66 | 66 | - Make sure the application has the following requirements |
67 | 67 | |
68 | - - Suport for remote user authentication | |
68 | + - Support for remote user authentication | |
69 | 69 | |
70 | 70 | - A relative url root |
71 | 71 | |
... | ... | @@ -77,6 +77,8 @@ Add a new plugin |
77 | 77 | |
78 | 78 | - create file: [plugin_name].py |
79 | 79 | |
80 | +- Atention: Any URL used in the plugins' settings should not be preceded by "/" | |
81 | + | |
80 | 82 | Use this template for the plugin configuration file |
81 | 83 | |
82 | 84 | .. code-block:: python |
... | ... | @@ -104,10 +106,10 @@ Use this template for the plugin configuration file |
104 | 106 | url = colab_url_factory('[plugin_name]') |
105 | 107 | |
106 | 108 | menu_urls = { |
107 | - url(display=_('[name_of_link_page]'), viewname='[name_of_view_in_the_application]', kwargs={'path': '/[page_appication_path]/' }, auth=True), | |
109 | + url(display=_('[name_of_link_page]'), viewname='[name_of_view_in_the_application]', kwargs={'path': '[page_appication_path]/' }, auth=True), | |
108 | 110 | |
109 | 111 | # You can have more than one url |
110 | - url(display=_('[name_of_link_page]'), viewname='[another_name_of_view_in_the_application]', kwargs={'path': '/[another_page_appication_path]/' }, auth=True), | |
112 | + url(display=_('[name_of_link_page]'), viewname='[another_name_of_view_in_the_application]', kwargs={'path': '[another_page_appication_path]/' }, auth=True), | |
111 | 113 | } |
112 | 114 | |
113 | 115 | |
... | ... | @@ -152,6 +154,8 @@ urls |
152 | 154 | .. attribute:: prefix |
153 | 155 | |
154 | 156 | Declares the prefix for the url. |
157 | + | |
158 | + - Atention: Any URL used in the plugins' settings should not be preceded by "/" | |
155 | 159 | .. attribute:: namespace |
156 | 160 | |
157 | 161 | Declares the namespace for the url. |
... | ... | @@ -164,7 +168,7 @@ These variables defines the menu title and links of the plugin. |
164 | 168 | .. attribute:: menu_title |
165 | 169 | |
166 | 170 | Declares the menu title. |
167 | -.. attribute:: menu_links | |
171 | +.. attribute:: menu_urls | |
168 | 172 | |
169 | 173 | Declares the menu items and its links. |
170 | 174 | This should be a tuple object with several colab_url elements. |
... | ... | @@ -172,6 +176,9 @@ These variables defines the menu title and links of the plugin. |
172 | 176 | namespace. |
173 | 177 | The auth parameter indicates wether the link should only be displayed when |
174 | 178 | the user is logged in. |
179 | + The ``kwargs`` parameter receives a dict, where the key ``path`` should be | |
180 | + a path URL to the page. Remember that this path is a URL, therefore it | |
181 | + should never be preceded by "/". | |
175 | 182 | |
176 | 183 | Example: |
177 | 184 | |
... | ... | @@ -182,8 +189,8 @@ Example: |
182 | 189 | url = colab_url_factory('plugin_app_name') |
183 | 190 | |
184 | 191 | menu_urls = ( |
185 | - url(display=_('Profile'), viewname='profile', kwargs={'path': '/profile/'}, auth=True), | |
186 | - url(display=_('Profile Two'), viewname='profile2', kwargs={'path': '/profile/2'}, auth=True), | |
192 | + url(display=_('Profile'), viewname='profile', kwargs={'path': 'profile/'}, auth=True), | |
193 | + url(display=_('Profile Two'), viewname='profile2', kwargs={'path': 'profile/2'}, auth=True), | |
187 | 194 | ) |
188 | 195 | |
189 | 196 | Extra Template Folders | ... | ... |