From 1916a83c727ee936c5cfcba140c4a4c7d62803a6 Mon Sep 17 00:00:00 2001 From: Eduardo Douglas Date: Fri, 16 Nov 2018 09:46:14 -0300 Subject: [PATCH] Policies on U-Report --- .travis.yml | 2 +- locale/en/LC_MESSAGES/django.po | 2140 ++++--------------- static/less/ureport2.less | 65 + templates/frame.haml | 55 + templates/policies/policy_admin.haml | 90 + templates/policies/policy_read.haml | 48 + templates/public/policies.haml | 14 + ureport/policies/__init__.py | 0 ureport/policies/migrations/0001_initial.py | 35 + ureport/policies/migrations/__init__.py | 0 ureport/policies/models.py | 35 + ureport/policies/tests.py | 59 + ureport/policies/urls.py | 6 + ureport/policies/views.py | 75 + ureport/polls/templatetags/ureport.py | 13 + ureport/polls/tests.py | 17 +- ureport/public/tests.py | 22 + ureport/public/urls.py | 2 + ureport/public/views.py | 15 + ureport/settings_common.py | 1 + ureport/urls.py | 1 + 21 files changed, 978 insertions(+), 1717 deletions(-) create mode 100644 templates/policies/policy_admin.haml create mode 100644 templates/policies/policy_read.haml create mode 100644 templates/public/policies.haml create mode 100644 ureport/policies/__init__.py create mode 100644 ureport/policies/migrations/0001_initial.py create mode 100644 ureport/policies/migrations/__init__.py create mode 100644 ureport/policies/models.py create mode 100644 ureport/policies/tests.py create mode 100644 ureport/policies/urls.py create mode 100644 ureport/policies/views.py diff --git a/.travis.yml b/.travis.yml index 3d1467ae6..0aaa061d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,6 @@ before_script: - ln -s $TRAVIS_BUILD_DIR/ureport/settings.py.postgres $TRAVIS_BUILD_DIR/ureport/settings.py script: - flake8 -- coverage run --source="." manage.py test ureport ureport/admins ureport/assets ureport/contacts ureport/countries ureport/jobs ureport/locations ureport/news ureport/polls ureport/public ureport/utils --verbosity=2 --noinput +- coverage run --source="." manage.py test ureport ureport/admins ureport/assets ureport/contacts ureport/countries ureport/jobs ureport/locations ureport/news ureport/policies ureport/polls ureport/public ureport/utils --verbosity=2 --noinput after_success: - coveralls \ No newline at end of file diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index d9dd329d3..041bd1573 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-05-10 09:35+0000\n" +"POT-Creation-Date: 2018-11-14 11:57+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,2074 +17,784 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: dash/categories/models.py:20 -msgid "The name of this category" +#: templates/frame.haml:8 templates/public/org_chooser.haml:7 +msgid "U-Report" msgstr "" -#: dash/categories/models.py:23 -msgid "An optional image that can describe this category" +#: templates/frame.haml:231 +msgid "Admin" msgstr "" -#: dash/categories/models.py:26 ureport/polls/models.py:65 -msgid "The organization this category applies to" +#: templates/frame.haml:239 +msgid "Configuration" msgstr "" -#: dash/categories/models.py:47 templates/frame.haml:285 -#: templates/frame.haml:292 -msgid "Categories" +#: templates/frame.haml:245 +msgid "Orgs" msgstr "" -#: dash/categories/models.py:53 dash/stories/models.py:129 -#: ureport/polls/models.py:639 -msgid "The name to describe this image" +#: templates/frame.haml:251 +msgid "Users" msgstr "" -#: dash/categories/models.py:56 -msgid "The category this image represents" +#: templates/frame.haml:257 +msgid "Content Types" msgstr "" -#: dash/categories/models.py:59 dash/stories/models.py:135 -#: ureport/polls/models.py:645 -msgid "The image file to use" +#: templates/frame.haml:264 +msgid "Images" msgstr "" -#: dash/dashblocks/models.py:19 -msgid "The human readable name for this content type" +#: templates/frame.haml:270 +msgid "Policies" msgstr "" -#: dash/dashblocks/models.py:22 -msgid "The slug to idenfity this content type, used with the template tags" +#: templates/frame.haml:278 templates/frame.haml:339 +msgid "Content" msgstr "" -#: dash/dashblocks/models.py:26 -msgid "" -"A description of where this content type is used on the site and how it will " -"be dsiplayed" +#: templates/frame.haml:287 +msgid "Country Aliases" msgstr "" -#: dash/dashblocks/models.py:31 -msgid "Whether this content should include a title" +#: templates/frame.haml:304 templates/frame.haml:540 +msgid "Polls" msgstr "" -#: dash/dashblocks/models.py:34 -msgid "Whether this content should include an image" +#: templates/frame.haml:312 templates/frame.haml:319 +msgid "Categories" msgstr "" -#: dash/dashblocks/models.py:37 -msgid "Whether this content should use a rich HTML editor" +#: templates/frame.haml:327 +msgid "Category Images" msgstr "" -#: dash/dashblocks/models.py:40 -msgid "Whether this content should include a summary field" +#: templates/frame.haml:347 +msgid "News Items" msgstr "" -#: dash/dashblocks/models.py:43 -msgid "Whether this content should include a link" +#: templates/frame.haml:356 templates/frame.haml:546 +#: templates/public/stories.haml:7 +msgid "Stories" msgstr "" -#: dash/dashblocks/models.py:46 -msgid "" -"Whether this content should allow upload of additional images, ie a gallery" +#: templates/frame.haml:365 +msgid "Job Sources" msgstr "" -#: dash/dashblocks/models.py:50 -msgid "Whether this content has a color field" +#: templates/frame.haml:372 +msgid "Jobs Content" msgstr "" -#: dash/dashblocks/models.py:53 -msgid "Whether this content should allow setting a YouTube id" +#: templates/frame.haml:382 +msgid "About Content" msgstr "" -#: dash/dashblocks/models.py:56 -msgid "Whether this content should allow tags" +#: templates/frame.haml:388 +msgid "Videos" msgstr "" -#: dash/dashblocks/models.py:69 -msgid "Content Type" +#: templates/frame.haml:394 +msgid "Contact Us Content" msgstr "" -#: dash/dashblocks/models.py:70 -msgid "The category, or type for this content block" +#: templates/frame.haml:400 +msgid "Missions Content" msgstr "" -#: dash/dashblocks/models.py:74 -msgid "The title for this block of content, optional" +#: templates/frame.haml:406 +msgid "Terms & Conditions" msgstr "" -#: dash/dashblocks/models.py:77 -msgid "The summary for this item, should be short" +#: templates/frame.haml:413 +msgid "U-Reporters Content" msgstr "" -#: dash/dashblocks/models.py:80 -msgid "The body of text for this content block, optional" +#: templates/frame.haml:420 +msgid "Join & Engage Content" msgstr "" -#: dash/dashblocks/models.py:83 -msgid "Any image that should be displayed with this content block, optional" +#: templates/frame.haml:426 +msgid "Join Steps Content" msgstr "" -#: dash/dashblocks/models.py:87 -msgid "A background color to use for the image, in the format: #rrggbb" +#: templates/frame.haml:433 +msgid "Additional Menu" msgstr "" -#: dash/dashblocks/models.py:91 -msgid "Any link that should be associated with this content block, optional" +#: templates/frame.haml:450 +msgid "Logout" msgstr "" -#: dash/dashblocks/models.py:95 ureport/news/models.py:42 -msgid "The id of the YouTube video that should be linked to this item" +#: templates/frame.haml:456 templates/frame.haml:697 +#: templates/smartmin/users/login.haml:49 +msgid "Login" msgstr "" -#: dash/dashblocks/models.py:99 +#: templates/frame.haml:473 msgid "" -"Any tags for this content block, separated by spaces, can be used to do more " -"advanced filtering, optional" -msgstr "" - -#: dash/dashblocks/models.py:103 -msgid "The priority for this block, higher priority blocks come first" -msgstr "" - -#: dash/dashblocks/models.py:108 -msgid "The organization this content block belongs to" +"This website uses cookies. By continuing to browse this site you are " +"agreeing to our" msgstr "" -#: dash/dashblocks/templates/dashblocks/dashblock_form.haml:8 -msgid "Gallery" +#: templates/frame.haml:476 +msgid "Cookie Policy" msgstr "" -#: dash/dashblocks/templates/dashblocks/dashblock_form.haml:17 -msgid "Add Image" +#: templates/frame.haml:485 templates/frame.haml:641 +msgid "Privacy Policy" msgstr "" -#: dash/dashblocks/templates/dashblocks/dashblock_list.haml:34 -#: smartmin/templates/smartmin/list.html:14 -msgid "Search" +#: templates/frame.haml:494 templates/frame.haml:648 +msgid "Terms of Service" msgstr "" -#: dash/dashblocks/templates/dashblocks/dashblock_list.haml:61 -#: smartmin/templates/smartmin/list.html:25 templates/polls/poll_list.haml:6 -msgid "Add" +#: templates/frame.haml:534 +msgid "About" msgstr "" -#: dash/dashblocks/views.py:16 templates/frame.haml:235 -msgid "Content Types" +#: templates/frame.haml:552 +msgid "U-Reporters" msgstr "" -#: dash/dashblocks/views.py:118 -msgid "Content Blocks" +#: templates/frame.haml:559 templates/public/jobs.haml:7 +msgid "Jobs" msgstr "" -#: dash/dashblocks/views.py:120 -#, python-format -msgid "%s Blocks" +#: templates/frame.haml:566 +msgid "Join & Engage" msgstr "" -#: dash/dashblocks/views.py:158 smartmin/views.py:1105 -#, python-format -msgid "Edit %s" +#: templates/frame.haml:634 +msgid "Cookies Policy" msgstr "" -#: dash/dashblocks/views.py:182 smartmin/views.py:1328 -#, python-format -msgid "Create %s" +#: templates/frame.haml:658 +msgid "FOLLOW US ON" msgstr "" -#: dash/dashblocks/views.py:184 -msgid "Create Content Block" +#: templates/jobs/jobsource_create.haml:8 +msgid "" +"\n" +" To add a Twitter job source you are required to get a widget id from " +"twitter.\n" +" " msgstr "" -#: dash/orgs/forms.py:12 -msgid "Your first name" +#: templates/jobs/jobsource_create.haml:12 +#: templates/jobs/jobsource_update.haml:12 +msgid "Follow this step by step guide" msgstr "" -#: dash/orgs/forms.py:13 -msgid "Your last name" +#: templates/jobs/jobsource_create.haml:15 +#: templates/jobs/jobsource_update.haml:15 +msgid "" +"\n" +"
After you create the widget copy the widget id from the url as " +"shown on
\n" +" " msgstr "" -#: dash/orgs/forms.py:14 -msgid "Your email address" +#: templates/jobs/jobsource_create.haml:30 +msgid "Next" msgstr "" -#: dash/orgs/forms.py:17 -msgid "Your password, at least eight letters please" +#: templates/jobs/jobsource_create.haml:33 +msgid "Cancel" msgstr "" -#: dash/orgs/forms.py:23 -msgid "That email address is already used" +#: templates/jobs/jobsource_create.haml:40 +msgid "Back" msgstr "" -#: dash/orgs/forms.py:30 -msgid "Passwords must contain at least 8 letters." +#: templates/jobs/jobsource_update.haml:8 +msgid "" +"\n" +" Remember for a Twitter job source you are required to get a widget " +"id from twitter.\n" +" " msgstr "" -#: dash/orgs/forms.py:49 -msgid "This domain is used for subdomains" +#: templates/orgs/org_home.haml:22 +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_home.haml:8 +msgid "Edit" msgstr "" -#: dash/orgs/models.py:36 dash/orgs/models.py:365 ureport/assets/models.py:19 -msgid "Name" +#: templates/orgs/org_home.haml:27 +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_home.haml:13 +msgid "Manage Backends" msgstr "" -#: dash/orgs/models.py:37 -msgid "The name of this organization" +#: templates/orgs/org_home.haml:32 +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_home.haml:18 +msgid "Manage Users" msgstr "" -#: dash/orgs/models.py:41 -msgid "The logo that should be used for this organization" +#: templates/policies/policy_admin.haml:9 +msgid "New Policy" msgstr "" -#: dash/orgs/models.py:44 dash/orgs/views.py:297 -msgid "Administrators" +#: templates/policies/policy_admin.haml:25 +#: templates/policies/policy_read.haml:13 +msgid "edit" msgstr "" -#: dash/orgs/models.py:45 -msgid "The administrators in your organization" +#: templates/policies/policy_admin.haml:35 +msgid "Previous Policies" msgstr "" -#: dash/orgs/models.py:48 -msgid "Viewers" +#: templates/policies/policy_admin.haml:41 +msgid "Language" msgstr "" -#: dash/orgs/models.py:49 -msgid "The viewers in your organization" +#: templates/policies/policy_admin.haml:44 +msgid "Created" msgstr "" -#: dash/orgs/models.py:52 dash/orgs/templates/orgs/org_manage_accounts.haml:19 -#: dash/orgs/views.py:298 -msgid "Editors" +#: templates/policies/policy_admin.haml:61 +msgid "view" msgstr "" -#: dash/orgs/models.py:53 -msgid "The editors in your organization" -msgstr "" +#: templates/policies/policy_admin.haml:77 +#, python-format +msgid "" +"\n" +"\t\t\t\t\t\t\t\t\t%(counter)s result\n" +" " +msgid_plural "" +"\n" +" %(counter)s results\n" +"\n" +"\t\t\t\t\t\t\t" +msgstr[0] "" +msgstr[1] "" -#: dash/orgs/models.py:56 -msgid "Language" +#: templates/polls/poll_list.haml:6 +#: venv/lib/python3.6/site-packages/dash/dashblocks/templates/dashblocks/dashblock_list.haml:61 +msgid "Add" msgstr "" -#: dash/orgs/models.py:57 -msgid "The main language used by this organization" +#: templates/public/about.haml:16 templates/public/about.haml:68 +msgid "ABOUT U-REPORT" msgstr "" -#: dash/orgs/models.py:60 -msgid "Subdomain" +#: templates/public/about.haml:22 templates/public/ureporters.haml:23 +msgid "Scroll to Learn more" msgstr "" -#: dash/orgs/models.py:61 -msgid "This subdomain is not available" +#: templates/public/about.haml:80 +msgid "The mission of U-Report" msgstr "" -#: dash/orgs/models.py:62 -msgid "The subdomain for this organization" +#: templates/public/about.haml:119 +msgid "Why Join U-Report?" msgstr "" -#: dash/orgs/models.py:65 -msgid "Domain" +#: templates/public/about.haml:124 +msgid "Speak out on what's happening in your community" msgstr "" -#: dash/orgs/models.py:66 -msgid "This domain is not available" +#: templates/public/about.haml:127 +msgid "" +"Use U-Report results and information to update and increase citizen's " +"awareness" msgstr "" -#: dash/orgs/models.py:67 -msgid "The custom domain for this organization" +#: templates/public/about.haml:130 +msgid "Participate in nationwide campaigns to help improve your country" msgstr "" -#: dash/orgs/models.py:70 -msgid "Timezone" +#: templates/public/about.haml:133 +#, python-format +msgid "Share what's happening around %(country)s with other U-Reporters" msgstr "" -#: dash/orgs/models.py:71 -msgid "The timezone your organization is in." +#: templates/public/about.haml:139 +msgid "CLICK HERE TO JOIN" msgstr "" -#: dash/orgs/models.py:75 -msgid "The API token for the RapidPro account this dashboard is tied to" +#: templates/public/about.haml:153 +msgid "U-REPORT VIDEOS" msgstr "" -#: dash/orgs/models.py:80 -msgid "" -"JSON blob used to store configuration information associated with this " -"organization" +#: templates/public/about.haml:160 +msgid "No videos yet." msgstr "" -#: dash/orgs/models.py:295 -msgid "Administrator" +#: templates/public/about.haml:178 +msgid "WATCH IT ON YOUTUBE" msgstr "" -#: dash/orgs/models.py:296 -msgid "Editor" +#: templates/public/all_polls.haml:5 +msgid "MORE POLLS" msgstr "" -#: dash/orgs/models.py:297 -msgid "Viewer" +#: templates/public/all_polls.haml:12 templates/public/archived_stories.haml:12 +msgid "FILTER" msgstr "" -#: dash/orgs/models.py:302 dash/orgs/models.py:361 ureport/assets/models.py:16 -#: ureport/contacts/models.py:44 -msgid "Org" +#: templates/public/all_polls.haml:19 templates/public/archived_stories.haml:19 +#: templates/public/stories.haml:72 templates/public/strings_values.haml:4 +msgid "All" msgstr "" -#: dash/orgs/models.py:303 -msgid "The organization to which the account is invited to view" +#: templates/public/all_polls.haml:33 +msgid "POLL LIST" msgstr "" -#: dash/orgs/models.py:306 -msgid "Email" +#: templates/public/all_polls.haml:35 +msgid "All polls from most recent to oldest" msgstr "" -#: dash/orgs/models.py:307 -msgid "The email to which we send the invitation of the viewer" +#: templates/public/archived_stories.haml:5 +msgid "ARCHIVED STORIES" msgstr "" -#: dash/orgs/models.py:310 -msgid "Secret" +#: templates/public/archived_stories.haml:33 +msgid "LIST" msgstr "" -#: dash/orgs/models.py:311 -msgid "a unique code associated with this invitation" +#: templates/public/index.haml:21 +msgid "Follow" msgstr "" -#: dash/orgs/models.py:314 -msgid "User Role" +#: templates/public/index.haml:29 +msgid "" +"\n" +" U-Report is a social messaging tool that is free to " +"everyone, wherever you are in the world, to speak out on development issues, " +"support child rights and improve our communities\n" +" " msgstr "" -#: dash/orgs/models.py:345 -#, python-format -msgid "%s Invitation" +#: templates/public/index.haml:36 templates/public/index.haml:74 +msgid "CURRENT POLL" msgstr "" -#: dash/orgs/models.py:357 ureport/assets/models.py:11 -msgid "Banner" +#: templates/public/index.haml:42 +msgid "View Full Results" msgstr "" -#: dash/orgs/models.py:358 ureport/assets/models.py:12 -msgid "Pattern" +#: templates/public/index.haml:52 +msgid "All U-Report members" msgstr "" -#: dash/orgs/models.py:362 -msgid "The organization in which the image will be used" +#: templates/public/index.haml:97 +msgid "RESPONSE RATE" msgstr "" -#: dash/orgs/models.py:366 -msgid "The name to describe this background" +#: templates/public/index.haml:103 +msgid "Responded out of" msgstr "" -#: dash/orgs/models.py:369 -msgid "Background type" +#: templates/public/index.haml:111 +msgid "RESPONDER'S RATE BY LOCATION" msgstr "" -#: dash/orgs/models.py:371 ureport/assets/models.py:24 -msgid "The image file" +#: templates/public/index.haml:117 +msgid "Most responded" msgstr "" -#: dash/orgs/templates/orgs/email/invitation_email.html:9 +#: templates/public/index.haml:149 #, python-format msgid "" "\n" -" You've been invited to join %(org_name)s.\n" -"
\n" -" To accept the invitation, click here.\n" -" " +" %(responded)s of %(total)s\n" +" " msgstr "" -#: dash/orgs/templates/orgs/org_home.haml:8 templates/orgs/org_home.haml:8 -msgid "Edit" +#: templates/public/index.haml:164 +msgid "TRENDING WORDS" msgstr "" -#: dash/orgs/templates/orgs/org_home.haml:13 templates/orgs/org_home.haml:13 -msgid "Manage Users" +#: templates/public/index.haml:174 +msgid "FEATURED RESPONSES" msgstr "" -#: dash/orgs/templates/orgs/org_manage_accounts.haml:13 -msgid "Accounts" +#: templates/public/index.haml:197 templates/public/index.haml:522 +msgid "View full results" msgstr "" -#: dash/orgs/templates/orgs/org_manage_accounts.haml:16 -msgid "Admins" +#: templates/public/index.haml:217 templates/public/ureporters.haml:16 +msgid "U-REPORTERS IN" msgstr "" -#: dash/orgs/templates/orgs/org_manage_accounts.haml:22 -#: smartmin/templates/smartmin/delete_confirm.html:26 -#: smartmin/templates/smartmin/update.html:10 -msgid "Remove" +#: templates/public/index.haml:225 +msgid "TOTAL # OF U-REPORTERS" msgstr "" -#: dash/orgs/templates/orgs/org_manage_accounts.haml:29 -msgid "You must have at least one administator" +#: templates/public/index.haml:237 +msgid "4 MOST ACTIVE REGIONS" msgstr "" -#: dash/orgs/views.py:168 -msgid "Select your Organization" +#: templates/public/index.haml:248 templates/public/index.haml:269 +msgid "RATE BY GENDER" msgstr "" -#: dash/orgs/views.py:179 -msgid "" -"Your account is not associated to an organization. Please Contact the " -"adminstrator." +#: templates/public/index.haml:257 templates/public/index.haml:310 +msgid "RATE BY AGE" msgstr "" -#: dash/orgs/views.py:219 dash/orgs/views.py:229 -msgid "Your Organization" +#: templates/public/index.haml:322 +msgid "WHAT U-REPORTERS ARE SAYING" msgstr "" -#: dash/orgs/views.py:226 -msgid "Not Set" +#: templates/public/index.haml:331 +msgid "FEATURED VIDEO" msgstr "" -#: dash/orgs/views.py:296 -msgid "Invite people to your organization" +#: templates/public/index.haml:337 +msgid "Watch more videos" msgstr "" -#: dash/orgs/views.py:299 -msgid "User group" +#: templates/public/index.haml:348 +msgid "FEATURED REGION" msgstr "" -#: dash/orgs/views.py:310 -msgid "One of the emails you entered is invalid." +#: templates/public/index.haml:372 +msgid "Check more stories in U-Report app" msgstr "" -#: dash/orgs/views.py:323 -#, python-format -msgid "Manage %(name)s Accounts" +#: templates/public/index.haml:391 templates/public/join_engage.haml:103 +msgid "View more stories on Facebook" msgstr "" -#: dash/orgs/views.py:437 smartmin/views.py:1299 -msgid "Create" +#: templates/public/index.haml:410 +msgid "View more on Instagram" msgstr "" -#: dash/orgs/views.py:445 -msgid "" -"Your invitation link is invalid. Please contact your organization " -"administrator." +#: templates/public/index.haml:430 +msgid "Read more tweets on Twitter" msgstr "" -#: dash/orgs/views.py:501 dash/orgs/views.py:546 -#, python-format -msgid "Join %(name)s" +#: templates/public/index.haml:441 +msgid "NEWS FEED" msgstr "" -#: dash/orgs/views.py:523 -msgid "Join" +#: templates/public/index.haml:456 templates/public/index.haml:536 +msgid "STORY" msgstr "" -#: dash/orgs/views.py:532 -msgid "" -"Your invitation link has expired. Please contact your organization " -"administrator." +#: templates/public/index.haml:477 templates/public/index.haml:561 +#: templates/public/stories.haml:39 templates/public/stories.haml:123 +msgid "Read full story" msgstr "" -#: dash/orgs/views.py:639 -msgid "Task" +#: templates/public/index.haml:499 +msgid "Response Rate" msgstr "" -#: dash/orgs/views.py:643 -msgid "Tasks" +#: templates/public/index.haml:697 +msgid "Read this story" msgstr "" -#: dash/stories/models.py:13 -msgid "The title for this story" +#: templates/public/jobs.haml:22 +msgid "JOBS" msgstr "" -#: dash/stories/models.py:17 -msgid "Whether this story is featured" +#: templates/public/jobs.haml:28 +msgid "Scroll to see job details" msgstr "" -#: dash/stories/models.py:20 -msgid "The summary for the story" +#: templates/public/jobs.haml:78 templates/public/join_engage.haml:123 +msgid "Tweet to" msgstr "" -#: dash/stories/models.py:22 -msgid "The body of text for the story" +#: templates/public/jobs.haml:99 templates/public/polls.haml:379 +msgid "Read more" msgstr "" -#: dash/stories/models.py:24 -msgid "The writer of the story" +#: templates/public/jobs.haml:108 +msgid "Visit" msgstr "" -#: dash/stories/models.py:27 -msgid "A link to an mp3 file to publish on this story" +#: templates/public/join_engage.haml:17 +msgid "JOIN U-REPORT" msgstr "" -#: dash/stories/models.py:31 -msgid "" -"The id of the YouTube video that should be linked to this story (this is the " -"text that comes afer v= and before & in the YouTube URL)" +#: templates/public/join_engage.haml:44 +msgid "HOW TO JOIN" msgstr "" -#: dash/stories/models.py:37 +#: templates/public/join_engage.haml:76 +#, python-format msgid "" -"Any tags for this story, separated by spaces, can be used to do more " -"advanced filtering, optional" +"\n" +" * U-Report is a free program sponsored by UNICEF with help " +"of Network Providers in %(country)s. U-Report will not ask for any payments " +"nor personal financial information, PLEASE disregard any messages which ask " +"you for payment either on this number or on the Facebook and Twitter pages. " +"All U-Report services (all msg on %(shortcode)s) are free.\n" +"\n" +" " msgstr "" -#: dash/stories/models.py:42 -msgid "The category for this story" +#: templates/public/join_engage.haml:88 +msgid "U-REPORT ON SOCIAL MEDIA" msgstr "" -#: dash/stories/models.py:46 -msgid "The organization this story belongs to" +#: templates/public/join_engage.haml:144 +msgid "Compose new Tweet" msgstr "" -#: dash/stories/models.py:124 templates/frame.haml:329 templates/frame.haml:481 -#: templates/public/stories.haml:7 -msgid "Stories" +#: templates/public/polls.haml:16 +msgid "CURRENT POLL IN" msgstr "" -#: dash/stories/models.py:132 -msgid "The story to associate to" +#: templates/public/polls.haml:29 +#, python-format +msgid "" +"\n" +" %(questions)s question polled on this topic\n" +" " +msgid_plural "" +"\n" +" %(questions)s questions polled on this topic\n" +" " +msgstr[0] "" +msgstr[1] "" + +#: templates/public/polls.haml:43 +msgid "response rate" msgstr "" -#: dash/stories/views.py:59 -msgid "Yes" +#: templates/public/polls.haml:49 +msgid "responded out of" msgstr "" -#: dash/stories/views.py:60 -msgid "No" +#: templates/public/polls.haml:53 +msgid "polled" msgstr "" -#: dash/stories/views.py:79 -msgid "Story Images" +#: templates/public/polls.haml:96 +msgid "POLL RESULTS" msgstr "" -#: dash/stories/views.py:91 dash/stories/views.py:99 ureport/polls/views.py:164 -#: ureport/polls/views.py:171 +#: templates/public/polls.haml:112 #, python-format -msgid "Image %d" +msgid "" +"\n" +" %(responded)s responded out of %(polled)s polled\n" +" " msgstr "" -#: dash/stories/views.py:92 -msgid "Image to display on story page and in previews. (optional)" -msgstr "" - -#: dash/stories/views.py:100 -msgid "Image to display on story page and in previews (optional)" -msgstr "" - -#: smartmin/templates/smartmin/delete_confirm.html:11 -msgid "Remove Item?" -msgstr "" - -#: smartmin/templates/smartmin/delete_confirm.html:13 -#, python-format -msgid "" -"\n" -" Are you sure you want to remove %(object)s?\n" -" " -msgstr "" - -#: smartmin/templates/smartmin/delete_confirm.html:17 -msgid "" -"Once it is removed, it will be gone forever. There is no way to undo this " -"operation." -msgstr "" - -#: smartmin/templates/smartmin/delete_confirm.html:24 -#: smartmin/templates/smartmin/form.html:50 -#: smartmin/templates/smartmin/update.html:8 -#: templates/jobs/jobsource_create.haml:33 -msgid "Cancel" -msgstr "" - -#: smartmin/templates/smartmin/list.html:79 -#, python-format -msgid "" -"\n" -"\t\t%(counter)s result\n" -"\t" -msgid_plural "" -"\n" -" %(counter)s results\n" -" " -msgstr[0] "" -msgstr[1] "" - -#: smartmin/templates/smartmin/list.html:85 -#, python-format -msgid "" -"\n" -"\tResults %(start)s-%(end)s of %(count)s\n" -"\t" -msgstr "" - -#: smartmin/templates/smartmin/list.html:95 -#: smartmin/templates/smartmin/list.html:97 -msgid "Previous" -msgstr "" - -#: smartmin/templates/smartmin/list.html:128 -#: smartmin/templates/smartmin/list.html:130 -#: templates/jobs/jobsource_create.haml:30 -msgid "Next" -msgstr "" - -#: smartmin/templates/smartmin/read.html:13 -msgid "edit" -msgstr "" - -#: smartmin/templates/smartmin/users/login.html:10 -#: templates/smartmin/users/login.haml:14 -msgid "Sign in" -msgstr "" - -#: smartmin/templates/smartmin/users/login.html:33 templates/frame.haml:429 -#: templates/frame.haml:606 templates/smartmin/users/login.haml:49 -msgid "Login" -msgstr "" - -#: smartmin/templates/smartmin/users/login.html:35 -#: templates/smartmin/users/login.haml:54 -msgid "Forgot Password?" -msgstr "" - -#: smartmin/templates/smartmin/users/user_expired.html:7 -msgid "Token Expired" -msgstr "" - -#: smartmin/templates/smartmin/users/user_failed.html:9 -msgid "Login Failure" -msgstr "" - -#: smartmin/templates/smartmin/users/user_failed.html:11 -#, python-format -msgid "" -"\n" -" Sorry, you cannot log in at this time because we received " -"%(failed_login_limit)s incorrect login attempts.\n" -" " -msgstr "" - -#: smartmin/templates/smartmin/users/user_failed.html:18 -#, python-format -msgid "" -"\n" -" Please wait %(lockout_timeout)s minutes before to try log in again.\n" -" " -msgstr "" - -#: smartmin/templates/smartmin/users/user_failed.html:25 -msgid "" -"Alternatively, you can fill out the form below to have your password reset " -"via e-mail." -msgstr "" - -#: smartmin/templates/smartmin/users/user_failed.html:27 -msgid "Please contact the website administrator to have your password reset." -msgstr "" - -#: smartmin/templates/smartmin/users/user_failed.html:39 -msgid "Email Address" -msgstr "" - -#: smartmin/templates/smartmin/users/user_failed.html:41 -msgid "Recover" -msgstr "" - -#: smartmin/templates/smartmin/users/user_forget.html:6 -msgid "" -"Please enter the email address you used to sign up and we will help you " -"recover your password." -msgstr "" - -#: smartmin/templates/smartmin/users/user_newpassword.html:7 -#, python-format -msgid "" -"\n" -" Your password has expired. Site policy states that you " -"must pick a new password every %(expire_days)s days, and that passwords must " -"not have been used within the previous %(window_days)s days.\n" -" " -msgstr "" - -#: smartmin/users/views.py:28 smartmin/users/views.py:69 -#: smartmin/users/views.py:87 smartmin/users/views.py:137 -#: smartmin/users/views.py:243 smartmin/users/views.py:271 -msgid "New Password" -msgstr "" - -#: smartmin/users/views.py:37 smartmin/users/views.py:75 -#: smartmin/users/views.py:110 smartmin/users/views.py:161 -msgid "" -"Passwords must have at least 8 characters, including one uppercase, one " -"lowercase and one number" -msgstr "" - -#: smartmin/users/views.py:79 smartmin/users/views.py:114 -#: smartmin/users/views.py:165 -msgid "" -"You have used this password before in the past year, please use a new " -"password." -msgstr "" - -#: smartmin/users/views.py:86 smartmin/users/views.py:220 -#: smartmin/users/views.py:270 -msgid "Password" -msgstr "" - -#: smartmin/users/views.py:88 -msgid "Confirm Password" -msgstr "" - -#: smartmin/users/views.py:94 -msgid "Please enter your password to save changes." -msgstr "" - -#: smartmin/users/views.py:103 -msgid "Confirm the new password by filling the this field" -msgstr "" - -#: smartmin/users/views.py:106 -msgid "New password doesn't match with its confirmation" -msgstr "" - -#: smartmin/users/views.py:121 -msgid "Your Email" -msgstr "" - -#: smartmin/users/views.py:128 -msgid "" -"E-mail recovery is not supported, please contact the website administrator " -"to reset your password manually." -msgstr "" - -#: smartmin/users/views.py:135 -msgid "Current Password" -msgstr "" - -#: smartmin/users/views.py:136 -msgid "Your current password" -msgstr "" - -#: smartmin/users/views.py:138 -msgid "Your new password." -msgstr "" - -#: smartmin/users/views.py:139 -msgid "Confirm new Password" -msgstr "" - -#: smartmin/users/views.py:140 -msgid "Confirm your new password." -msgstr "" - -#: smartmin/users/views.py:145 -msgid "Please enter your password to save changes" -msgstr "" - -#: smartmin/users/views.py:154 -msgid "Confirm your new password by entering it here" -msgstr "" - -#: smartmin/users/views.py:157 -msgid "Mismatch between your new password and confirmation, try again" -msgstr "" - -#: smartmin/users/views.py:215 -msgid "New user created successfully." -msgstr "" - -#: smartmin/users/views.py:218 smartmin/users/views.py:241 -msgid "Groups" -msgstr "" - -#: smartmin/users/views.py:219 -msgid "Users will only get those permissions that are allowed for their group." -msgstr "" - -#: smartmin/users/views.py:220 -msgid "Set the user's initial password here." -msgstr "" - -#: smartmin/users/views.py:239 -msgid "Last Login" -msgstr "" - -#: smartmin/users/views.py:240 -msgid "Is Active" -msgstr "" - -#: smartmin/users/views.py:240 -msgid "Whether this user is allowed to log into the site" -msgstr "" - -#: smartmin/users/views.py:242 -msgid "Users will only get those permissions that are allowed for their group" -msgstr "" - -#: smartmin/users/views.py:244 -msgid "You can reset the user's password by entering a new password here" -msgstr "" - -#: smartmin/users/views.py:269 -msgid "Username" -msgstr "" - -#: smartmin/users/views.py:270 -msgid "Your password" -msgstr "" - -#: smartmin/users/views.py:271 -msgid "If you want to set a new password, enter it here" -msgstr "" - -#: smartmin/users/views.py:272 -msgid "Confirm New Password" -msgstr "" - -#: smartmin/users/views.py:272 -msgid "Confirm your new password" -msgstr "" - -#: smartmin/users/views.py:287 -msgid "Edit your profile" -msgstr "" - -#: smartmin/users/views.py:290 -msgid "Password Recovery" -msgstr "" - -#: smartmin/users/views.py:294 -msgid "An Email has been sent to your account with further instructions." -msgstr "" - -#: smartmin/users/views.py:323 -msgid "Password Recovery Request" -msgstr "" - -#: smartmin/users/views.py:332 -msgid "Pick a new password" -msgstr "" - -#: smartmin/users/views.py:334 -msgid "Your password has successfully been updated, thank you." -msgstr "" - -#: smartmin/users/views.py:360 -#, python-format -msgid "You are now logged in as %s" -msgstr "" - -#: smartmin/users/views.py:376 -msgid "" -"Password Updated Successfully. Now you can log in using your new password." -msgstr "" - -#: smartmin/users/views.py:379 -msgid "Reset your Password" -msgstr "" - -#: smartmin/users/views.py:391 -msgid "" -"Your link has expired for security reasons. Please reinitiate the process by " -"entering your email here." -msgstr "" - -#: smartmin/views.py:848 -msgid "Submit" -msgstr "" - -#: smartmin/views.py:855 -msgid "Form" -msgstr "" - -#: smartmin/views.py:1173 -msgid "Save Changes" -msgstr "" - -#: smartmin/views.py:1319 -#, python-format -msgid "Your new %s has been created." -msgstr "" - -#: smartmin/views.py:1339 -#, python-format -msgid "Import %s" -msgstr "" - -#: templates/frame.haml:8 templates/public/org_chooser.haml:7 -msgid "U-Report" -msgstr "" - -#: templates/frame.haml:209 -msgid "Admin" -msgstr "" - -#: templates/frame.haml:217 -msgid "Configuration" -msgstr "" - -#: templates/frame.haml:223 -msgid "Orgs" -msgstr "" - -#: templates/frame.haml:229 -msgid "Users" -msgstr "" - -#: templates/frame.haml:242 -msgid "Images" -msgstr "" - -#: templates/frame.haml:251 templates/frame.haml:312 -msgid "Content" -msgstr "" - -#: templates/frame.haml:260 -msgid "Country Aliases" -msgstr "" - -#: templates/frame.haml:277 templates/frame.haml:475 -msgid "Polls" -msgstr "" - -#: templates/frame.haml:300 -msgid "Category Images" -msgstr "" - -#: templates/frame.haml:320 -msgid "News Items" -msgstr "" - -#: templates/frame.haml:338 -msgid "Job Sources" -msgstr "" - -#: templates/frame.haml:345 -msgid "Jobs Content" -msgstr "" - -#: templates/frame.haml:355 -msgid "About Content" -msgstr "" - -#: templates/frame.haml:361 -msgid "Videos" -msgstr "" - -#: templates/frame.haml:367 -msgid "Contact Us Content" -msgstr "" - -#: templates/frame.haml:373 -msgid "Missions Content" -msgstr "" - -#: templates/frame.haml:379 -msgid "Terms & Conditions" -msgstr "" - -#: templates/frame.haml:386 -msgid "U-Reporters Content" -msgstr "" - -#: templates/frame.haml:393 -msgid "Join & Engage Content" -msgstr "" - -#: templates/frame.haml:399 -msgid "Join Steps Content" -msgstr "" - -#: templates/frame.haml:406 -msgid "Additional Menu" -msgstr "" - -#: templates/frame.haml:423 -msgid "Logout" -msgstr "" - -#: templates/frame.haml:469 -msgid "About" -msgstr "" - -#: templates/frame.haml:487 -msgid "U-Reporters" -msgstr "" - -#: templates/frame.haml:494 templates/public/jobs.haml:7 -msgid "Jobs" -msgstr "" - -#: templates/frame.haml:501 -msgid "Join & Engage" -msgstr "" - -#: templates/frame.haml:567 -msgid "FOLLOW US ON" -msgstr "" - -#: templates/jobs/jobsource_create.haml:8 -msgid "" -"\n" -" To add a Twitter job source you are required to get a widget id from " -"twitter.\n" -" " -msgstr "" - -#: templates/jobs/jobsource_create.haml:12 -#: templates/jobs/jobsource_update.haml:12 -msgid "Follow this step by step guide" -msgstr "" - -#: templates/jobs/jobsource_create.haml:15 -#: templates/jobs/jobsource_update.haml:15 -msgid "" -"\n" -"
After you create the widget copy the widget id from the url as " -"shown on
\n" -" " -msgstr "" - -#: templates/jobs/jobsource_create.haml:40 -msgid "Back" -msgstr "" - -#: templates/jobs/jobsource_update.haml:8 -msgid "" -"\n" -" Remember for a Twitter job source you are required to get a widget " -"id from twitter.\n" -" " -msgstr "" - -#: templates/public/about.haml:16 templates/public/about.haml:68 -msgid "ABOUT U-REPORT" -msgstr "" - -#: templates/public/about.haml:22 templates/public/ureporters.haml:23 -msgid "Scroll to Learn more" -msgstr "" - -#: templates/public/about.haml:80 -msgid "The mission of U-Report" -msgstr "" - -#: templates/public/about.haml:119 -msgid "Why Join U-Report?" -msgstr "" - -#: templates/public/about.haml:124 -msgid "Speak out on what's happening in your community" -msgstr "" - -#: templates/public/about.haml:127 -msgid "" -"Use U-Report results and information to update and increase citizen's " -"awareness" -msgstr "" - -#: templates/public/about.haml:130 -msgid "Participate in nationwide campaigns to help improve your country" -msgstr "" - -#: templates/public/about.haml:133 -#, python-format -msgid "Share what's happening around %(country)s with other U-Reporters" -msgstr "" - -#: templates/public/about.haml:139 -msgid "CLICK HERE TO JOIN" -msgstr "" - -#: templates/public/about.haml:153 -msgid "U-REPORT VIDEOS" -msgstr "" - -#: templates/public/about.haml:160 -msgid "No videos yet." -msgstr "" - -#: templates/public/about.haml:178 -msgid "WATCH IT ON YOUTUBE" -msgstr "" - -#: templates/public/all_polls.haml:5 -msgid "MORE POLLS" -msgstr "" - -#: templates/public/all_polls.haml:12 templates/public/archived_stories.haml:12 -msgid "FILTER" -msgstr "" - -#: templates/public/all_polls.haml:19 templates/public/archived_stories.haml:19 -#: templates/public/stories.haml:72 templates/public/strings_values.haml:5 -msgid "All" -msgstr "" - -#: templates/public/all_polls.haml:33 -msgid "POLL LIST" -msgstr "" - -#: templates/public/all_polls.haml:35 -msgid "All polls from most recent to oldest" -msgstr "" - -#: templates/public/archived_stories.haml:5 -msgid "ARCHIVED STORIES" -msgstr "" - -#: templates/public/archived_stories.haml:33 -msgid "LIST" -msgstr "" - -#: templates/public/index.haml:21 -msgid "Follow" -msgstr "" - -#: templates/public/index.haml:29 -msgid "" -"\n" -" U-Report is a social messaging tool allowing anyone from " -"any community, anywhere in the world to respond to polls, report issues, " -"support child rights and work as positive agents of change on behalf of " -"people in their country.\n" -" " -msgstr "" - -#: templates/public/index.haml:36 templates/public/index.haml:74 -msgid "CURRENT POLL" -msgstr "" - -#: templates/public/index.haml:42 -msgid "View Full Results" -msgstr "" - -#: templates/public/index.haml:52 -msgid "All U-Report members" -msgstr "" - -#: templates/public/index.haml:97 -msgid "RESPONSE RATE" -msgstr "" - -#: templates/public/index.haml:103 -msgid "Responded out of" -msgstr "" - -#: templates/public/index.haml:111 -msgid "RESPONDER'S RATE BY LOCATION" -msgstr "" - -#: templates/public/index.haml:117 -msgid "Most responded" -msgstr "" - -#: templates/public/index.haml:149 -#, python-format -msgid "" -"\n" -" %(responded)s of %(total)s\n" -" " -msgstr "" - -#: templates/public/index.haml:164 -msgid "TRENDING WORDS" -msgstr "" - -#: templates/public/index.haml:174 -msgid "FEATURED RESPONSES" -msgstr "" - -#: templates/public/index.haml:197 templates/public/index.haml:557 -msgid "View full results" -msgstr "" - -#: templates/public/index.haml:217 templates/public/ureporters.haml:16 -msgid "U-REPORTERS IN" -msgstr "" - -#: templates/public/index.haml:225 -msgid "TOTAL # OF U-REPORTERS" -msgstr "" - -#: templates/public/index.haml:237 -msgid "4 MOST ACTIVE REGIONS" -msgstr "" - -#: templates/public/index.haml:248 templates/public/index.haml:269 -msgid "RATE BY GENDER" -msgstr "" - -#: templates/public/index.haml:257 templates/public/index.haml:310 -msgid "RATE BY AGE" -msgstr "" - -#: templates/public/index.haml:322 -msgid "WHAT U-REPORTERS ARE SAYING" -msgstr "" - -#: templates/public/index.haml:331 -msgid "FEATURED VIDEO" -msgstr "" - -#: templates/public/index.haml:337 -msgid "Watch more videos" -msgstr "" - -#: templates/public/index.haml:348 -msgid "FEATURED REGION" -msgstr "" - -#: templates/public/index.haml:372 -msgid "Check more stories in U-Report app" -msgstr "" - -#: templates/public/index.haml:391 templates/public/join_engage.haml:99 -msgid "View more stories on Facebook" -msgstr "" - -#: templates/public/index.haml:410 -msgid "View more on Instagram" -msgstr "" - -#: templates/public/index.haml:430 -msgid "Read more tweets on Twitter" -msgstr "" - -#: templates/public/index.haml:441 -msgid "NEWS FEED" -msgstr "" - -#: templates/public/index.haml:456 templates/public/index.haml:489 -#: templates/public/index.haml:571 -msgid "STORY" -msgstr "" - -#: templates/public/index.haml:477 templates/public/index.haml:511 -#: templates/public/index.haml:596 templates/public/stories.haml:39 -#: templates/public/stories.haml:123 -msgid "Read full story" -msgstr "" - -#: templates/public/index.haml:534 -msgid "Response Rate" -msgstr "" - -#: templates/public/index.haml:737 -msgid "Read this story" -msgstr "" - -#: templates/public/jobs.haml:22 -msgid "JOBS" -msgstr "" - -#: templates/public/jobs.haml:28 -msgid "Scroll to see job details" -msgstr "" - -#: templates/public/jobs.haml:78 templates/public/join_engage.haml:119 -msgid "Tweet to" -msgstr "" - -#: templates/public/jobs.haml:99 templates/public/polls.haml:379 -msgid "Read more" -msgstr "" - -#: templates/public/jobs.haml:108 -msgid "Visit" -msgstr "" - -#: templates/public/join_engage.haml:17 -msgid "JOIN U-REPORT" -msgstr "" - -#: templates/public/join_engage.haml:44 -msgid "HOW TO JOIN" -msgstr "" - -#: templates/public/join_engage.haml:73 -#, python-format -msgid "" -"\n" -" * U-Report is a free program sponsored by UNICEF with help of " -"Network Providers in %(country)s. U-Report will not ask for any payments nor " -"personal financial information, PLEASE disregard any messages which ask you " -"for payment either on this number or on the Facebook and Twitter pages. All " -"U-Report services (all msg on %(shortcode)s) are free.\n" -"\n" -" " -msgstr "" - -#: templates/public/join_engage.haml:84 -msgid "U-REPORT ON SOCIAL MEDIA" -msgstr "" - -#: templates/public/join_engage.haml:140 -msgid "Compose new Tweet" -msgstr "" - -#: templates/public/polls.haml:16 -msgid "CURRENT POLL IN" -msgstr "" - -#: templates/public/polls.haml:29 -#, python-format -msgid "" -"\n" -" %(questions)s question polled on this topic\n" -" " -msgid_plural "" -"\n" -" %(questions)s questions polled on this topic\n" -" " -msgstr[0] "" -msgstr[1] "" - -#: templates/public/polls.haml:43 -msgid "response rate" -msgstr "" - -#: templates/public/polls.haml:49 -msgid "responded out of" -msgstr "" - -#: templates/public/polls.haml:53 -msgid "polled" -msgstr "" - -#: templates/public/polls.haml:96 -msgid "POLL RESULTS" -msgstr "" - -#: templates/public/polls.haml:112 -#, python-format -msgid "" -"\n" -" %(responded)s responded out of %(polled)s polled\n" -" " -msgstr "" - -#: templates/public/polls.haml:121 -msgid "KEYWORDS" -msgstr "" - -#: templates/public/polls.haml:126 -msgid "STATISTICS" -msgstr "" - -#: templates/public/polls.haml:131 -msgid "LOCATIONS" -msgstr "" - -#: templates/public/polls.haml:137 templates/public/ureporters.haml:83 -msgid "GENDER" -msgstr "" - -#: templates/public/polls.haml:143 templates/public/ureporters.haml:63 -msgid "AGE" -msgstr "" - -#: templates/public/polls.haml:313 -msgid "FEATURED ANSWERS" -msgstr "" - -#: templates/public/polls.haml:320 -msgid "No featured answers." -msgstr "" - -#: templates/public/polls.haml:339 -msgid "U-Reporter in" -msgstr "" - -#: templates/public/polls.haml:351 templates/public/story_read.haml:129 -msgid "RELATED STORIES" -msgstr "" - -#: templates/public/polls.haml:356 templates/public/story_read.haml:134 -msgid "No related stories." -msgstr "" - -#: templates/public/polls.haml:391 templates/public/story_read.haml:102 -msgid "FEATURED IMAGES" -msgstr "" - -#: templates/public/polls.haml:397 -msgid "No featured images yet." -msgstr "" - -#: templates/public/stories.haml:20 -msgid "FEATURED STORY" -msgstr "" - -#: templates/public/stories.haml:30 templates/public/story_read.haml:26 -msgid "BY" -msgstr "" - -#: templates/public/stories.haml:59 -msgid "LATEST STORIES" -msgstr "" - -#: templates/public/stories.haml:64 -msgid "FILTERED BY" -msgstr "" - -#: templates/public/story_read.haml:31 -msgid "Scroll to read more" -msgstr "" - -#: templates/public/story_read.haml:50 -msgid "STORY CONTINUES" -msgstr "" - -#: templates/public/story_read.haml:68 -msgid "AUDIO" -msgstr "" - -#: templates/public/story_read.haml:81 -msgid "RELATED POLLS" -msgstr "" - -#: templates/public/story_read.haml:86 -msgid "No related polls." -msgstr "" - -#: templates/public/story_read.haml:107 -msgid "No featured images." -msgstr "" - -#: templates/public/story_read.haml:160 -msgid "READ MORE" -msgstr "" - -#: templates/public/strings_values.haml:6 -msgid "Even" -msgstr "" - -#: templates/public/strings_values.haml:7 -#: templates/public/strings_values.haml:10 -msgid "State" -msgstr "" - -#: templates/public/strings_values.haml:8 -msgid "Other" -msgstr "" - -#: templates/public/strings_values.haml:9 -msgid "National" -msgstr "" - -#: templates/public/strings_values.haml:11 -msgid "District" -msgstr "" - -#: templates/public/strings_values.haml:12 -msgid "Participation Level" -msgstr "" - -#: templates/public/strings_values.haml:13 -msgid "Responses" -msgstr "" - -#: templates/public/strings_values.haml:14 -msgid "Reporters in" -msgstr "" - -#: templates/public/strings_values.haml:15 -msgid "Results" -msgstr "" - -#: templates/public/strings_values.haml:16 -msgid "*Other answers include" -msgstr "" - -#: templates/public/strings_values.haml:17 -msgid "Population" -msgstr "" - -#: templates/public/strings_values.haml:18 -msgid "Registered in" -msgstr "" - -#: templates/public/strings_values.haml:19 -msgid "Density" -msgstr "" - -#: templates/public/strings_values.haml:20 -msgid "total" -msgstr "" - -#: templates/public/strings_values.haml:21 -msgid "of" -msgstr "" - -#: templates/public/strings_values.haml:22 -msgid "the" -msgstr "" - -#: templates/public/ureporters.haml:44 -msgid "WHO WE ARE" -msgstr "" - -#: templates/public/ureporters.haml:55 -msgid "U-REPORTER STATISTICS" -msgstr "" - -#: templates/public/ureporters.haml:134 -msgid "WHERE ARE U-REPORTERS FROM?" -msgstr "" - -#: templates/public/ureporters.haml:154 -msgid "REGISTRATION RATE: IN THE PAST 6 MONTHS" -msgstr "" - -#: templates/public/ureporters.haml:174 -msgid "OCCUPATION: TOP 9 MOST MENTIONED" -msgstr "" - -#: templates/public/ureporters.haml:377 -msgid "Registered" -msgstr "" - -#: templates/public/ureporters.haml:392 -msgid "Week of" -msgstr "" - -#: ureport/admins/views.py:22 -#, python-format -msgid "Refreshed %s cache for this organization" -msgstr "" - -#: ureport/assets/models.py:13 -msgid "Flag" -msgstr "" - -#: ureport/assets/models.py:17 -msgid "The organization to which the image will be used" -msgstr "" - -#: ureport/assets/models.py:20 -msgid "A short descriptive name for this image" -msgstr "" - -#: ureport/assets/models.py:22 -msgid "Image type" -msgstr "" - -#: ureport/contacts/models.py:46 -msgid "Label" -msgstr "" - -#: ureport/contacts/models.py:48 -msgid "Key" -msgstr "" - -#: ureport/contacts/models.py:86 ureport/polls/models.py:870 -msgid "Male" -msgstr "" - -#: ureport/contacts/models.py:86 ureport/polls/models.py:870 -msgid "Female" -msgstr "" - -#: ureport/contacts/models.py:92 ureport/locations/models.py:24 -msgid "Organization" -msgstr "" - -#: ureport/contacts/models.py:94 -msgid "Gender" -msgstr "" - -#: ureport/contacts/models.py:95 -msgid "Gender of the contact" -msgstr "" - -#: ureport/contacts/models.py:97 -msgid "Born Field" -msgstr "" - -#: ureport/contacts/models.py:99 -msgid "Occupation Field" -msgstr "" - -#: ureport/contacts/models.py:101 -msgid "Registration Date" -msgstr "" - -#: ureport/contacts/models.py:103 -msgid "State Field" -msgstr "" - -#: ureport/contacts/models.py:105 -msgid "District Field" -msgstr "" - -#: ureport/contacts/models.py:107 -msgid "Ward Field" -msgstr "" - -#: ureport/contacts/models.py:240 ureport/polls/models.py:1102 -msgid "Number of items with this counter" -msgstr "" - -#: ureport/countries/management/commands/add_country_alias.py:55 -msgid "No root user found. Please create a root user" -msgstr "" - -#: ureport/countries/models.py:11 -msgid "The name for our alias" -msgstr "" - -#: ureport/jobs/models.py:22 -msgid "The title or name to reference this Job source." -msgstr "" - -#: ureport/jobs/models.py:24 -msgid "Choose the type for the Job source. Twitter, Facebook or RSS feed" -msgstr "" - -#: ureport/jobs/models.py:25 -msgid "The full URL to navigate to this Job source." -msgstr "" - -#: ureport/jobs/models.py:27 -msgid "" -"For Twitter, a widget Id is required to embed tweets on the website. Read " -"carefully the instructions above on how to get the right widget Id" -msgstr "" - -#: ureport/jobs/models.py:30 -msgid "Featured job sources are shown first on the jobs page." -msgstr "" - -#: ureport/jobs/models.py:32 -msgid "The organization this job source is for" -msgstr "" - -#: ureport/jobs/views.py:13 -msgid "Your job source has been added successfully" -msgstr "" - -#: ureport/jobs/views.py:39 -msgid "Your job source has been updated successfully" -msgstr "" - -#: ureport/locations/models.py:29 -msgid "This is the OSM id for this administrative boundary" -msgstr "" - -#: ureport/locations/models.py:32 -msgid "The name of our administrative boundary" -msgstr "" - -#: ureport/locations/models.py:34 -msgid "The level of the boundary, 0 for country, 1 for state, 2 for district" -msgstr "" - -#: ureport/locations/models.py:37 -msgid "The parent to this political boundary if any" -msgstr "" - -#: ureport/locations/models.py:39 -msgid "Geometry" -msgstr "" - -#: ureport/locations/models.py:40 -msgid "" -"The json representing the geometry type and coordinates of the boundaries" -msgstr "" - -#: ureport/news/models.py:11 -msgid "The title for this item" -msgstr "" - -#: ureport/news/models.py:14 -msgid "A short summary description for this item" -msgstr "" - -#: ureport/news/models.py:17 -msgid "A link that should be associated with this item" -msgstr "" - -#: ureport/news/models.py:20 ureport/news/models.py:45 -msgid "The category this item belongs to" -msgstr "" - -#: ureport/news/models.py:23 -msgid "The organization this item belongs to" -msgstr "" - -#: ureport/news/models.py:36 -msgid "The title for this Video" -msgstr "" - -#: ureport/news/models.py:39 -msgid "A short summary description for this video" -msgstr "" - -#: ureport/news/models.py:48 -msgid "The organization this video belongs to" -msgstr "" - -#: ureport/polls/models.py:63 -msgid "The name of this poll category" -msgstr "" - -#: ureport/polls/models.py:72 -msgid "Poll Categories" -msgstr "" - -#: ureport/polls/models.py:103 -msgid "The Flow this Poll is based on" -msgstr "" - -#: ureport/polls/models.py:105 -msgid "" -"The date to display for this poll. Leave empty to use flow creation date." -msgstr "" - -#: ureport/polls/models.py:109 -msgid "Whether the flow for this poll is archived on RapidPro" -msgstr "" - -#: ureport/polls/models.py:111 -msgid "The base language of the flow to use" -msgstr "" - -#: ureport/polls/models.py:114 -msgid "The number of polled reporters on this poll" -msgstr "" - -#: ureport/polls/models.py:117 -msgid "Whether the poll has finished the initial results sync." -msgstr "" - -#: ureport/polls/models.py:120 -msgid "The title for this Poll" -msgstr "" - -#: ureport/polls/models.py:122 -msgid "The category this Poll belongs to" -msgstr "" - -#: ureport/polls/models.py:124 -msgid "Whether this poll should be featured on the homepage" -msgstr "" - -#: ureport/polls/models.py:126 -msgid "The splash category image to display for the poll (optional)" -msgstr "" - -#: ureport/polls/models.py:128 -msgid "The organization this poll is part of" -msgstr "" - -#: ureport/polls/models.py:642 -msgid "The poll to associate to" -msgstr "" - -#: ureport/polls/models.py:656 -msgid "The poll for this response" -msgstr "" - -#: ureport/polls/models.py:659 -msgid "The location for this response" -msgstr "" - -#: ureport/polls/models.py:662 -msgid "The name of the sender of the message" -msgstr "" - -#: ureport/polls/models.py:665 -msgid "The featured response message" -msgstr "" - -#: ureport/polls/models.py:681 -msgid "The poll this question is part of" -msgstr "" - -#: ureport/polls/models.py:683 -msgid "The title of this question" -msgstr "" - -#: ureport/polls/models.py:684 -msgid "The RuleSet this question is based on" -msgstr "" - -#: ureport/polls/models.py:689 -msgid "The label of the ruleset on RapidPro" -msgstr "" - -#: ureport/polls/models.py:692 -msgid "The priority number for this question on the poll" -msgstr "" - -#: ureport/polls/models.py:965 -msgid "The Rule this response category is based on" -msgstr "" - -#: ureport/polls/views.py:85 -msgid "You must include a title for every included question." -msgstr "" - -#: ureport/polls/views.py:88 -msgid "Title too long. The max limit is 255 characters for each title" -msgstr "" - -#: ureport/polls/views.py:93 -msgid "You must include at least one poll question." -msgstr "" - -#: ureport/polls/views.py:108 -msgid "Adjust poll date" -msgstr "" - -#: ureport/polls/views.py:111 -msgid "Your poll has been updated, now pick which questions to include." -msgstr "" - -#: ureport/polls/views.py:122 -msgid "Your poll has been created, now adjust the poll date." -msgstr "" - -#: ureport/polls/views.py:152 -msgid "Poll Images" -msgstr "" - -#: ureport/polls/views.py:153 -msgid "Now enter any responses you'd like to feature. (if any)" -msgstr "" - -#: ureport/polls/views.py:165 -msgid "Image to display on poll page and in previews. (optional)" -msgstr "" - -#: ureport/polls/views.py:172 -msgid "Image to display on poll page and in previews (optional)" +#: templates/public/polls.haml:121 +msgid "KEYWORDS" msgstr "" -#: ureport/polls/views.py:196 -msgid "Featured Poll Responses" +#: templates/public/polls.haml:126 +msgid "STATISTICS" msgstr "" -#: ureport/polls/views.py:197 -msgid "Your poll has been updated." +#: templates/public/polls.haml:131 +msgid "LOCATIONS" msgstr "" -#: ureport/polls/views.py:214 -#, python-format -msgid "Response %d Reporter" +#: templates/public/polls.haml:137 templates/public/ureporters.haml:83 +msgid "GENDER" msgstr "" -#: ureport/polls/views.py:214 -msgid "The name or alias of the responder." +#: templates/public/polls.haml:143 templates/public/ureporters.haml:63 +msgid "AGE" msgstr "" -#: ureport/polls/views.py:219 -#, python-format -msgid "Response %d Location" +#: templates/public/polls.haml:313 +msgid "FEATURED ANSWERS" msgstr "" -#: ureport/polls/views.py:219 -msgid "The location of the responder." +#: templates/public/polls.haml:320 +msgid "No featured answers." msgstr "" -#: ureport/polls/views.py:224 -#, python-format -msgid "Response %d Message" +#: templates/public/polls.haml:339 +msgid "U-Reporter in" msgstr "" -#: ureport/polls/views.py:224 -msgid "The text of the featured response." +#: templates/public/polls.haml:351 templates/public/story_read.haml:129 +msgid "RELATED STORIES" msgstr "" -#: ureport/polls/views.py:250 -msgid "Poll Questions" +#: templates/public/polls.haml:356 templates/public/story_read.haml:134 +msgid "No related stories." msgstr "" -#: ureport/polls/views.py:252 -msgid "Now set what images you want displayed on your poll page. (if any)" +#: templates/public/polls.haml:391 templates/public/story_read.haml:102 +msgid "FEATURED IMAGES" msgstr "" -#: ureport/polls/views.py:281 -msgid "Include" +#: templates/public/polls.haml:397 +msgid "No featured images yet." msgstr "" -#: ureport/polls/views.py:282 -msgid "Whether to include this question in your public results" +#: templates/public/stories.haml:20 +msgid "FEATURED STORY" msgstr "" -#: ureport/polls/views.py:286 -msgid "Priority" +#: templates/public/stories.haml:30 templates/public/story_read.haml:26 +msgid "BY" msgstr "" -#: ureport/polls/views.py:287 -msgid "" -"The priority of this question on the poll page, higher priority comes first" +#: templates/public/stories.haml:59 +msgid "LATEST STORIES" msgstr "" -#: ureport/polls/views.py:291 -msgid "Ruleset Label" +#: templates/public/stories.haml:64 +msgid "FILTERED BY" msgstr "" -#: ureport/polls/views.py:292 -msgid "The label of the ruleset from RapidPro" +#: templates/public/story_read.haml:31 +msgid "Scroll to read more" msgstr "" -#: ureport/polls/views.py:296 -msgid "Title" +#: templates/public/story_read.haml:50 +msgid "STORY CONTINUES" msgstr "" -#: ureport/polls/views.py:297 -msgid "The question posed to your audience, will be displayed publicly" +#: templates/public/story_read.haml:68 +msgid "AUDIO" msgstr "" -#: ureport/polls/views.py:417 -#, python-format -msgid "Scheduled a pull refresh for poll #%d on org #%d" +#: templates/public/story_read.haml:81 +msgid "RELATED POLLS" msgstr "" -#: ureport/public/views.py:310 -#, python-format -msgid "%s" +#: templates/public/story_read.haml:86 +msgid "No related polls." msgstr "" -#: ureport/settings_common.py:132 -msgid "Whether this org should be show on the landing page" +#: templates/public/story_read.haml:107 +msgid "No featured images." msgstr "" -#: ureport/settings_common.py:133 -msgid "The shortcode that users will use to contact U-Report locally" +#: templates/public/story_read.haml:160 +msgid "READ MORE" msgstr "" -#: ureport/settings_common.py:134 -msgid "The short text used to direct visitors to join U-Report" +#: templates/public/strings_values.haml:5 +msgid "Even" msgstr "" -#: ureport/settings_common.py:135 -msgid "The color used to draw the text on the join bar" +#: templates/public/strings_values.haml:6 +#: templates/public/strings_values.haml:8 +msgid "State" msgstr "" -#: ureport/settings_common.py:136 -msgid "The color used to draw the background on the join bar" +#: templates/public/strings_values.haml:7 +msgid "Other" msgstr "" -#: ureport/settings_common.py:137 -msgid "The primary color for styling for this organization" +#: templates/public/strings_values.haml:9 +msgid "District" msgstr "" -#: ureport/settings_common.py:138 -msgid "The secondary color for styling for this organization" +#: templates/public/strings_values.haml:10 +msgid "Participation Level" msgstr "" -#: ureport/settings_common.py:139 -msgid "The background color for the site" +#: templates/public/strings_values.haml:11 +msgid "Responses" msgstr "" -#: ureport/settings_common.py:140 -msgid "Up to 6 colors for styling charts, use comma between colors" +#: templates/public/strings_values.haml:12 +msgid "Reporters in" msgstr "" -#: ureport/settings_common.py:141 -msgid "The Google Analytics Tracking ID for this organization" +#: templates/public/strings_values.haml:13 +msgid "Results" msgstr "" -#: ureport/settings_common.py:142 -msgid "The URL to the Youtube channel for this organization" +#: templates/public/strings_values.haml:14 +msgid "*Other answers include" msgstr "" -#: ureport/settings_common.py:143 -msgid "The URL to the Facebook page for this organization" +#: templates/public/strings_values.haml:15 +msgid "Population" msgstr "" -#: ureport/settings_common.py:144 -msgid "The integer id to the Facebook page for this organization (optional)" +#: templates/public/strings_values.haml:16 +msgid "Registered in" msgstr "" -#: ureport/settings_common.py:145 -msgid "" -"The integer id to the Facebook app for this organization's chat app " -"(optional)" +#: templates/public/strings_values.haml:17 +msgid "Density" msgstr "" -#: ureport/settings_common.py:146 -msgid "The id of the Facebook Pixel for this organization (optional)" +#: templates/public/strings_values.haml:18 +msgid "total" msgstr "" -#: ureport/settings_common.py:147 -msgid "The Instagram username for this organization" +#: templates/public/strings_values.haml:19 +msgid "of" msgstr "" -#: ureport/settings_common.py:148 -msgid "The Instagram widget id from lightwidget.com" +#: templates/public/strings_values.haml:20 +msgid "the" msgstr "" -#: ureport/settings_common.py:149 -msgid "The Twitter handle for this organization" +#: templates/public/ureporters.haml:44 +msgid "WHO WE ARE" msgstr "" -#: ureport/settings_common.py:150 -msgid "The Twitter widget used for searching" +#: templates/public/ureporters.haml:55 +msgid "U-REPORTER STATISTICS" msgstr "" -#: ureport/settings_common.py:151 -msgid "The name of txbhe Contact Group that contains registered reporters" +#: templates/public/ureporters.haml:134 +msgid "WHERE ARE U-REPORTERS FROM?" msgstr "" -#: ureport/settings_common.py:152 -msgid "" -"The label of the Contact Field that contains the birth date of reporters" +#: templates/public/ureporters.haml:154 +msgid "REGISTRATION RATE: IN THE PAST 6 MONTHS" msgstr "" -#: ureport/settings_common.py:153 -msgid "The label of the Contact Field that contains the gender of reporters" +#: templates/public/ureporters.haml:174 +msgid "OCCUPATION: TOP 9 MOST MENTIONED" msgstr "" -#: ureport/settings_common.py:154 -msgid "" -"The label of the Contact Field that contains the occupation of reporters" +#: templates/public/ureporters.haml:375 +msgid "Registered" msgstr "" -#: ureport/settings_common.py:155 -msgid "" -"The label of the Contact Field that contains the registration date of " -"reporters" +#: templates/public/ureporters.haml:390 +msgid "Week of" msgstr "" -#: ureport/settings_common.py:156 -msgid "The label of the Contact Field that contains the State of reporters" +#: templates/smartmin/users/login.haml:14 +msgid "Sign in" msgstr "" -#: ureport/settings_common.py:157 -msgid "The label of the Contact Field that contains the District of reporters" +#: templates/smartmin/users/login.haml:54 +msgid "Forgot Password?" msgstr "" -#: ureport/settings_common.py:158 -msgid "The label of the Contact Field that contains the Ward of reporters" +#: venv/lib/python3.6/site-packages/dash/dashblocks/templates/dashblocks/dashblock_form.haml:8 +msgid "Gallery" msgstr "" -#: ureport/settings_common.py:159 -msgid "The label assigned to U-Reporters that are Male." +#: venv/lib/python3.6/site-packages/dash/dashblocks/templates/dashblocks/dashblock_form.haml:17 +msgid "Add Image" msgstr "" -#: ureport/settings_common.py:160 -msgid "The label assigned to U-Reporters that are Female." +#: venv/lib/python3.6/site-packages/dash/dashblocks/templates/dashblocks/dashblock_list.haml:34 +msgid "Search" msgstr "" -#: ureport/settings_common.py:161 -msgid "If there are jobs to be shown on the public site" +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_manage_accounts.haml:13 +msgid "Accounts" msgstr "" -#: ureport/settings_common.py:162 -msgid "" -"If this org if for global data. e.g: It shows a world map instead of a " -"country map." +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_manage_accounts.haml:16 +msgid "Admins" msgstr "" -#: ureport/settings_common.py:163 -msgid "" -"The alpha-3 ISO code of the organization so that it appears the stories " -"widget U-Report App. Example: BRA, NIG, CMR (Use GLOBAL if U-Report is " -"Global)." +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_manage_accounts.haml:19 +msgid "Editors" msgstr "" -#: ureport/settings_common.py:164 -msgid "" -"If you need to include some custom HTML codes in you org pages, like custom " -"analytics code snippets" +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_manage_accounts.haml:22 +msgid "Remove" msgstr "" -#: ureport/translation.py:14 -msgid "Something to trigger localizations" -msgstr "" +#: venv/lib/python3.6/site-packages/dash/orgs/templates/orgs/org_manage_accounts.haml:29 +msgid "You must have at least one administator" +msgstr "" \ No newline at end of file diff --git a/static/less/ureport2.less b/static/less/ureport2.less index 5354f0cda..98499b619 100644 --- a/static/less/ureport2.less +++ b/static/less/ureport2.less @@ -89,6 +89,56 @@ body { } } +#ureport-policies-bar { + width: 100%; + height: 36px; + background-color: #ffffff; + border-bottom: 1px solid; + box-shadow: 0px 10px; + display: none; + + .content { + text-align: center; + font-size: 10pt; + + a:hover { + text-decoration: none; + } + + a:focus { + text-decoration: none; + } + } + + .policies-close { + margin-right: 5px; + width: 35px; + border-radius: 5px; + margin: 3px; + border-color: unset !important; + text-align: center; + + .policies-close-click { + margin-top: 3px; + font-size: 15px; + color: #fff; + font-weight: bold; + + a { + display: block; + } + + a:hover { + text-decoration: none; + } + } + } +} + +.policies-show-bar { + display: flex !important; +} + .ureport-header-navbar { margin-bottom: 0px; @@ -1411,6 +1461,11 @@ ul.poll-filters, .featured-stories-filters, ul.stories-filters { font-size: .8em; } +.policy-details { + line-height: 150%; + font-size: .8em; +} + .story-teaser { } @@ -2648,6 +2703,16 @@ ul.poll-filters, .featured-stories-filters, ul.stories-filters { } } +.footer-policies { + margin-top: 21px; + text-align: right; + list-style: none; + + li { + line-height: 30px; + } +} + .index-global-counter { margin-top: 80px; text-align: center; diff --git a/templates/frame.haml b/templates/frame.haml index 08079e813..424b841f4 100644 --- a/templates/frame.haml +++ b/templates/frame.haml @@ -241,6 +241,9 @@ %li %a{ href:"{% url 'assets.image_list' %}"} - trans "Images" + %li + %a{ href:"{% url 'policies.policy_admin' %}"} + - trans "Policies" %li %a{ href:"{% url 'dashblocks.dashblock_list' %}"} @@ -367,6 +370,30 @@ - block navbar - if org + -if org|check_policy:"cookie" or org|check_policy:"privacy" or org|check_policy:"tos" + %div#ureport-policies-bar{ style: 'border-color: {{ org|config:"primary_color" }}' } + %div.content + - trans "This website uses cookies. By continuing to browse this site you are agreeing to our" + -if org|check_policy:"cookie" + %a{ href:"{% url 'public.policies' 'cookie' %}" } + - trans "Cookie Policy" + + -if org|check_policy:"privacy" + -if org|check_policy:"cookie" + , + %a{ href:"{% url 'public.policies' 'privacy' %}" } + - trans "Privacy Policy" + + -if org|check_policy:"tos" + -if org|check_policy:"cookie" or org|check_policy:"privacy" + , + %a{ href:"{% url 'public.policies' 'tos' %}" } + - trans "Terms of Service" + %div.policies-close + %div.policies-close-click + %a.primary-color{ href:"javascript:closePoliciesBar()" } + X + %header#ureport-public-navbar.ureport-header-navbar.ureport-public-navbar.navbar.navbar-static-top{ role:"banner"} .container .navbar-header @@ -460,6 +487,21 @@ - show_org_flags .{class:'col-sm-3'} + -if org|check_policy:"cookie" or org|check_policy:"privacy" or org|check_policy:"tos" + %ul.footer-policies + -if org|check_policy:"cookie" + %li + %a{ href:"{% url 'public.policies' 'cookie' %}" } + - trans "Cookies Policy" + -if org|check_policy:"privacy" + %li + %a{ href:"{% url 'public.policies' 'privacy' %}" } + - trans "Privacy Policy" + -if org|check_policy:"tos" + %li + %a{ href:"{% url 'public.policies' 'tos' %}" } + - trans "Terms of Service" + .follow-us -if org|config:"facebook_page_url" or org|config:"twitter_handle" or org|config:"youtube_channel" .follow-us-text @@ -527,6 +569,19 @@ + + -#-# -#-# To stick the menu to the top of window -#-# diff --git a/templates/policies/policy_admin.haml b/templates/policies/policy_admin.haml new file mode 100644 index 000000000..2a9e43e32 --- /dev/null +++ b/templates/policies/policy_admin.haml @@ -0,0 +1,90 @@ +- extends 'smartmin/list.html' +- load i18n + +- block content + + - block table-controls + .buttons.pull-right + %a.btn.btn-primary{href:"{% url 'policies.policy_create'%}"} + -trans "New Policy" + + - for policy in active_policies + + .policy{ onclick:'javascript:view("{{policy.policy_type}}");'} + .type + {{policy.get_policy_type_display}} + .created_on + {{policy.created_on|date:"M d, Y"}} + .edit + %a{href:"{% url 'policies.policy_update' policy.id%}"} + -trans "edit" + + %div.row + %div.col-md-12 + %h4 + -trans "Previous Policies" + %table.list-table.list_assets_image.table.table-bordered.table-striped + %thead + %th + %th + -trans "Language" + %th + -trans "Created" + %tbody + -for policy in object_list + %tr + %td + {{policy.get_policy_type_display}} + %td + {{policy.get_policy_language}} + %td.date + {{policy.created_on}} + %td.link + %a{href:"{% url 'policies.policy_history' policy.id%}"} + -trans "view" + - empty + %tr + %td.empty_list{ colspan:"4" } + + %div.row + %div.col-md-3 + %div.pagination-text + -blocktrans count counter=object_list|length + {{ counter }} result + -plural + {{ counter }} results + +- block extra-script + :javascript + + function view(policy_type) { + document.location.href = '/manage/policy/' + policy_type + } + +- block extra-style + + :css + .link { + width: 20px; + } + + .policy { + display: inline-block; + padding: 10px; + border: 1px solid #e6e6e6; + border-radius: 5px; + width: 250px; + margin-right: 10px; + margin-top: 10px; + text-decoration: none; + } + + .policy:hover { + background: #f3f3f3; + cursor: pointer; + } + + .edit { + font-size: 11px; + line-height: 11px; + } diff --git a/templates/policies/policy_read.haml b/templates/policies/policy_read.haml new file mode 100644 index 000000000..c9dcd52d1 --- /dev/null +++ b/templates/policies/policy_read.haml @@ -0,0 +1,48 @@ +{% extends "smartmin/base.html" %} + +{% load smartmin i18n %} + +{% block content %} +{% block pjax %} + +
+ + +
+
+ {% block pre-fields %} + {% endblock pre-fields %} + + {% block fields %} + + + {% for field in fields %} + + + + + {% endfor %} + + {% block extra-fields %} + {% endblock extra-fields %} + +
{% get_label field %}{% get_value object field %} 
+ {% endblock fields %} + + {% block post-fields %} + {% endblock %} +
+
+
+ +{% endblock %} +{% endblock %} + diff --git a/templates/public/policies.haml b/templates/public/policies.haml new file mode 100644 index 000000000..bc7eeb5a0 --- /dev/null +++ b/templates/public/policies.haml @@ -0,0 +1,14 @@ +- extends "public_base.html" +- load i18n ureport + +- block content + .row + .col-md-12 + .section + %h1.level-1-title + {{ policy.get_policy_type_display }} + .level-1-title-description.secondary-color + + .card.card-padding + .policy-details + {{ policy.get_rendered_body }} diff --git a/ureport/policies/__init__.py b/ureport/policies/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/ureport/policies/migrations/0001_initial.py b/ureport/policies/migrations/0001_initial.py new file mode 100644 index 000000000..c10118a84 --- /dev/null +++ b/ureport/policies/migrations/0001_initial.py @@ -0,0 +1,35 @@ +# Generated by Django 2.0.9 on 2018-11-13 17:33 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Policy', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('is_active', models.BooleanField(default=True, help_text='Whether this item is active, use this instead of deleting')), + ('created_on', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, help_text='When this item was originally created')), + ('modified_on', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, help_text='When this item was last modified')), + ('language', models.CharField(choices=[('bs', 'Bosnian'), ('en', 'English'), ('fr', 'French'), ('es', 'Spanish'), ('ar', 'Arabic'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('uk', 'Ukrainian'), ('uz', 'Uzbek'), ('my', 'Burmese'), ('id', 'Indonesian'), ('it', 'Italian'), ('ro', 'Romanian'), ('vi', 'Vietnamese'), ('sr', 'Serbian')], help_text='Choose the language', max_length=16)), + ('policy_type', models.CharField(choices=[('privacy', 'Privacy Policy'), ('tos', 'Terms of Service'), ('cookie', 'Cookie Policy')], help_text='Choose the type of policy', max_length=16)), + ('body', models.TextField(help_text='Enter the content of the policy (Markdown permitted)')), + ('created_by', models.ForeignKey(help_text='The user which originally created this item', on_delete=django.db.models.deletion.PROTECT, related_name='policies_policy_creations', to=settings.AUTH_USER_MODEL)), + ('modified_by', models.ForeignKey(help_text='The user which last modified this item', on_delete=django.db.models.deletion.PROTECT, related_name='policies_policy_modifications', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name_plural': 'Policies', + }, + ), + ] diff --git a/ureport/policies/migrations/__init__.py b/ureport/policies/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/ureport/policies/models.py b/ureport/policies/models.py new file mode 100644 index 000000000..b62f065f5 --- /dev/null +++ b/ureport/policies/models.py @@ -0,0 +1,35 @@ +from gettext import gettext as _ + +import markdown +from smartmin.models import SmartModel + +from django.db import models +from django.utils.safestring import mark_safe +from django.conf import settings + + +class Policy(SmartModel): + TYPE_PRIVACY = "privacy" + TYPE_TOS = "tos" + TYPE_COOKIE = "cookie" + + TYPE_CHOICES = ( + (TYPE_PRIVACY, _("Privacy Policy")), + (TYPE_TOS, _("Terms of Service")), + (TYPE_COOKIE, _("Cookie Policy")), + ) + + language = models.CharField(choices=settings.LANGUAGES, max_length=16, help_text=_("Choose the language")) + + policy_type = models.CharField(choices=TYPE_CHOICES, max_length=16, help_text=_("Choose the type of policy")) + + body = models.TextField(help_text=_("Enter the content of the policy (Markdown permitted)")) + + def get_rendered_body(self): + return mark_safe(markdown.markdown(self.body)) + + def get_policy_language(self): + return [lang[1] for lang in settings.LANGUAGES if lang[0] == self.language][0] + + class Meta: + verbose_name_plural = _("Policies") diff --git a/ureport/policies/tests.py b/ureport/policies/tests.py new file mode 100644 index 000000000..9376625aa --- /dev/null +++ b/ureport/policies/tests.py @@ -0,0 +1,59 @@ +from __future__ import absolute_import, division, print_function, unicode_literals + +from django.urls import reverse + +from ureport.policies.models import Policy +from ureport.tests import UreportTest + + +class PolicyTest(UreportTest): + def setUp(self): + super(PolicyTest, self).setUp() + + Policy.objects.create( + policy_type=Policy.TYPE_PRIVACY, + body="Privacy matters", + language="en", + created_by=self.admin, + modified_by=self.admin, + ) + + Policy.objects.create( + policy_type=Policy.TYPE_TOS, + body="These are the terms", + language="en", + created_by=self.admin, + modified_by=self.admin, + ) + + Policy.objects.create( + policy_type=Policy.TYPE_COOKIE, + body="C is for Cookie", + language="en", + created_by=self.admin, + modified_by=self.admin, + ) + + def test_policy_list(self): + self.login(self.superuser) + response = self.client.get(reverse("policies.policy_admin"), SERVER_NAME="nigeria.ureport.io") + self.assertEqual(3, response.context["active_policies"].count()) + + def test_read_policy(self): + self.login(self.superuser) + response = self.client.get(reverse("policies.policy_read", args=["privacy"]), SERVER_NAME="nigeria.ureport.io") + self.assertContains(response, "Privacy matters") + + def test_admin(self): + self.login(self.superuser) + post_data = dict( + policy_type="privacy", body="My privacy policy update", summary="the summary" + ) + self.client.post(reverse("policies.policy_create"), post_data, SERVER_NAME="nigeria.ureport.io") + response = self.client.get(reverse("policies.policy_admin"), SERVER_NAME="nigeria.ureport.io") + self.assertEqual(3, response.context["active_policies"].count()) + + def test_policy(self): + policy = Policy.objects.get(policy_type="privacy") + self.assertEqual("

