aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Default.pm
Commit message (Collapse)AuthorAgeLines
* Don't error when devolved body, blank send methodsMatthew Somerville2017-04-12-7/+5
| | | | | | | The check assumed that if a body was devolved, either the contact or the body would have a send method. Instead, use a contact send method if devolved and it exists, a body send method if it exists or the fallback if neither. Fixes #1374.
* [Oxfordshire] Use 'days ago' format on problem listspezholio2017-02-27-0/+11
| | | | Fixes mysociety/fixmystreetforcouncils#98
* [Oxfordshire] Add Exor RDI file download featureDave Arter2017-02-15-1/+0
| | | | | | | | | | The RDI file format encapsulates information about inspections that have taken place, and can be uploaded into Exor to create defects in bulk. This commit adds a page to the Oxfordshire cobrand's admin allowing RDI files to be generated and downloaded from FMS. For mysociety/fixmystreetforcouncils#127
* Allow cobrands to control which states affect reputationDave Arter2017-02-15-0/+10
| | | | | | | | | | | | Rather than assigning +1 to a user's reputation every time a report is inspected, this allows cobrands to specify which states should increment or decrement the reputation value when a report is inspected. The default behaviour is for reputation to never be changed, but the Oxfordshire cobrand will increment the reputation when a report is marked as 'action scheduled'. For mysociety/fixmystreetforcouncils#119
* [Oxfordshire] Allow cobrand-specific traffic management optionsDave Arter2017-02-08-0/+7
| | | | Fixes mysociety/fixmystreetforcouncils#159
* Call base_url_with_lang in base_url_for_report.Altin Ukshini2017-02-03-3/+3
| | | | | | This function is used e.g. in report lists, and if you were using the multiple language subdomain functionality, those links could take you to a different language.
* Add permision to view contributor detailspezholio2017-01-17-0/+1
|
* Update has_body_permission_to to allow superusers.Matthew Somerville2017-01-10-5/+5
|
* [Zurich] Fix accidentally hidden category extra fieldsDave Arter2016-11-24-0/+1
|
* [UK] Hide usrn/asset_id Open311 fields.Matthew Somerville2016-11-11-0/+9
|
* Add sort order options to list pages.Matthew Somerville2016-11-04-1/+1
| | | | | | | | Includes newest, oldest, least/most recently updated, and most comments. The default remains the same, which is last updated on /reports, and newest on /my and /around (the latter plus not-in-view sorted-by-distance ones).
* Hide confirmed column if all categories confirmed.Matthew Somerville2016-10-24-1/+2
|
* Use default link zoom for all map types.Matthew Somerville2016-10-21-11/+14
| | | | [Bristol] Use more zoomed-in default link zoom.
* Merge remote-tracking branch ↵Matthew Somerville2016-09-20-1/+1
|\ | | | | | | 'origin/issues/forcouncils/89-tidy-report-admin-actions'
| * Organize report admin actions into single control.Zarino Zappia2016-09-20-1/+1
| | | | | | | | | | | | | | | | As part of this, rename "planned reports" to "shortlist". The `.segmented-control` component now supports basic usage (as in the admin report actions menu bar) and usage with hidden radio inputs and labels (as on the report questionnaire page).
* | Add ‘trusted’ flag allowing users to make reports directlyDave Arter2016-09-20-0/+6
|/ | | | | When a trusted user makes a report in a category that requires inspection, it'll be sent immediately (i.e. without being inspected first).
* Add new category_edit restriction for viewing body admin.Matthew Somerville2016-09-09-2/+5
|
* Admin restrict report/user sections appropriately.Matthew Somerville2016-09-09-6/+10
|
* Admin flagged page for superusers only.Matthew Somerville2016-09-09-5/+5
| | | | Adapt code so that it could be opened up more in future.
* Refactor problem response priority into its own modelDave Arter2016-09-09-7/+12
| | | | | | | This moves the response priority values from a cobrand-specific method to a full DB model, and includes management screens in the admin for administering them. For mysociety/fixmystreetforcouncils#66
* Add ‘Inspection required’ field to categoriesDave Arter2016-09-09-9/+9
| | | | | | | | | | | Categories can now require reports to be marked as 'inspected' via the frontend before they're sent by send-reports. A side-effect here is that send-reports will perform an extra n queries for each report, where n is the number of bodies that report is being sent to, but hopefully in practice this won't matter as it's an offline cronjob. See mysociety/fixmystreetforcouncils#50
* Extend response templates to work across all cobrandsDave Arter2016-09-08-1/+10
| | | | | | | | | | | This builds on the response templates in the Zürich cobrand: - Allow response templates to be assigned to categories - Also adds a auto_response flag, which will be used to automatically create updates when reports are made. - Include response templates select box on update form For mysociety/fixmystreetforcouncils#31
* Allow searching for reports with ref: prefix in postcode fieldDave Arter2016-08-22-0/+11
| | | | | | | | | Searches the `id` and `external_id` fields. This takes you directly to the report if only a single report matches, otherwise a disambiguation page is shown. For mysociety/fixmystreetforcouncils#16
* Restrict admin config/stats pagesDave Arter2016-08-17-1/+27
| | | | | The config page is only accessible by superusers. The stats page only shows figures for the user’s from_body unless superuser.
* Allow user permissions to be granted/revoked in adminDave Arter2016-08-17-0/+31
|
* Restrict user editing in adminDave Arter2016-08-17-0/+24
| | | | | | | | The 'user_edit' permission is required to edit users. The admin pages on UK council cobrands only allow editing of users whose from_body is the same as the logged-in user, or who have sent reports or updates to the council.
* Add HTML email templates.Matthew Somerville2016-08-01-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Design is all Zarino. This adds the ability to send HTML emails, including attached inline images. When included, this is done as a multipart/related email containing a multipart/alternative (of plain and HTML) and any attached images, so that the images are available even if HTML mail is not. The alert emails list data has been improved so it can be constructed in the templates rather than the code. Various templates have been tidied. Various workarounds for email clients have been made, including: * <th> is used so that the Android 4.x mail client can give them `block` styling in the small screen media query. * Font settings defined on every table cell (<th>) so that sans-serif fonts are used in Outlook, rather than Times New Roman. * A three-column wrapper table to create a 620px centred content area that also shrinks down on narrow screens. (Outlook doesn’t like max-width, so this is the simplest alternative.) * Enforcing a sensible (500px) min-width for the main content area, on clients that don’t support media queries (eg: native Gmail app). * Giant borders on buttons so Outlook displays them * Image alignment with align rather than float.
* Use normal user authentication to control access to /adminMatthew Somerville2016-07-19-2/+14
| | | | | | | | | - Adds is_superuser flag to User - Logged-in user must be a superuser or have from_body set in order to access anything within /admin - has_permission_to on a superuser will always return true - Only superusers can create/grant superusers - New `createsuperuser` command for creating superusers
* [UK Councils] Show all reports on cobrand /around mapDave Arter2016-07-08-0/+25
| | | | | | | | | | | | | | There is a concern that excluding district council reports from a two-tier council's cobrand's /around page might lead to duplicate reports or reports never being seen. This commit adds them to the map and the sidebar and displays the destination council in the report list item. Clicking the pin or the report link leads to the report on FMS.com. Reports sent to the a council other than the the active cobrand are shown as grey pins on the map, and the receiving council's name is shown in the sidebar list.
* [Bristol] Only show Open311 categories on Bristol cobrandDave Arter2016-07-08-0/+11
| | | | | | | | | | | | This adds a new Cobrand::Default::categories_restriction method that can be used to limit what categories are available when making a new report on a per-cobrand basis. This is used by Cobrand::Bristol to only show Open311 categories when making a new report on fixmystreet.bristol.gov.uk but allowing all categories on FMS.com. Also removes the Hart::hidden_categories and uses the new categories_restriction method to achieve the same thing.
* Make sure map JS works through an admin proxy.Matthew Somerville2016-07-04-1/+4
| | | | | Tidy up use of absolute URLs when in the admin. Have the 404 handler spot static files in admin as a fallback.
* Remove stringify call from template pathsDave Arter2016-06-15-3/+3
|
* [UK Councils] Send correct confirm emails for updatesDave Arter2016-06-15-0/+18
| | | | | | | | | | | | | | | | | | | | | | Some UK councils with Open311 integrations (e.g. Bromley) have a custom wording in the confirmation email sent when updates are left on reports, to make the user aware that the update is sent to the council in question. Bromley noticed that some emails were being sent without this wording, leading at least one user to contact the council directly about the report. It turns out that although the email template contains an IF clause to use the appropriate wording for Bromley (and Stevenage) reports, the incorrect template file was being used when updates were made via the Bromley cobrand. This commit solves the problem by introducing a new `Cobrand::Default::path_to_email_templates` method, which is overridden by `Cobrand::UKCouncils` to include the `templates/email/fixmystreet` path. Paths returned by this method are used as the `additional_template_paths` param when templating emails. A regression test is included. Additionally moves email templates for fixmystreet.com to a directory name reflecting their purpose, in the same way the web templates are arranged.
* Remove final web/fixmystreet templates.Matthew Somerville2016-04-20-2/+1
| | | | And associated, e.g. nothing references fixmystreet-old-box.js any more.
* Cope with a '/' in body name in body slug.Matthew Somerville2016-04-20-0/+1
| | | | Fixes #574.
* [fixmystreet.com] Move country lookup client side.Matthew Somerville2016-03-31-4/+0
| | | | | There's no need for the IP->country lookup, only used in JavaScript to display a banner, to require a call to the FixMyStreet server.
* Add cobrand-specific custom reporting fields.Matthew Somerville2016-03-09-0/+11
| | | | | | This adds a new cobrand variable, report_form_extras, which contains a list of extra fields that will be saved in the 'extra' metadata of the report. Fields may optionally be marked as required.
* Rename process_extras to process_open311_extras.Matthew Somerville2016-03-08-1/+1
| | | | | It is currently only used for processing extra fields (the list, not the metadata hash) which is really only of relevance to Open311.
* Fix cobrand restriction of My/Nearby.Matthew Somerville2015-12-15-7/+28
| | | | | | | | | | | | 5c79337 simplified a bit too far, as after then a particular cobrand could in Nearby and My only filter reports to a particular body, not any other criteria. To fix this, introduce more generic functions in the default cobrand to allow more flexibility. Make sure a few tests delete their bodies fully so that new tests pass when run as part of the suite. Fixes #1289.
* Reduce use of FixMyStreet::App.Matthew Somerville2015-12-02-1/+1
| | | | Command line scripts don't need a full blown app, just database.
* [Zurich] Provide a setup-contacts command.Hakim Cassimally2015-10-06-0/+44
| | | | | | | | | | | | | for Zurich (and generic data), progressing mysociety/FixMyStreet-Commercial/issues/663, to provide a way for body/contact config to be consistent across dev/staging/live. Run like so: bin/setup-contacts zurich e.g. with the lower-case sigil describing the cobrand to run setup-contacts for.
* Use base URL in cobrand alert for no-body report.Matthew Somerville2015-09-03-1/+2
| | | | | | If a cobrand has a body restriction, then a report without any body won't be shown on it, so we need to make sure links to the report (in email alerts and RSS) are to the base URL, not the cobrand.
* Simplify/consolidate body restriction db code.Matthew Somerville2015-08-19-15/+6
| | | | | | | Make dashboard work properly in two-tier councils, showing reports sent to both. Create an index on the array of the bodies_str column to speed up performance, and use that throughout the code replacing all LIKE scans. This also enables a simplifying tidy of the restriction code.
* [Oxfordshire] Add expected response time to report pageDave Arter2015-07-22-1/+0
| | | | | This adds a new problem_response_days sub to the Oxfordshire cobrand that provides an expected response time based on a problem's category.
* Simplify default status filter for map pinsSteven Day2015-06-29-9/+0
|
* Combine all My Reports into a single list, allow filteringSteven Day2015-06-29-0/+8
|
* Allow cobrands to override the default 'state' filter for map pinsDave Arter2015-06-29-0/+9
|
* Allow cobrands to specify ordering on all reports pageDave Arter2015-06-29-0/+10
| | | | | Refactor the default ordering into a method on the Default cobrand which can be overridden by subclasses.
* [Zurich] change jurisdiction_id in Open311 exampleHakim Cassimally2015-03-31-0/+5
|
* Use List::MoreUtils, old List::Util lacks none().Matthew Somerville2015-02-20-1/+1
|