You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/api.rst
+11-11
Original file line number
Diff line number
Diff line change
@@ -274,8 +274,8 @@ It is possible to limit the number of returned objects::
274
274
GET http://{pybossa-site-url}/api/{domain-object}[?field1=value&limit=20]
275
275
276
276
277
-
It is possible to access first level JSON keys within the **info** field of Projects,
278
-
Tasks, Task Runs and Results::
277
+
It is possible to access first level JSON keys within the **info** field of Categories,
278
+
Projects, Tasks, Task Runs and Results::
279
279
280
280
GET http://{pybossa-site-url}/api/{domain-object}[?field1=value&info=foo::bar&limit=20]
281
281
@@ -313,9 +313,9 @@ When you use the fulltextsearch argument, the API will return the objects enrich
313
313
* **headline**: The matched words of the key1::value1 found, with <b></b> items to highlight them.
314
314
* **rank**: The ranking returned by the database. Ranking attempts to measure how relevant documents are to a particular query, so that when there are many matches the most relevant ones can be shown first.
315
315
316
-
Here you have an example of the expected output for an api call like this::
316
+
Here you have an example of the expected output for an api call like this::
@@ -349,7 +349,7 @@ Here you have an example of the expected output for an api call like this::
349
349
We use PostgreSQL ts_rank_cd with the following configuration: ts_rank_cd(textsearch, query, 4). For more details check the official documentation of PostgreSQL.
350
350
351
351
.. note::
352
-
By default PYBOSSA uses English for the searches. You can customize this behavior using any of the supported languages by PostgreSQL changing the settings_local.py config variable: *FULLTEXTSEARCH_LANGUAGE* = 'spanish'.
352
+
By default PYBOSSA uses English for the searches. You can customize this behavior using any of the supported languages by PostgreSQL changing the settings_local.py config variable: *FULLTEXTSEARCH_LANGUAGE* = 'spanish'.
353
353
354
354
.. note::
355
355
By default all GET queries return a maximum of 20 objects unless the
@@ -459,14 +459,14 @@ Favorites
459
459
---------
460
460
461
461
Authenticated users can mark a task as a favorite. This is useful for users when they
462
-
want to see all the tasks they have done to remember them. For example, a user can mark
462
+
want to see all the tasks they have done to remember them. For example, a user can mark
463
463
as a favorite a picture that's beautiful and that he/she has marked as favorited.
464
464
465
465
For serving this purpose PYBOSSA provides the following api endpoint::
466
466
467
467
GET /api/favorites
468
468
469
-
If the user is authenticated it will return all the tasks the user has marked as favorited.
469
+
If the user is authenticated it will return all the tasks the user has marked as favorited.
470
470
471
471
To add a task as a favorite, a POST should be done with a payload of {'task_id': Task.id}::
472
472
@@ -493,7 +493,7 @@ You can also use **limit** to get more than 1 task for the user like this::
493
493
494
494
GET http://{pybossa-site-url}/api/{project.id}/newtask?limit=100
495
495
496
-
That query will return 100 tasks for the user.
496
+
That query will return 100 tasks for the user.
497
497
498
498
.. note::
499
499
That's the maximum of tasks that a user can get at once. If you pass an argument of 200,
@@ -610,7 +610,7 @@ User api endpoint
610
610
----------------
611
611
612
612
While all the other endpoints behave the same, this one is a bit special as we deal with private information
613
-
like emails.
613
+
like emails.
614
614
615
615
Anonymous users
616
616
~~~~~~~~~~~~~~~
@@ -3731,7 +3731,7 @@ argument: **?template=basic** for the basic or **?template=iamge** for the image
Then, you can use that template, orif you prefer you can do a POST directly without that information. As in
3734
+
Then, you can use that template, orif you prefer you can do a POST directly without that information. As in
3735
3735
any other request involving a POST you will need the CSRFToken to validate it.
3736
3736
3737
3737
**POST**
@@ -4225,7 +4225,7 @@ Therefore, if you want to import tasks from a CSV link, you will have to do the
4225
4225
4226
4226
GET server/project/<short_name>/tasks/import?type=csv
4227
4227
4228
-
That query will return the same output as before, but instead of the available_importers, you will get the the form fields andCSRF token for that importer.
4228
+
That query will return the same output as before, but instead of the available_importers, you will get the the form fields andCSRF token for that importer.
Copy file name to clipboardExpand all lines: doc/customizing.rst
+13-12
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ Multiple languages
139
139
==================
140
140
141
141
By default PYBOSSA only speaks English, however the default theme comes with a few
142
-
translations (Spanish, French, Italian, Japanese, Greek and German).
142
+
translations (Spanish, French, Italian, Japanese, Greek and German).
143
143
144
144
You can enable those translations (mostly user interface strings and actions) by doing
145
145
the following: creating a symlink to the translations folders:
@@ -150,14 +150,14 @@ the following: creating a symlink to the translations folders:
150
150
151
151
This will use the default translations of PYBOSSA for your server. We recommend to use
152
152
these translations with the default theme. If you use your own theme, the best thing is
153
-
to do your own translation, (see :ref:`translating`), as you might want to name things
153
+
to do your own translation, (see :ref:`translating`), as you might want to name things
154
154
differently on the templates.
155
155
156
156
You can disable/enable different languages in your config file
157
157
**settings_local.py**. For example, to remove French you can add
158
158
this configuration to the settings file:
159
159
160
-
.. code-block:: python
160
+
.. code-block:: python
161
161
162
162
LOCALES= [('en', 'English'), ('es', u'Español'),
163
163
('it', 'Italiano'), ('ja', u'日本語')]
@@ -167,23 +167,23 @@ Also, you can always specify a different default locale using the following
167
167
snippet in the same settings file
168
168
169
169
170
-
.. code-block:: python
170
+
.. code-block:: python
171
171
172
172
DEFAULT_LOCALE='es'
173
173
174
174
175
175
.. note::
176
176
PYBOSSA tries to first match the user preferred language from their
177
177
browser. This will work for anonymous users, while registered ones can
178
-
specify the language they want using their user preferences.
178
+
specify the language they want using their user preferences.
179
179
180
180
181
181
.. note::
182
182
As an alternative way to allow anonymous users to *force* a different
183
183
language, PYBOSSA looks for a cookie named **language** where it expects
184
184
the key of any of the supported langes in the LOCALES list. You can use
185
185
JavaScript to set it up.
186
-
186
+
187
187
188
188
Creating your own theme
189
189
=======================
@@ -699,7 +699,7 @@ Making extra key/value pairs in info field public
699
699
=================================================
700
700
701
701
By default PYBOSSA protects all the information the info field except for those
702
-
values that are public like the url of the image of the project, the container
702
+
values that are public like the url of the image of the project, the container
703
703
where that picture is stored and a few extra. While this will be more than enough
704
704
for most projects, sometimes, a server will need to expose more information publicly
705
705
via the info field for the User and Project Domain Objects.
@@ -712,7 +712,7 @@ to show user's badges to anonymous people.
712
712
With projects it could be the same. You want to highlight some info to anyone, but hide everything else.
713
713
714
714
As PYBOSSA hides everything by default, you can always turn on which other fields from the
715
-
info field can be shown to anonymous users, making them public.
715
+
info field can be shown to anonymous users, making them public.
716
716
717
717
.. note::
718
718
@@ -725,6 +725,7 @@ the following config variables::
725
725
726
726
PROJECT_INFO_PUBLIC_FIELDS = ['key1', 'key2']
727
727
USER_INFO_PUBLIC_FIELDS = ['badges', 'key2', ...]
728
+
CATEGORY_INFO_PUBLIC_FIELDS = ['key1', 'key2']
728
729
729
730
Add as many as you want, need. But please, be careful about which information you disclose.
730
731
@@ -903,7 +904,7 @@ If you want to enable it, you will have to add to your settings_local.py::
903
904
904
905
SSE = True
905
906
906
-
Also, you will need to configure uwsgi and nginx to support SSE events. This is not
907
+
Also, you will need to configure uwsgi and nginx to support SSE events. This is not
907
908
trivial, as there are several different scenarios, libraries and options, so instead of
908
909
recommending one solution, we invite you to read the `uwsgi documentation about it <http://uwsgi-docs.readthedocs.org/en/latest/Async.html>`_, so you can take a decission based on your
909
910
own infrastructure and preferences.
@@ -996,7 +997,7 @@ Web Push notifications
996
997
onesignal.com in order to support this feature. If you cannot use HTTPS we recommend to not enable
997
998
it.
998
999
999
-
PYBOSSA can send web push notifications to Google Chrome, Mozilla Firefox and Safari browsers.
1000
+
PYBOSSA can send web push notifications to Google Chrome, Mozilla Firefox and Safari browsers.
1000
1001
1001
1002
For supporting this feature, PYBOSSA uses the Onesignal.com service. You will need an account and create
1002
1003
an app for your PYBOSSA server. Then follow their documentation to download the WebPush SDK and configure
@@ -1016,13 +1017,13 @@ settings_local.py file::
1016
1017
ONESIGNAL_APP_ID = 'app-id'
1017
1018
ONESIGNAL_API_KEY = 'app-key'
1018
1019
1019
-
Restart the server, and add one background worker for the *webpush* queue. This queue will handle the
1020
+
Restart the server, and add one background worker for the *webpush* queue. This queue will handle the
1020
1021
creation of the apps, as well as sending the push notifications.
1021
1022
1022
1023
Then you will need to update your PYBOSSA theme in order to allow your users to subscribe. As this could
1023
1024
vary a lot from one project to another, we do not provide a template but some guidelines:
1024
1025
1025
-
* Use the JS SDK to subscribe a user to a given project using the *tags* option of Onesignal.
1026
+
* Use the JS SDK to subscribe a user to a given project using the *tags* option of Onesignal.
1026
1027
* PYBOSSA sends notifications using those tags thanks to the *filters* option that allows us to
1027
1028
segment traffic. PYBOSSA is especting the project.id as the tag key for segmenting.
1028
1029
* The JS SDK allows you to subscribe/unsubscribe a user to a give project (not only the whole server) with
0 commit comments