Privacy matters

", policy.get_rendered_body()) + self.assertEqual("English", policy.get_policy_language()) diff --git a/ureport/policies/urls.py b/ureport/policies/urls.py new file mode 100644 index 000000000..2ebc08c31 --- /dev/null +++ b/ureport/policies/urls.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from .views import PoliciesCRUDL + +urlpatterns = PoliciesCRUDL().as_urlpatterns() diff --git a/ureport/policies/views.py b/ureport/policies/views.py new file mode 100644 index 000000000..a534e3369 --- /dev/null +++ b/ureport/policies/views.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from gettext import gettext as _ + +from dash.orgs.views import OrgObjPermsMixin, OrgPermsMixin +from smartmin.views import SmartCreateView, SmartCRUDL, SmartListView, SmartUpdateView, SmartReadView + +from django import forms + +from .models import Policy + + +class PoliciesForm(forms.ModelForm): + class Meta: + model = Policy + fields = ("is_active", "policy_type", "language", "body") + + +class PoliciesCRUDL(SmartCRUDL): + model = Policy + actions = ("create", "update", "read", "admin", "history") + + class Admin(OrgPermsMixin, SmartListView): + ordering = ("-created_on",) + link_fields = ("policy_type",) + title = _("Policies") + paginate_by = 500 + + def get_queryset(self, **kwargs): + queryset = super().get_queryset(**kwargs) + return queryset.filter(is_active=False) + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["active_policies"] = Policy.objects.filter(is_active=True).order_by(*self.ordering) + return context + + class Update(OrgObjPermsMixin, SmartUpdateView): + form_class = PoliciesForm + success_url = "@policies.policy_admin" + fields = ("is_active", "body", "policy_type", "language") + + class Create(OrgPermsMixin, SmartCreateView): + form_class = PoliciesForm + success_url = "@policies.policy_admin" + + def derive_fields(self): + return ("body", "policy_type", "language") + + def post_save(self, obj): + Policy.objects.filter(policy_type=obj.policy_type, language=obj.language, is_active=True).exclude(id=obj.id).update( + is_active=False + ) + return obj + + class History(OrgPermsMixin, SmartReadView): + def derive_title(self): + return self.get_object().get_policy_type_display() + + class Read(History): + @classmethod + def derive_url_pattern(cls, path, action): + archive_types = (choice[0] for choice in Policy.TYPE_CHOICES) + return r"^%s/(%s)/$" % (path, "|".join(archive_types)) + + def derive_title(self): + return self.get_object().get_policy_type_display() + + def get_requested_policy_type(self): + return self.request.path.split("/")[-2] + + def get_object(self): + policy_type = self.get_requested_policy_type() + return Policy.objects.filter(policy_type=policy_type, is_active=True).order_by("-created_on").first() diff --git a/ureport/polls/templatetags/ureport.py b/ureport/polls/templatetags/ureport.py index 73359be71..21181073a 100644 --- a/ureport/polls/templatetags/ureport.py +++ b/ureport/polls/templatetags/ureport.py @@ -161,3 +161,16 @@ def org_host_link(context): return org.build_host_link(True) except Exception: return "https://%s" % getattr(settings, "HOSTNAME", "localhost") + + +@register.filter +def check_policy(org, policy_type): + if not org: + return None + + from ureport.policies.models import Policy + + return Policy.objects.filter( + policy_type=policy_type, + language=org.language, + is_active=True).order_by("-created_on").count() diff --git a/ureport/polls/tests.py b/ureport/polls/tests.py index 81e77bb96..a1193c183 100644 --- a/ureport/polls/tests.py +++ b/ureport/polls/tests.py @@ -1573,7 +1573,7 @@ def test_responses_poll(self): @patch("dash.orgs.models.TembaClient", MockTembaClient) def test_templatetags(self): from ureport.polls.templatetags.ureport import config, org_color, transparency, show_org_flags - from ureport.polls.templatetags.ureport import org_host_link, org_arrow_link, question_results + from ureport.polls.templatetags.ureport import org_host_link, org_arrow_link, question_results, check_policy with patch("dash.orgs.models.Org.get_config") as mock: mock.return_value = "Done" @@ -1706,6 +1706,21 @@ def test_templatetags(self): self.assertFalse(question_segmented_results(poll1_question, "gender")) + self.assertEqual(check_policy(self.uganda, "privacy"), 0) + + from ureport.policies.models import Policy + + Policy.objects.create( + policy_type=Policy.TYPE_PRIVACY, + body="Privacy matters", + language="ar", + created_by=self.admin, + modified_by=self.admin, + ) + + self.assertIsNone(check_policy(None, "privacy")) + self.assertEqual(check_policy(self.uganda, "privacy"), 1) + def test_delete_poll_results_counter(self): poll = self.create_poll(self.nigeria, "Poll 1", "flow-uuid", self.education_nigeria, self.admin) diff --git a/ureport/public/tests.py b/ureport/public/tests.py index 7f543724a..f4d758140 100644 --- a/ureport/public/tests.py +++ b/ureport/public/tests.py @@ -22,6 +22,7 @@ from ureport.locations.models import Boundary from ureport.news.models import NewsItem, Video from ureport.polls.models import PollQuestion +from ureport.policies.models import Policy from ureport.tests import MockTembaClient, UreportJobsTest, UreportTest @@ -1589,3 +1590,24 @@ def test_countries(self): self.assertTrue("country_code" in response_json) self.assertEqual(response_json["exists"], "valid") self.assertEqual(response_json["country_code"], "MD") + + def test_policy(self): + policy = Policy.objects.create( + policy_type=Policy.TYPE_PRIVACY, + body="Privacy matters", + language="ar", + created_by=self.admin, + modified_by=self.admin, + ) + + self.uganda.language = "ar" + self.uganda.save() + + policy_url = reverse("public.policies", args=['privacy']) + response = self.client.get(policy_url, SERVER_NAME="uganda.ureport.io") + + self.assertEqual(response.request["PATH_INFO"], "/policies/privacy/") + self.assertEqual(response.context["org"], self.uganda) + self.assertEqual(response.context["view"].template_name, "public/policies.html") + self.assertTrue(response.context["policy"]) + self.assertEqual(policy, response.context["policy"]) diff --git a/ureport/public/urls.py b/ureport/public/urls.py index 0fb388932..271da145a 100644 --- a/ureport/public/urls.py +++ b/ureport/public/urls.py @@ -21,6 +21,7 @@ StoriesView, StoryReadView, UreportersView, + PolicyView, ) urlpatterns = [ @@ -42,4 +43,5 @@ url(r"^countries/$", CountriesView.as_view(), {}, "public.countries"), url(r"^added/$", AdditionalMenu.as_view(), {}, "public.added"), url(r"^count/$", Count.as_view(), {}, "public.count"), + url(r"^policies/(?P[a-zA-Z]+)/$", PolicyView.as_view(), {}, "public.policies"), ] diff --git a/ureport/public/views.py b/ureport/public/views.py index 1baa27a33..6cd03fad6 100644 --- a/ureport/public/views.py +++ b/ureport/public/views.py @@ -24,6 +24,7 @@ from ureport.jobs.models import JobSource from ureport.news.models import NewsItem, Video from ureport.polls.models import Poll, PollQuestion +from ureport.policies.models import Policy from ureport.utils import get_global_count, get_linked_orgs @@ -410,3 +411,17 @@ def get(self, request, *args, **kwargs): json_dict["text"] = whole_text return HttpResponse(json.dumps(json_dict), status=200, content_type="application/json") + + +class PolicyView(SmartTemplateView): + template_name = "public/policies.html" + + def get_context_data(self, **kwargs): + context = super(PolicyView, self).get_context_data(**kwargs) + + org = self.request.org + policy_type = self.kwargs.get("policy_type", None) + + context["org"] = self.request.org + context["policy"] = Policy.objects.filter(policy_type=policy_type, language=org.language, is_active=True).order_by("-created_on").first() + return context diff --git a/ureport/settings_common.py b/ureport/settings_common.py index 8733c302a..003ead783 100644 --- a/ureport/settings_common.py +++ b/ureport/settings_common.py @@ -476,6 +476,7 @@ "ureport.jobs", "ureport.locations", "ureport.news", + "ureport.policies", "ureport.polls", "django_countries", "rest_framework", diff --git a/ureport/urls.py b/ureport/urls.py index 263fc3c52..a7a495083 100644 --- a/ureport/urls.py +++ b/ureport/urls.py @@ -25,6 +25,7 @@ url(r"^manage/", include("ureport.jobs.urls")), url(r"^manage/", include("ureport.countries.urls")), url(r"^manage/", include("ureport.assets.urls")), + url(r"^manage/", include("ureport.policies.urls")), url(r"^users/", include("dash.users.urls")), url(r"^manage/", include("smartmin.csv_imports.urls")), url(r"^api/$", RedirectView.as_view(pattern_name="api.v1.docs", permanent=False), name="api"),