| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
| |
We don't really want to make all the translators retranslate strings
that are basically the same but slightly tweaked in the English version.
So this task just replaces the msgid in the app.po files for each locale.
|
| |
|
| |
|
| |
|
|
|
|
| |
Install script on AWS uses development mode by default
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
Some Public Body names contain commas (or other characters) which lead
to a malformed CSV where parts of the body name are in later columns.
|
| |
| |
| |
| |
| | |
ENV[‘SITE’] can be specified for the crontab (and elsewhere) so
allow the option here too.
|
| |
| |
| |
| |
| | |
Deployment system should handle linking the original location to
wherever necessary on the specific platform.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Less manual editing for reinstallers.
Existing backwards-compatibility:
$ bundle exec rake config_files:convert_crontab \
DEPLOY_USER=deploy \
VHOST_DIR=/home/vagrant/ \
VCSPATH=alaveteli \
SITE=alaveteli \
CRONTAB=config/crontab-example | grep 'MAILTO='
MAILTO=cron-alaveteli@mysociety.org
New optional MAILTO option:
$ bundle exec rake config_files:convert_crontab \
DEPLOY_USER=deploy \
VHOST_DIR=/home/vagrant/ \
VCSPATH=alaveteli \
SITE=alaveteli
CRONTAB=config/crontab-example \
MAILTO=cron@example.org | grep 'MAILTO='
MAILTO=cron@example.org
|
| |
|
|
|
|
|
| |
Was confusing what the number meant; easier to just sum numbers in the
quartery columns to get totals.
|
| |
|
|
|
|
|
| |
Previously it accepted a user, but for this usage we won't necessarily
have one.
|
|\
| |
| |
| | |
ssh://git.mysociety.org/data/git/public/alaveteli into feature/less-destructive-themes-install
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the themes:install rake task would remove the existing
theme with 'rm -rf' and re-clone the theme into place. This is
unfortunate for a developer who has been making changes to a theme
and then runs the rails-post-deploy script, since it calls the
themes:install task which will wipe out those changes. In
addition, when installing themes it would deliberately remove the
.git directory of the theme, so if you do want to work in that
theme you'd have to reinitialize the theme directory to be a git
repository again.
This commit changes the task so that now:
- If a theme directory is present but it isn't a git
repository, it's moved out of the way.
- If there's no theme directory at the expected location after
that step, the theme repository is cloned into place
- The task ensures that the origin remote points to the theme's
URL, and fetches from that remote.
- If there are any uncommitted changes in the theme repository
or the current commit appears not to have been pushed, the
task exits with a helpful error.
- The preferred branch or tag is checked out in the theme
repository as before.
(The uninstall, install and post_install hooks are run as before.)
This shouldn't make a difference to deployed instances of Alaveteli
but will be helpful for developers who want to work on developing
a theme.
Fixes #1111.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under Ruby 1.8.7, you can parse a CSV file with the
following code (Example A):
require 'csv'
CSV.parse('foo.csv') do |row|
puts "got row: #{row.inspect}"
end
Rather confusingly, under Ruby 1.8.7, CSV.parse can also
take a string representation of the contents of the file
as its parameter, so this also works (Example B):
require 'csv'
CSV.parse("1,hello,red\n2,goodbye,green") do |row|
puts "got row: #{row.inspect}"
end
However under Ruby 1.9.3, CSV.parse only expects a string
representation of the contents of the CSV file, so only
Example B works; Example B fails silently (interpreting
the filename as a single cell CSV file, typically).
The import:import_csv rake task unfortunately relied on
both A and B working. This commit fixes this by adding
PublicBody.import_csv_from_file, and refactoring
PublicBody.import_csv to use the newly added class method,
and adds a test to check for any regression in this
behaviour.
(This means that the usage of import_csv in the admin public
body controller's import_csv action could now be changed
to use PublicBody.import_csv_from_file directly from the
uploaded file, which would be more efficient and cope
with larger files without using lots of memory.)
Fixes #1229
|
|
|
|
|
|
|
|
|
|
|
| |
The theme install task would fail if there's an old theme present
in vendor/plugins, since it doesn't try to uninstall the plugin from
that location, only the new location. Then when the install.rb
in the new plugin runs, it'll complain that there's a
public/alavetelitheme symlink already present.
This commit changes themes:install to try to uninstall the plugin
from both locations.
|
|
|
|
|
|
| |
(An alternative would have been to add an empty lib/themes/.gitkeep
file to this directory, but that makes ignoring the installed themes
more complicated.)
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These are essentially required in exactly the same way as before, but
from lib/themes rather than vendor/plugins. This is the simplest
possible change in order make the themes work outside vendor/plugins,
I think, but it's not necessarily ideal. It would be worth considering
whether these should be changed to Rails engines, as described here:
http://guides.rubyonrails.org/engines.html
|
| | |
|
|/
|
|
| |
Also removes old temp tasks.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
As suggested by Louise Crow, this new rake task reuses
the convert_ugly function to rewrite the crontab-example
file into a usable crontab file.
|
| |
| |
| |
| |
| | |
I assume 'skip' must have been an argument to this function
before it was introduced into our repository.
|
|\ \
| | |
| | |
| | | |
ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We have changed the denominator of the proportion-based statistics
to only include requests that are both visible and not
'awaiting_description'. This would mean, however, that the numerator
could be larger than the denominator. This commit updates the
calculation of those statistics to also exclude any hidden or
unclassified requests.
|
|/ /
| |
| |
| | |
This is in the service of #1173 and #1174.
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
config/initializers/alaveteli.rb
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The code that extracted the theme name from each entry in THEME_URLS (in
order to require code from a directory whose leaf name is the theme
name) only supported git URLs that ended in '.git'. However, the
themes:install rake task usefully supports a wider range of git URLs -
for example, all of the following were supported:
/home/whoever/themes/blah-theme => blah-theme
/home/whoever/themes/blah-theme/ => blah-theme
git://wherever/blah-theme.git => blah-theme
ssh://wherever/blah-theme.git// => blah-theme
This commit factors out a theme_url_to_theme_name method,
adds tests for it, and uses that method in both:
lib/tasks/themes.rake
config/initializers/theme_loader.rb
... so that a wider range of theme URLs are consistently supported.
|
|\ \
| | |
| | |
| | | |
rails-3-develop
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The time estimates were confusing on two counts:
- The messages mixed locales
- The estimates were hugely inaccurate, since the import slows
down as time goes on
|
| | |
| | |
| | |
| | | |
Thanks to Louise Crow for pointing out this problem.
|
| |/
| |
| |
| |
| |
| |
| |
| | |
For importing a very large number of public bodies, it's mostly likely
less frustrating to import them from the CSV file using this rake task
instead of using the form in the admin interface.
Fixes #1132
|
|/
|
|
|
|
|
|
| |
This task was taking a huge amount of memory, even when fetching
the InfoRequest objects with find_each. With an additional find_each
for public bodies (10 at a time) and reducing the batch size for
info requests to 200 at a time, the memory size of this rake task is
kept down to about 400MB.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On PublicBody, we don't need to update info_requests_count
because that's already done with :counter_cache. On the
other hand, info_requests_successful_count and
info_requests_not_held_count can't be updated easily with
counter_cache (since they need conditions to be attached).
Instead we update them in post_save and post_destroy,
as suggested here:
http://blog.douglasfshearer.com/post/17495285851/custom-counter-cache-with-conditions
This also adds tests to ensure that the
after_(save|destroy) callbacks are called and that they
modify the counts correctly.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The statistics on the status of the requests to a particular
public body are too slow to calculate on-the-fly, so this
commit adds:
* Extra columns on public_bodies to store counts of
the successful, not held, and overdue request counts
for each public body.
* A rake task which should be run periodically to update
the overdue request count column.
If Javascript is not available, the summary statistics are
shown as tables. If Javascript is available, graphs are
drawn with Flot.
|
|/ |
|