aboutsummaryrefslogtreecommitdiffstats
path: root/app
Commit message (Collapse)AuthorAgeLines
...
| * | | Move some download methods to InfoRequest.Louise Crow2013-09-16-25/+41
| | | | | | | | | | | | | | | | | | | | | | | | Use send_file to send zips. Also adds 'all_can_view_all_correspondence?' - is this request completely cachable, or do we need to cache different versions for different levels of privilege?
| * | | Restore the download for hidden requestsLouise Crow2013-09-16-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | This was disabled for hidden requests as the download was by redirect, allowing people who have not been authenticated to conceivably access the download. We'll be moving to send_file instead, so can restore it.
| * | | Make sure that info_request gets assigned to the viewLouise Crow2013-09-16-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This should be handled by assign_variables_for_show_template. Otherwise, the make_request_summary_file method shouldn't depend on instance variables
| * | | Move zip file creation to its own method.Louise Crow2013-09-16-16/+15
| | | |
| * | | Move display text generation to outgoing message.Louise Crow2013-09-16-5/+9
| | | |
| * | | Remove hidden incoming messages from correspondence.txtLouise Crow2013-09-16-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a spec for what we want to see - no message text in correspondence.txt, and no attachments. Refactors the simple_correspondence templates to make it clearer that these are doing the same job as the html.erb ones, for text.
| * | | Split up translated messages.Louise Crow2013-09-16-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each part is a separate sentence, and we're going to reuse some of them in the text view. Conflicts: spec/integration/view_request_spec.rb
| * | | Move a couple of complex conditionals to helper methods.Louise Crow2013-09-16-2/+11
| | | | | | | | | | | | | | | | We're about to reuse them for the text view.
| * | | Remove unused param.Louise Crow2013-09-16-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Conflicts: app/views/request/_incoming_correspondence.html.erb
| * | | Normalize method spacing.Louise Crow2013-09-16-0/+3
| | | |
| * | | Extract calculation of last update hashLouise Crow2013-09-16-2/+5
| | | |
| * | | Extract out code for making a request summary fileLouise Crow2013-09-16-45/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Render the show template within the current thread rather than making another request - we're going to need to use the current session in order to know what do include in the zip file, now that we have more fine-grained visibility of messages. Also, this will mean we can use this functionality in single threaded contexts, and test it more easily. Don't display profile photos as this would require another process, and hide other icons so we don't need to include them. Use render_to_string as a more standard way of rendering templates to a string for further manipulation.
| * | | Extract the various info_request assignsLouise Crow2013-09-16-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | So we can reuse them when rendering the show template to a file. Lots of the sidebar prep isn't going to be needed for that view, so make that optional in the template.
| * | | Reorder assignsLouise Crow2013-09-16-12/+12
| | | | | | | | | | | | | | | | | | | | Split into those that come from request params and those that come from the model
| * | | Add new code and specs for hiding attachments.Louise Crow2013-09-16-11/+33
| | | |
| * | | Handle the case of an empty string in the prominence_reason.Louise Crow2013-09-16-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will happen if the prominence has been changed in the admin interface but no reason has been filled in. Conflicts: app/views/request/_incoming_correspondence.html.erb
| * | | Add a possible event type 'edit_incoming'.Louise Crow2013-09-16-1/+1
| | | | | | | | | | | | | | | | This will cover changes in prominence to incoming messages.
| * | | Add the meat of the update action.Louise Crow2013-09-16-0/+19
| | | |
| * | | Link to the new incoming message edit form.Louise Crow2013-09-16-1/+6
| | | | | | | | | | | | | | | | From the request admin page.
| * | | I don't think there's any need to refind incoming messages.Louise Crow2013-09-16-1/+1
| | | | | | | | | | | | | | | | The order is the same as the default association.
| * | | Use new partial for incoming message admin boilerplate.Louise Crow2013-09-16-5/+1
| | | |
| * | | Add a simple edit action and templateLouise Crow2013-09-16-0/+32
| | | |
| * | | Shorter route names and pathsLouise Crow2013-09-16-6/+6
| | | |
| * | | Add incoming message update action and route.Louise Crow2013-09-16-0/+3
| | | | | | | | | | | | | | | | | | | | We'll use this for saving the changes to the prominence of an incoming message in a relatively RESTful url structure.
| * | | Make prominence states a constant so we can access them elsewhere.Louise Crow2013-09-16-5/+2
| | | |
| * | | Slightly nicer action names.Louise Crow2013-09-16-2/+2
| | | |
| * | | Move incoming message admin to its own controller.Louise Crow2013-09-16-52/+54
| | | | | | | | | | | | | | | | | | | | Make specs that depend on multiple controllers and models interacting integration specs.
| * | | Move outgoing message admin actions to their own controller.Louise Crow2013-09-16-33/+36
| | | | | | | | | | | | | | | | Eventually this should use standard RESTful routing.
| * | | Don't index hidden and requester_only incoming messages.Louise Crow2013-09-16-0/+8
| | | |
| * | | Remove unused hidden correspondence template.Louise Crow2013-09-16-33/+0
| | | |
| * | | Add prominence reason.Louise Crow2013-09-16-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: app/views/request/_incoming_correspondence.html.erb Conflicts: spec/integration/view_request_spec.rb
| * | | Adding prominence_reason to IncomingMessage.Louise Crow2013-09-16-0/+1
| | | |
| * | | Add messages for hidden and requester_only states.Louise Crow2013-09-16-15/+35
| | | | | | | | | | | | | | | | Different messages for normal user, requester and admin user.
| * | | Refactor common logic about prominence and access.Louise Crow2013-09-16-14/+2
| | | | | | | | | | | | | | | | Move it into the Ability module.
| * | | Add a method to ask whether a user can view an incoming message.Louise Crow2013-09-16-0/+10
| | | |
| * | | Rename method to make it a bit more genericLouise Crow2013-09-16-5/+5
| | | | | | | | | | | | | | | | A super user will be able to see all hidden things, not just requests.
| * | | Refactor correspondence template into partials.Louise Crow2013-09-16-81/+63
| | | |
| * | | Add response_event helperLouise Crow2013-09-16-0/+6
| | | | | | | | | | | | | | | | | | | | Add a convenience method for getting the 'response' event associated with an incoming message.
| * | | Add prominence to incoming message.Louise Crow2013-09-16-0/+7
| | | |
| * | | Re-annotate models with database fieldsLouise Crow2013-09-16-143/+124
| | | |
| * | | Remove prominence.Louise Crow2013-09-16-24/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a migration to remove the unused column 'prominence' from info_request_events, remove validation of prominence, remove unused InfoRequestEvent.user_can_view? method. Remove references to InfoRequestEvent.prominence.
* | | | Merge branch 'feature/issue-902-fix' into rails-3-developLouise Crow2013-09-17-1/+5
|\ \ \ \
| * | | | Allow a unicode-only title in validationLouise Crow2013-09-17-1/+5
| | | | |
* | | | | Make graph title and axis labels translatableMark Longair2013-09-12-11/+11
| |_|_|/ |/| | | | | | | | | | | | | | | The labels on the public body statistics graphs weren't marked as being translatable. Fixes #1079.
* | | | Merge branch 'public-body-locale-fallback' into rails-3-developLouise Crow2013-09-12-23/+84
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Conflicts: app/controllers/public_body_controller.rb config/general.yml-example lib/configuration.rb
| * | | Don't display duplicate public bodies with the fallbackMark Longair2013-09-12-30/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces some raw SQL statement for the fallback case, but we can't see an easy way to avoid that in this case. This commit also adds some tests that assert the sorting and non-duplication properties of the listing. Thanks to Louise Crow for working out the SQL expression for falling back to the default locale.
| * | | Fix locales used to find public bodies in AdminPublicBodyControllerMark Longair2013-09-10-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The locale returned from locale_from_params may be dash-separated, (the I18n module convention) whereas those in the public_body_translations table are underscore-separated. The AdminPublicBodyController was looking for dash-separated locales in that table, so ensure that dashes are substituted for underscores before using them in a query.
| * | | Make falling back to default locale in public body listings optionalMark Longair2013-09-10-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the code stood, the list method in PublicBodyController would only return results that had translations of the public body in the default locale. This has a variety of problems if you're viewing pages in the non-default locale - for example, the "first letter" links wouldn't bring up the public bodies that began with that letter in the current locale, only those that began with it in the default locale. Ideally, every public body would be translated into every available locale for the site, but there are cases where deployers wish to have public body listings also include those from the default locale, in case there are untralsated public bodies: https://groups.google.com/d/msg/alaveteli-dev/zUY_USaAMAM/M7KTQ9RC5YUJ This commit makes the default behaviour to look for public body listings only in the current locale, but if the new configuration option PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE is set, then public body listings will be looked for in both the current locale and the default locale. Fixes #1000
| * | | Tidy up SQL query stringsMark Longair2013-08-29-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the list method of PublicBodyController, capitalize the SQL keywords consistenly and don't include extraneous whitespace in the strings. (On the former point, previously only some were - the convention is a matter of some debate, but in this case the you editor's not doing to do syntax highlighting of SQL so having the keywords capitalized helps its readibility, I think.) I wouldn't normally do this kind of cosmetic tidying up, since it affects the tidiness of diffs and merges, but in this case I'm going to change all these lines in the next commit anyway, so that reasoning doesn't apply.
* | | | Save cached columns once updated.Louise Crow2013-09-05-0/+6
| | | |