| Commit message (Collapse) | Author | Age | Lines |
|
|
|
| |
Fixes https://github.com/mysociety/alaveteli/issues/1563
|
| |
|
|
|
|
|
|
|
|
|
| |
Sometimes pdftohtml will generate thousands of images when converting an
image embedded in a PDF. This causes a request spike when a user tries
to view the converted PDF as HTML.
See https://bugs.freedesktop.org/show_bug.cgi?id=77932 for the bug
report.
|
|\ |
|
| |
| |
| |
| |
| | |
Was confusing what the number meant; easier to just sum numbers in the
quartery columns to get totals.
|
| | |
|
| | |
|
|\ \ |
|
| | | |
|
| | |
| | |
| | |
| | | |
Taken from https://github.com/mikel/mail/pull/602
|
| |/
|/|
| |
| | |
Sets viewport, uses responsive header and footer templates.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
TODO: We really should be testing the full output of RTF#body, but we currently
want to remain consistent with Adapters::PDF as many methods are shared between
the Adapters.
A more correct spec might be:
expected = %Q(<font size=3><font color="#000000">thisisthebody</font></font>)
adapter.body.should == expected
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
TODO: We really should be testing the full output of PDF#body, but
inconsistencies between pdftohtml prevent sensible means of doing this.
For example:
adapter.body.should == %Q(\n<A name=1></a>thisisthebody<br/>\n<hr>\n)
Fails because some versions (correctly!) use lower case tag names.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Extracts the attachment processing from FoiAttachment#body_to_html
AttachmentToHTML contains adapters which convert
- text/plain
- application/pdf
- application/rtf
Results are returned as an AttachmentHTML::HTML instance which contains
the raw HTML and other metadata about the conversion.
|
|\ \
| |/
|/|
| | |
'opennewzealand_github/feature/handle-undefined-conversion' into rails-3-develop
|
| | |
|
| |
| |
| |
| |
| |
| | |
From: http://ruby-doc.org/core-2.0/String.html#method-i-encode
Ducktypes for having encode rather than relying on RUBY_VERSION
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | | |
Conflicts:
config/general.yml-example
spec/factories.rb
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
Conflicts:
doc/CHANGES.md
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously it accepted a user, but for this usage we won't necessarily
have one.
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is involved with the construction of meaningful xapian queries with
respect to InfoRequestEvents. This commit also removes the
get_tags_from_params method, which presumably was targeted at
PublicBodies, but doesn't seem to actually be used anywhere.
XapianQueries is used to extend InfoRequestEvent in order to prevent
InfoRequestEvent becoming too unwieldy and to preserve the association
between these methods.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Update our session-stripping code.
|
| |_|/ /
|/| | |
| | | |
| | | | |
Revert translation of interpolated variable in French locale.
|
| |/ /
|/| | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \ |
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is a fix for issue #1232. Richard Taylor pointed
out that some PDF attachments had the non-standard content-type
document/pdf, and that these weren't being treated as PDFs.
(Ganesh Sittampalam discovered that all of these PDFs were
generated by a Lexmark X945e, according to the PDF metadata.)
This commit adds an extra case to normalise_content_type to map
document/pdf to application/pdf.
In fact, since the upgrade of the Mail gem in ccebe3c3d6d4dc5f81
the behaviour when handling the non-standard content-type
document/pdf was much better, but this commit also means that
you get the right icon for the attachment, and can be
cherry-picked onto older versions to fix #1232.
|
|\ \ \ \
| |_|/ /
|/| | | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| |/ /
|/| |
| | |
| | | |
Conflicts:
Gemfile
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The tests of quietly_try_to_purge were failing on Ruby 2.0 due to the
net-http-local gem not working with that Ruby version. When
Net::HTTP::bind is called, it temporarily replaces the open method of
TCPSocket with a version of open that only takes two parameters. The
Ruby 1.9 version of net/http.rb calls TCPSocket.open with two
parameters, but the Ruby 2.0 version calls it with 4, and so fails with
a mismatched number of arguments error.
In fact, net-http-local doesn't seem to be necessary with Ruby 2.0,
where one can supply a :local_port argument to Net::HTTP.start, so this
commit patches lib/quiet_opener.rb to use that approach with Ruby
>= 2.0, and net-http-local on earlier versions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|