comments: fix permalink symbol appearance on hover
It broke when 293066605a43 did that the permalink a no longer was immediate child of a div. Instead, accept an intermediate span ... and thus make the hover target bigger.
middleware: apply HttpsFixup to Hg/Git operations too (Issue #132)
Fix regression from 6a0964373a30. 'Require SSL for vcs operations' might make the protocol operations depend on the protocol type reported by a proxy even though they don't generate URLs.
auth: return early in LoginRequired on API key validation
Simplify the logic in the LoginRequired decorator when Kallithea is accessed using an API key. Either: - the key is valid and API access is allowed for the accessed method (continue), or - the key is invalid (redirect to login page), or - the accessed method does not allow API access (403 Forbidden)
In none of these cases does it make sense to continue checking for user authentication, so return early.
Simplify the code of the LoginRequired decorator by returning early when an unacceptable condition is met.
Note: the 'return' of redirect_to_login() is not strictly needed since we should not return from that function (redirection occurs). Adding it, however, is a security measure in case redirect_to_login does not do what it should do.
notifications: use stupid mail static-except-[] subjects to please gmail and its broken threading
This gives reasonable threading, both with gmail and proper mail clients, at the cost of making the email subjects slightly obscure.
Gmail is clueless - also about mail threading, ignoring our References headers and the wisdom of jwz. Gmail will start a new thread for each subject. The only way to make all mails related to the same PR belong to the same thread is thus to let all mails for a PR have the same subject. Gmail will however ignore content in square brackets at the beginning of the subject so we can put the interesting parts there.
* display the ellipsis just once and centered instead of showing in twice in both - and + columns * expand column width as needed to accomodate longer numbers (previously, the column width was fixed) * enable box-sizing: border-box for the number links to make it easier to set paddings
rst: in @mention parser, escape spaces so they don't go to HTML
This eliminates extra spaces around @mentions. Every time mention was followed by a comma, for example:
@username, have you seen it?
it turned into:
@username , have you seen it?
So an extra space was inserted. It was inserted because otherwise rst parser might not recognise the markup (i.e. @user1,@user2 is replaced by **user1**,**user2** — that would be interpreted as <b>user1**,**user2</b>).
Currently, a pull request id is referenced as #5, and the '#' symbol is fixed and repeated in several places. This commit adds a class method make_nice_id, that returns a string reference to a pull request, currently in the form '#5'.
This function could be overridden by an organization if they need references in another form, for example PR-5.
The method nice_id uses this for the pullrequest's own id.
diff view: do not hide overflow on very long lines that cannot be wrapped
When a change contains very long lines that cannot be wrapped because they contain very long 'words' without spaces, the overflow is currently not visible at all. This occurrence of such very long non-wrappable words is pretty uncommon, but can for example happen in comma-separated value files.
Not touching the existing behavior of trying to wrap long lines, this patch adds horizontal scrollbars for these exceptional cases of unavoidable overflow. On normal lines and long lines that can be wrapped, the diff block remains the same as before.
permissions: by default, don't show entities with no access
There might be a lot of entities the user/group don't have access and it is much more important to be able to see at a glance what the user/group has to access to than what it doesn't have access to.
comments: avoid storing 'No comments' text when changing status
When a general comment (with or without status change) is added to a changeset or pull request, and no text was added, Kallithea automatically used 'No comments' as text. The stub text is added to the database as if it has been entered by the user and it can thus not easily be identified as an automatic comment.
This commit makes following changes: - allow adding an empty comment to the database when there is a status change. An empty comment without status change is ignored. - do not add a stub text to the database, but generate it on demand - the stub text is shown in italic font to differentiate it from user-entered text
Currently there is a large amount of duplication between controllers/changeset.py and controllers/pullrequests.py, which is to be cleaned up in a later commit.
This replaces d741b99effdf by adressing the root cause: 5c8c77b7ca56 removed the default exclude of .* (and thus also .eggs/ used by latest setuptools) and *.egg (used by older setuptools).
Fixes lots of failures with pytest by making sure base test classes don't inherit from unittest.TestCase or by prefacing name with an underscore so tests don't get executed by pytest.
Commit bd4f453a0055 fixed the pager links on pullrequest overviews, but broke the 'my pull requests' page due to insufficient testing and incomplete Python understanding.
Commit bd4f453a0055 fixed the pager links on pullrequest overviews, but broke the 'my pull requests' page due to insufficient testing and incomplete Python understanding.
changeset status: fix common case where a reviewer did not yet review anything
When a reviewer did not yet make any review, its status for the changeset is None, causing the code to crash. The unit tests also did not cover this case.
Commit 0f9a48e0adc3 refactored the pullrequest overview pages, but has a bug causing no more than 10 pull requests to be shown, without pager links. The code assumed that 'pager' was a variable, rather than a method, of the pullrequests structure.
fonts: update symbol codes to be closer to real Unicode
Let's use character codes closer to what Unicode defines, so if the custom font can't be used for some reason what user sees is still more or less readable.
changeset status: set status to rejected if at least one reviewer rejected
Currently, a reject of a change by a reviewer does not affect the overall status at all. A logical policy is to reject the change if at least one reviewer rejects it.
Note: different repositories/organizations may require different policies for the overall status. Currently, the policies for approve/reject are fixed. A possible improvement is to provide several alternative policies and allow selecting the policy per instance or per repo.