|
|
Mads Kiilerich
|
19d93bd709bf
|
6 years ago
|
|
html: put 'use strict' on separate lines
use.py: import re import sys for fn in sys.argv[1:]: with open(fn) as f: s = f.read() s = re.sub(r'''(<script>)('use strict';)\n( *)''', r'''\1\n\3\2\n\3''', s) with open(fn, 'w') as f: f.write(s)
python use.py $(hg loc 'kallithea/templates/**.html')
|
|
|
Mads Kiilerich
|
fb9550946c26
|
6 years ago
|
|
js: use strict ... and fix the problems it points out
"use strict" gives stricter checks, both statically and at runtime. The strictness tightens up the code and prevents some kinds of problems.
The <script> tag addition might not be pretty, but has consistently been added with:
sed -i 's,<script>$,&'"'"'use strict'"'"';,g' `hg loc '*.html'`
|
|
|
Mads Kiilerich
|
e35373106528
|
6 years ago
|
|
py3: remove safe_unicode in places where it no longer is needed because all strings (except bytes) already *are* unicode strings
(The remaining safe_unicode calls are still needed and can't just be removed, generally because we in these cases still have to convert from bytes to unicode strings.)
|
|
|
Mads Kiilerich
|
756e46bd926b
|
6 years ago
|
|
py3: trivial renaming of .iteritems() to .items()
A bit like "2to3 -f dict", but we don't want list().
|
|
|
Thomas De Schampheleire
|
d426fe131196
|
6 years ago
|
|
|
|
|
Mads Kiilerich
|
6188d37b9d72
|
7 years ago
|
|
style: adjust vertical spacing inside comment chunks
Use less spacing after comment panels inside comment sections (10px from @kallithea-panel-margin instead of 20px) to hint that the comments are related ... and also to avoid using too much vertical space.
Also show Comment/Cancel buttoms closer to the comment form ("well") they are related to.
|
|
|
Mads Kiilerich
|
e795ad3c7d51
|
7 years ago
|
|
|
|
|
Mads Kiilerich
|
353c5dcf9aa8
|
7 years ago
|
|
|
|
|
Mads Kiilerich
|
f78aa989c9ff
|
7 years ago
|
|
|
|
|
domruf
|
a3a2dc51f0d6
|
9 years ago
|
|
pullrequest: avoid unnecessary text
Less text is easier/fast to read.
|
|
|
domruf
|
04a41e0361d6
|
9 years ago
|
|
|
|
|
Andrew Shadura
|
2e72d2d16a0f
|
8 years ago
|
|
comments: display comment previews while submitting
Instead of just saying 'Submitting' and not showing any progress to the user until the comment has been accepted by the server, show a preview of the comment above the comment box in a way which is makes it obvious to the user the comment is being submitted. Apart from that, also clear the comment box so that a repeated clicking the submit button doesn't result in a duplicate comment.
The preview doesn't highlight URLs or support @mentions or *bold*, which is a good enough approximation in this case. When/if we (re-)add the rST/Markdown support, we will need a client-side parser for the syntax we choose.
When the submission fails, display a message and offer the user to retry or cancel the submission.
|
|
|
domruf
|
3fca87aa2b15
|
8 years ago
|
|
templates: don't use ordinary elements as links or buttons by adding btn styling
Bootstrap recommends using <button>, so most of the time we should use that.
Extracted by Mads Kiilerich.
|
|
|
Mads Kiilerich
|
e4d2fec64955
|
8 years ago
|
|
autocompletion: drop explicit container elements - just create them when necessary
The previous wide styling of the @mention selection list didn't look pretty - just use the default width.
Inspired by select2 port by Dominik Ruf.
|
|
|
domruf
|
0d5be2668d7d
|
9 years ago
|
|
changeset: use Bootstrap panel for comments
Patch modified by Mads Kiilerich.
|
|
|
Mads Kiilerich
|
365708e66383
|
8 years ago
|
|
style: drop some unnecessary direct styling af gravatar
"files_history_box" is triggered from "Show Authors" on a file.
|
|
|
Mads Kiilerich
|
0e059e964671
|
8 years ago
|
|
comments: make "Submitting" hidden in the template
It is semantic - don't rely on CSS for this.
|
|
|
Mads Kiilerich
|
a181d4bd4c3d
|
8 years ago
|
|
style: rework review status icon handling
The styling had a reference to a '.container .changeset-status-ico' which might collide with use of the Bootstrap 'container' class.
Investigation of that lead to complete removal of all changeset-status-ico and changeset-status-container, plus related simplification of templates.
|
|
|
Mads Kiilerich
|
88ce09daea37
|
8 years ago
|
|
|
|
|
Mads Kiilerich
|
9d34bea3059d
|
8 years ago
|
|
|
|
|
Søren Løvborg
|
a17c8e5f6712
|
9 years ago
|
|
auth: simplify repository permission checks
In practice, Kallithea has the 'repository.admin' permission imply the 'repository.write' permission, which again implies 'repository.read'.
This codifies/enforces this practice by replacing HasRepoPermissionAny "perm function" with the new HasRepositoryLevel function, reducing the risk of errors and saving quite a lot of typing.
|
|
|
Søren Løvborg
|
588c556aa00b
|
9 years ago
|
|
comments: for PR comments, link directly to comment on PR page
Comments with approval changes made in the context of PRs also show up on the individual PR changesets, and currently link to the (top of the) PR page. If the user wants to see the surrounding comments, it can be difficult to find the comment.
This change makes the link go to the comment anchor on the PR page, so the user immediately sees the relevant comment thread. The PR metadata is still readily available (by scrolling up or pressing "Home").
|
|
|
Mads Kiilerich
|
3dcf1f82311a
|
9 years ago
|
|
controllers: avoid setting request state in controller instances - set it in the thread global request variable
In TurboGears, controllers are singletons and we should avoid using instance variables for any volatile data. Instead, use the "global thread local" request context.
With everything in request, some use of c is dropped.
Note: kallithea/controllers/api/__init__.py still use instance variables that will cause problems with TurboGears.
|
|
|
domruf
|
94a9ce213964
|
9 years ago
|
|
|
|
|
Mads Kiilerich
|
a955c3b26d31
|
9 years ago
|
|
|
|
|
Mads Kiilerich
|
e102408574e9
|
9 years ago
|
|
|
|
|
Mads Kiilerich
|
a79e651306e2
|
9 years ago
|
|
style: add missing 'form-control' markup
Based on work by Dominik Ruf.
|
|
|
Mads Kiilerich
|
880fe0697cd2
|
9 years ago
|
|
style: introduce radio-inline / checkbox-inline for status votes - preparing for Bootstrap but so far not used
Based on work by Dominik Ruf.
|
|
|
Mads Kiilerich
|
72b234ec4ff4
|
9 years ago
|
|
style: introduce well markup - preparing for Bootstrap but so far not used
Based on work by Dominik Ruf.
|
|
|
Mads Kiilerich
|
a810db90098e
|
9 years ago
|
|
style: use Bootstrap compatible "text-muted" class
Based on work by Dominik Ruf.
|
|
|
Mads Kiilerich
|
c40e567e4b82
|
9 years ago
|
|
style: use Bootstrap compatible data-toggle="tooltip" markup
Based on work by Dominik Ruf and Andrew Shadura.
|
|
|
Mads Kiilerich
|
6f4f39b21302
|
9 years ago
|
|
|
|
|
Mads Kiilerich
|
68d3315c48d4
|
9 years ago
|
|
|
|
|
domruf
|
b7654d1675da
|
9 years ago
|
|
style: in preparation for bootstrap, use bootstrap compatible button class names
Give all buttons a styling (default, success, danger, warning) and rename the sizes to sm and xs.
This is a subset of a bigger changeset. The subset was extracted by Mads Kiilerich, mostly by:
sed -i \ -e 's,btn btn-small,btn btn-default btn-sm,g' \ -e 's,btn btn-mini,btn btn-default btn-xs,g' \ -e 's,btn-default btn-\(xs\|sm\) btn-\(success\|danger\|warning\),btn-\2 btn-\1,g' \ -e 's,class_="btn",class_="btn btn-default",g' \ `hg mani`
|
|
|
Søren Løvborg
|
e99a33d7d7f5
|
9 years ago
|
|
cleanup: use obj.foo_id instead of obj.foo.foo_id
Don't use constructs like obj.user.user_id when obj.user_id works equally well (and potentially saves a database load).
|
|
|
Mads Kiilerich
|
f287754980cc
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
b4b57beb4928
|
10 years ago
|
|
comments: limit comment deletion to a 5 minutes grace period
It is really a bad idea to delete a comment after the content and references to it has been sent in mails.
Ultimately, comments should be editable and versioned - "delete" should then just hide the comment.
Note: this is just done at the UI level - not verified on the server
|
|
|
Mads Kiilerich
|
779d43be59c6
|
10 years ago
|
|
pullrequests: make it possible to delete pull requests instead of commenting
Deleting a pull request might however be a bad idea - the reviews on the PR will be lost.
|
|
|
Mads Kiilerich
|
2ed9ddab042f
|
10 years ago
|
|
comments: fix class of inline comments without context
Not really relevant yet(?) but needed for future annotate support.
|
|
|
Mads Kiilerich
|
7834f845505a
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
12e7421e0469
|
10 years ago
|
|
comments: avoid js string formatting of html template from DOM - avoid insecure naming
Multiple inline comment forms were only distinguished by the line number - not by the filename.
Instead, just keep it simple and avoid trying to assign "globally" unique names and use jQuery instead.
|
|
|
Mads Kiilerich
|
872d05f3d7cc
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
4a9184804089
|
11 years ago
|
|
comments: linkify revision hashes and issue tracker references
This was hard with RST markup - much easier to do reasonably safely in plain text.
|
|
|
Mads Kiilerich
|
b60e58094fb7
|
10 years ago
|
|
comments: change comment formatting to plain text instead of rst
There might be value in enabling rich markup (especially if it is markdown instead of rst) ... or it might be a waste of time. We might revisit that later.
But either way: Changing to plain text makes it more feasible to do markup of hashes and issues - for now that is more important than rtf.
|
|
|
Søren Løvborg
|
b537babcf966
|
10 years ago
|
|
login: include query parameters in came_from
The login controller uses the came_from query argument to determine the page to continue to after login.
Previously, came_from specified only the URL path (obtained using h.url.current), and any URL query parameters were passed along as separate (additional) URL query parameters; to obtain the final redirect target, h.url was used to combine came_from with the request.GET.
As of this changeset, came_from specifies both the URL path and query string (obtained using request.path_qs), which means that came_from can be used directly as the redirect target (as always, WebOb handles the task of expanding the server relative path to a fully qualified URL). The mangling of request.GET can also be removed.
The login code appended arbitrary, user-supplied query parameters to URLs by calling the Routes URLGenerator (h.url) with user-supplied keyword arguments. This construct is unfortunate, since url only appends _unknown_ keyword arguments as query parameters, and the parameter names could overlap with known keyword arguments, possibly affecting the generated URL in various ways. This changeset removes this usage from the login code, but other instances remain.
(In practice, the damage is apparently limited to causing an Internal Server Error when going to e.g. "/_admin/login?host=foo", since WebOb returns Unicode strings and URLGenerator only allows byte strings for these keyword arguments.)
|
|
|
Mads Kiilerich
|
68011c4e6f33
|
10 years ago
|
|
pull requests: call it 'owner' instead of 'author'
Prepare for making it possible to transfer ownership of PRs.
|
|
|
Mads Kiilerich
|
8c38b8a5a1ac
|
10 years ago
|
|
comments: move spacing around status radio buttons to css
Convenient when we add more radio buttons.
|
|
|
Mads Kiilerich
|
5cc8e1d7ee21
|
10 years ago
|
|
comments: fix warning when unloading page with unsaved comments e87baa8f1c5b broke the existing check. Instead, only set the comment-inline-form class when it actually is an inline form and use that class for finding comments.
|
|
|
Mads Kiilerich
|
2fa786ba2b2a
|
10 years ago
|
|
js: refactor AutoComplete functions to pass jQuery results around until DOM elements are passed to YUI
A small step forward that enables other refactorings.
|
|
|
Mads Kiilerich
|
e87baa8f1c5b
|
10 years ago
|
|
comments: rework/rewrite javascript for inline comment handling
There shouldn't be any functional changes here, but the focus has been on doing the right thing instead of looking at how it was before.
Incremental cleanup did not seem feasible. I think this is more readable and maintainable than before ... at least for me.
Existing snippets has been reused when reimplementing. The new implementation focus on being as simple as possible and well-structured. jQuery and data attributes are used instead of custom implementations. Some existing functions have been modified or renamed, others have been removed when they no longer were needed.
|
|
|
Thomas De Schampheleire
|
18fc1888455f
|
10 years ago
|
|
user: rename property username_and_name into full_name_and_username
In analogy of existing properties full_name and full_name_or_username, rename username_and_name into full_name_and_username.
|
|
|
Mads Kiilerich
|
765fe407eda4
|
11 years ago
|
|
comments: refactor the DOM handling for previous/next comment links
Make it more clear which div the links are put into and set the whole content of that div instead of appending. This prepares for repeatedly re-linking the comments when new comments or comment forms are inserted in the text.
|
|
|
Mads Kiilerich
|
b3299a079fa6
|
10 years ago
|
|
|
|
|
Mads Kiilerich
|
f9a581561184
|
11 years ago
|
|
comments: inline pointless inline template function
It was badly named and required an explanation, it wasn't a function, it was short, and it didn't really add much abstraction.
|
|
|
Mads Kiilerich
|
5153c491a964
|
11 years ago
|
|
comments: show status changes as a part of the comment instead of in the header
This makes it obvious what the user said and there is no reason to explain what he is saying or where he is saying it.
Comments will always have a text or a status change - there is no need for "No comments".
|
|
|
Mads Kiilerich
|
293066605a43
|
11 years ago
|
|
comment: replace floating status with span
Simpler ...
Similar clean-ups could be done in a lot of places - this is just something I "needed" for the next change.
|
|
|
Mads Kiilerich
|
26cbd84f0493
|
11 years ago
|
|
|
|
|
Thomas De Schampheleire
|
140f2811fc6f
|
11 years ago
|
|
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.
|
|
|
Mads Kiilerich
|
58e4670c7902
|
11 years ago
|
|
|
|
|
Thomas De Schampheleire
|
30c6d2ebf310
|
11 years ago
|
|
comments: display username and name instead of only username
The full name is more significant to many people than a username.
|
|
|
Andrew Shadura
|
ab47e5e9ad77
|
11 years ago
|
|
|
|
|
Thomas De Schampheleire
|
468073f2ebd6
|
11 years ago
|
|
pullrequests: allow closing only by author and admin
A pullrequest should not be closable by any reviewer, especially not since there is no reopening feature.
The check on change_status is no longer necessary, as the new permission check is more restrictive.
|
|
|
Jan Heylen
|
a0443f20a5ec
|
11 years ago
|
|
|
|
|
Thomas De Schampheleire
|
051624cb5f3a
|
11 years ago
|
|
comment handling: clarify shown comment count (inline vs general)
Instead of showing the number of comments as: y comments (z inline) show it as: x comments (z inline, y general)
|
|
|
Thomas De Schampheleire
|
0ee5a36aaa99
|
11 years ago
|
|
comment handling: factorize comment count logic
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
|
|
|
Jan Heylen
|
749b5e8cead3
|
11 years ago
|
|
|
|
|
Sean Farley
|
83087ae63bd6
|
11 years ago
|
|
|
|
|
Takumi IINO
|
265032dfbd76
|
11 years ago
|
|
|
|
|
Sean Farley
|
40f65bfc04d0
|
11 years ago
|
|
|
|
|
Takumi IINO
|
a0e39c81efc1
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
dc097413bf1d
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
e30401bac6e1
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
e271a8766951
|
11 years ago
|
|
javascript: replace YUE.onDOMReady with $(document).ready
Different execution order of YUE.onDOMReady and $(document).ready makes it hard to do gradually.
|
|
|
Mads Kiilerich
|
a21668fe545b
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
348ecbd25577
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
068ca0afcf9f
|
11 years ago
|
|
pull requests: allow closing of PRs in all states - undo #677
There can be reasons to close a PR without approving or rejecting it - especially when approving or rejecting a PR overwrites the "review status" of all changesets in it.
If some code for some reason is interested in PRs that has been closed as approved or rejected then that is what they should look for ... even though that is very hard with the current data model.
|
|
|
Mads Kiilerich
|
c666a68e2a4d
|
11 years ago
|
|
|
|
|
Mads Kiilerich
|
eac6c70e63e8
|
12 years ago
|
|
|
|
|
Mads Kiilerich
|
93e5683e3d2e
|
11 years ago
|
|
comments: introduce javascript confirm prompt for deleting comments - it was too easy
(Arguably it shouldn't be possible to delete comments at all ...)
|
|
|
Mads Kiilerich
|
afbd43437237
|
12 years ago
|
|
|
|
|
Mads Kiilerich
|
1721c30d9cbe
|
12 years ago
|
|
|
|
|
Mads Kiilerich
|
bf011c9f7f58
|
12 years ago
|
|
|
|
|
Mads Kiilerich
|
672f9d36a269
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
ef60ae4a34ee
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
24c0d584ba86
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
d208416c84c6
|
11 years ago
|
|
|
|
|
Bradley M. Kuhn
|
d1addaf7a91e
|
11 years ago
|
|
Second step in two-part process to rename directories. This is the actual directory rename.
|