style: drop form-horizontal - our style is much closer to plain Bootstrap forms
form-horizontal is made for grid markup. It give form-groups a negative margin to break out of the grid ... but the way we use it for settings, we have to do weird things to undo that. The default styling for forms is much closer to what we want. It looks ok without our custom styling and is easier to style to our style.
If we want grid markup with form-horizontal, it would be correct to re-introduce both at once.
graph: align the dots with the middle of the first *visible* child element
The changelog graph will have invisible first elements when a range is selected. That caused an odd graph. Fixed by adding the :visible selector that was lost in 5258b66bf5d7.
docs: add documentation about internationalization from a user perspective
While there is already documentation about creating and updating translations (developer perspective), there was nothing for the user/admin of Kallithea. Since the handling in TurboGears2 is different, this is a good time to add it.
i18n: use TG2 compatible settings names i18n.lang and i18n.enabled
Following changes are made: - Remove list of available translations: severely outdated and hard to maintain. - Replace lang with i18n.lang, reasons: - Follow TurboGears2 conventions - Align with 'i18n.enabled' which cannot be shortened - Scoped settings provide grouping and are more clear The old 'lang' is still recognized though, so no upgrade issue. - Introduce/document i18n.enabled
Comments are intentionally kept concise in favor of the documentation.
Under TurboGears2, automatic user language detection based on browser settings is enabled by default. If a user has 'English' as preferred language in the browser, then the old English .mo file with a few dummy entries would be read and used first, before trying the language configured in the Kallithea .ini file (e.g. French). This renders a mix of languages in the UI ... which is unexpected.
The hiding of configured translation is fixed by removing the old english translationfile. It was preserved via commit 7d6c4bd58abd when removing all other .mo files. The next release will require major config changes anyway, and we don't try to be backwards compatible.
When the browser size has been changed, the dots may no longer be correctly aligned with the table rows. Currently, the graph will just overflow without changing size, but that can soon change.
style: use plain Bootstrap with existing CSS styling
This is an intermediate step, trying to make our markup stay as close to plain Bootstrap as possible, minimize the amount of customizations, and accept small visual differences.
More long term, we will try to move to generated CSS with Bootstrap and our customizations.
email: don't crash on sending mails with unicode comments without appropriate environment configuration (Issue #275)
For example, on Linux, running `gearbox serve` with LANG=C, would crash in:
File ".../kallithea/lib/celerylib/tasks.py", line 307, in send_email % (' '.join(recipients), headers, subject, body, html_body)) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 224: ordinal not in range(128)
Replacing render with render_unicode works in this case ... but there might be other problems elsewhere.
make-config: use %(here)s in the generated file instead of hardcoding absolute path
Restore what paster make-config did until we introduced gearbox in d2aa8b1625a4. The make-config sub command was re-introduced in 6c8af2d22deb but created files with absolute paths.
Neither git nor mercurial nodes have a _mimetype attribute. Only test_nodes.test_mimetype monkey patches it and that to me seems just wrong. Thus, remove that part and fix the test with some usefull assertions.
pylint found import-error 'import objgraph'. This is bit-rotten and doesn't seem like something we need. If we need it, there is probably a better way to do it now.
docs: clarify that Session usually should be called - methods should not be used directly
Documentation based on clarification by Søren Løvborg:
Session is the factory/singleton manager, which tracks the current session (per thread). To end the current session entirely and destroy the Session object, we call remove on the manager (Session.remove()). (A new session will be created on-demand.)
Session() returns the current session for the active thread (or creates a new session, if there's none). commit is a method of the SQLAlchemy Session class, thus called as Session().commit() ... it's a method call on the current Session object, not the session factory/manager.
SQLAlchemy may have some hackery to allow Session.commit() to be called, and the call automatically redirect to the actual Session object... but that's a hack and should be avoided.
TL;DR: for remove, call it on Session; for everything else, call it on Session().
setup: don't use setuptools 34 - it has indirect conflicts with the celery version supported on the stable branch (Issue #266)
Setuptools==34 requires packaging>=16.8 which has an unconstrained requirement of pyparsing ... but actually it doesn't work with pyparsing==1.5.7 ... which is required by celery<2.3 ... which this version of Kallithea requires.
Celery has been upgraded on the development branch but we don't want to do that on the stable branch.
tests: check returncode from executing external commands
If a command fails, it could lead to undefined behavior, which lets tests fail without clear indication of the cause of the failures. Therefore, if not stated otherwise, check the return code.
pullrequests: fix "additional changes" js error - make sure all cs tables have a first column to align with (Issue #274)
A slight simplification of 16234f629cfb and fixing a JavaScript failure for unauthenticated visits to PRs with pending available changesets.
nextFirstincell would be undefined becuase the "Current revision - no change" line didn't have any elements in td, and nextFirstincell.offsetTop would thus fail.
Fixed by adding a span around the text.
Also clarify that any element is fine - there is no need to check for visibility.
logging: don't change the log level in the handler config
I find it confusing that even though the log level for sqlalchemy.engine was INFO, because the log level of handler_console_sql was WARN, there were no INFO output from sqlalchemy.engine. Therefore remove the level setting for the handlers in the default settings. I think this makes it (a bit) more intuitive.
repositories: make sure repositories not only differ in casing
Repositories only differing in case cause problems: * it can't be stored on case insensitive filesystems (Windows and MacOS) * some databases can't easily handle case sensitive queries * users will most certainly be confused by names that only differ in case
We will keep trying to be case sensitive on systems that can ... but on some systems wrong casings might work. We don't care.
The validators are changed to prevent mixed case repo and repo group names.
Repository sensitivity tests are removed, and insensitivity tests are added instead.