The existing docs were far from how we wanted it to be. There was so much to do and it is not feasible to do that cleanup it in clean patches.
Instead, I took a sweep through the docs and changed what I thought could benefit from a change: structure, examples, advices, language, markup, content, etc.
pullrequest overview: remove custom handling of 'my pullrequests'
Re-use the same displaying code for the 'my pullrequests' overview as for the repository pullrequests overview. Remove the now unused CSS styling as well.
This removes the 'delete' button on the author's pullrequests. One could argue whether the pullrequest overview is the right place for this button, while it does not appear on the pull request page itself.
pullrequest overview: add delete button to own pull requests
In anticipation of the re-use of the pullrequest overview to display 'my pullrequests', add a delete button to all pullrequests owned by the currently logged-in user. An explicit width is added to the column because the column is otherwise unnecessarily large.
style: add class 'normal-indent' instead of repeated explicit margins
Add a new CSS class for the standard indentation inside the main box, instead of repeating 'style="..."' statements on the relevant elements.
Ideally, this class should not exist as the necessary padding would be added to the main box itself, but reworking this is a bigger exercise (to be done later).
pullrequest overview: display in table to improve readability
Instead of showing all info in the pullrequest overview right after each other on the same line, use a table to improve readability.
Additionally, add following information: - author - destination repository
The latter is always the same when viewing the list of pullrequests of a certain repository, but this change already anticipates re-use of this block in the 'my pullrequests' overview.
The table is still static, non-sortable, since YUI is deprecated and no new alternative has been decided upon yet. This improvement can be done later.
date representation: use ISO8601 rather than a specific locale
Dates, in particular in technical systems like Kallithea, are better shown in a clear concise format like ISO8601 (YYYY-MM-DD) than in a verbose format like 'Thu, Feb 26 2015'.
This commit changes all dates to ISO8601.
--- If desired, we could create two functions: one that returns ISO format and another for the locale format. Depending on the usage, one or the other is shown. I'm not very fond of that though, it looks inconsistent.
my pullrequests: line up controller/template handling with repo pullrequests
Currently, the data for 'my pullrequests' is loaded dynamically through ajax, unlike the way 'repository pullrequests' are loaded (statically).
As there is no good reason to have both treated differently, and as dynamic loading of 'my pullrequests' is not really needed, rework the handling of the 'my pullrequests' page with the 'repository pullrequests' page.
This includes lining up the 'show closed pull requests' checkbox/link.
This also fixes issue #102 ('my pull requests' when not logged in: incorrect handling of login).
controllers: don't pass rendered templates in context variables
Some controllers used the followifng pattern: - render a data template into a context variable - for partial (ajax) requests, return the contents of this variable - for full-page requests, render the full page, which expands the value of the context variable
Instead, avoid context variables let the controller simply render the full or partial page, and let the full page template include the partial page.
Remove this context variable for templating and use render exclusively. From templates, use %include instead of context variables.
pullrequests on different repos: default to same destination/source branch
When a pull request is initiated between two different repositories, instead of using the current tip as destination branch, use the same branch as on the source repository.
repository summary: avoid table bleed on long commit messages
For commit messages with the first line being very long, the 'latest changes' table on the repository overview page can 'bleed', so that the commit number overlaps with the commit status.
Commit 15cb8156b10d732cf39b37a88c656894621c0f54 changed the initial truncate on 50 characters to a chop at the first newline characters, causing this issue to pop up more frequently.
Instead of using floating divs for the commit status and number of comments, use dedicated table columns, as compact as possible. Additionally, move these new columns to the very left of the table, instead of cramming them in between the revision and commit message.
The comments-container class gets a new attribute 'white-space: nowrap' to avoid the comment icon to wrap from the number of comments, when the table does wrap on a small screen. Note that the icon currently does not display as it should be renamed from icon-comment-alt/colored to icon-comment. This will be fixed by Sean Farley.
changelog: fix display artifacts in expanded multi-line commit messages
When a multi-line commit message is expanded in a changelog, and the last line of the commit message has some characters that go below the baseline, like an underscore, g, j, y, ... the bottom part of these characters would not be shown.
This is caused by the 'overflow: hidden' property set on the unexpanded message. Reset that property by adding 'overflow: initial' on the expanded class.
Additionally, slightly enlarge the margin of the expanded message box.
The inline 'style' attribute was modified to remove the color but nothing else, as was discussed with other Kallithea devs, since it makes more sense to leave the spacing until another pass of css refactoring.
A quick search revealed that some old css code was never used, so it was removed.
repository 'latest changes': only show first line of commit message
Instead of truncating the commit message at a fixed number of characters, behave like standard version control commands (e.g. hg log) and only show the first line of the commit message in an overview.
pull requests commit overview: respect newlines and indentation (Issue #79)
Before this commit, commit messages in the pull request commit overview would be handled like any other text in HTML, with newlines and multiple whitespace being irrelevant.
Remove an overrule in the CSS so that the 'white-space' property remains at 'pre-wrap', causing newlines and indentation in commit messages are properly respected in this overview. As a positive effect, only the first line of the commit message is shown by default, just like in standard version control commands like 'hg log'.
ec39e73be935 introduced a regression in the cases where templates contained (javascript) snippets outside defined areas. Before, they were included anyway. After, they were not.
Fixing by moving the chunks I could find inside the main def.
remotes: add support to clone from Mercurial repositories over ssh
This commit adds support to clone a remote Mercurial repository over ssh.
Interactive password authentication is not implemented, nor is support for pbulic key authentication with passphrases; the repository should be accessible using bare ssh key authentication. For this reason, the ssh options -oBatchMode=yes and -oIdentitiesOnly=yes are added to the ui.ssh setting of Mercurial.
comment handling: extend next/previous links to global comments (issue #91)
Until now, only inline comments were linked to each other with next/previous links.
This commit extends this mechanism to global comments, such that the last inline comment has a next link to the first global comment, which has a next link to the next global comment (and the other way around for previous links).
In order to work well, instead of hiding inline comments that have been moved, they actually have to be deleted.
Avoid duplicating the logic to show the number of comments in three templates (pull request, changeset, changeset comment area) by placing it in a function.
In tests: - take into account new line wrapping - remove pointless %s substitution for fixed values
Lazy joins will in some cases turn small selects into joins that returns huge amounts of redundant data - increasingly bad as the repo size increases.
Lazy joins should only be used after careful analysis and with comments explaining the case.
This change will make some operations faster and probably also make some operations slower. Performance regressions would have to be analyzed and addressed separately ... and differently.
docs: update Windows installation documentation for Windows 7/Server 2008 R2 and newer
Update to the Windows installation documentation following my setup experience on our production server.
Changes :
* Use of Microsoft Visual C++ Compiler for Python 2.7 which simplifies matter versus installing Visual Studio 2008 Express, because it removes the need to use the Visual Studio 2008 command prompt. It is also a lot smaller to download and install. Unfortunately, this means the instruction will only work on the same platforms as those which are supported by the compiler. * For that reason, I split the documentation into newer and older Windows. * Added more explanations where I feel it was necessary based on my experience * Added explanation on Git (Warning : I did not try this part) * Instructions assumes x64 instead of Win32. * Clarified titles * Grammar
Potential issues:
* I have the user install pip system wide so that virtualenv installation is easier (especially if using Python 2.7.9 which already includes pip). One may prefer to install virtualenv and the pip in the virtual environment (I know of no good reason, but it could happen). * Removed some line feeds that I found useless. I do not know the .rst format, they might be needed. It makes no difference when the documentation is generated using make.bat, so I am not sure
Potential improvements:
* Instructions on using srvany.exe to install as a Windows service * Instructions to make a reverse proxy using Apache * Instructions to make a reverse proxy using IIS