summaryrefslogtreecommitdiffstats
path: root/web_src/js
Commit message (Collapse)AuthorAgeFilesLines
* Improve async/await usage, and sort init calls in `index.js` (#17386)wxiaoguang2021-11-0921-202/+214
| | | | * clean up async/await, and sort init calls in `index.js * use `const _promise` to indicate that we do not need await an async function
* Remove appSubUrl from pasted images (#17572)zeripath2021-11-081-3/+3
| | | | | | | | | | * Remove appSubUrl from pasted images Since we fixed the url base for the links in repositories we no longer need to add the appsuburl to pasted image links. Fix #17057 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move key forms before list and add cancel button (#17432)qwerty2872021-10-281-1/+2
| | | | | | | * Move GPG form before list and add cancel button * Move SSH form before list and add cancel button Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* make commit-statuses popup can be shown correctly. (#17447)wxiaoguang2021-10-281-1/+4
| | | | | | | | | | Close #17443 Maybe we do not need to backport this PR, the bug doesn't break daily usage. After the fix, the commit statuses popup can show a lot of lines with scroll bars: ![image](https://user-images.githubusercontent.com/2114189/139026160-f01b484c-6207-494a-a190-a6dd184ceb2b.png)
* Fix a UI error when folding a file content in a commit view (#17446)wxiaoguang2021-10-271-2/+1
|
* Show client-side error if wiki page is empty (#17415)David Jimenez2021-10-271-2/+20
| | | | | | | | | | | | | | | * fix: show client-side error if wiki page is empty Implement a JS, client-side validation workaround for a bug in the upstream editor library SimpleMDE which breaks HTML5 client-side validation when a wiki page is submitted. This allows native, client-side errors to appear if the text editor contents are empty. See upstream bugfix report: https://github.com/sparksuite/simplemde-markdown-editor/issues/324 Signed-off-by: David Jimenez <dvejmz@sgfault.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix issue content history problems, improve UI (#17404)wxiaoguang2021-10-231-2/+2
| | | | | * Improve: make diff result better, make the HTML element fit the full height in the content history diff dialog * Bug fix: when edit the main issue, the poster is wrongly set to the issue poster
* Fix context popup error (#17398)wxiaoguang2021-10-223-2/+29
| | | * Fix context popup error
* Fix the click behavior for <tr> and <td> with [data-href] (#17388)wxiaoguang2021-10-211-8/+13
|
* Frontend refactor, PascalCase to camelCase, remove unused code (#17365)wxiaoguang2021-10-2133-137/+137
| | | | | * Frontend refactor, PascalCase to camelCase, remove unused code * fix
* "Copy branch name" button in pull request (#17323)Mario Lubenka2021-10-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | * Drop data-original from clipboard data-original attribute was removed. Instead, the original value from data-content is set after success/fail message was displayed. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * "Copy branch name" button in pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update templates/repo/issue/view_title.tmpl Co-authored-by: silverwind <me@silverwind.io> * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net>
* Re-allow clipboard copy on non-https sites (#17118)Netduma Luke M2021-10-191-1/+32
| | | | * Re-allow clipboard copy on non-https sites * fallback clipboard functions
* Update JS dependencies (#17357)silverwind2021-10-192-2/+2
| | | | | | | | | | | | | * Update JS dependencies - Upgrade to eslint 8 and add new plugin rules - Adapt to various API changes - Rebuild SVGs * fix webpack warning on license * order options alphabetically Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix dashboard repolist alignment and repolisting (#17355)zeripath2021-10-191-0/+1
| | | | | | | | | | | | | | Unfortunately #17301 broke the restriction of the dashboard repolist to the user's repos because it stopped passing in the uid for the current user. This PR restores this. There is also a weird alignment problem - not caused by that PR - where the menu items in the repolist spread over multiple lines. This PR simply reduces the padding on these items and switches the justification of the flex elements to space-evenly. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix the PR review form bug during frontend refactor (#17332)wxiaoguang2021-10-161-1/+1
|
* Split `index.js` to separate files (#17315)wxiaoguang2021-10-1740-3494/+3686
| | | | | | | | | | | | | | | | | | * split `index.js` to separate files * tune clipboard * fix promise * fix document * remove intermediate empty file * fix async event listener * use `export function` instead of `export {}`, add more comments Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Add buttons to allow loading of incomplete diffs (#16829)zeripath2021-10-152-0/+26
| | | | | | | | | | | | | | | | | This PR adds two buttons to the stats and the end of the diffs list to load the (some of) the remaining incomplete diff sections. Contains #16775 Signed-off-by: Andrew Thornton <art27@cantab.net> ## Screenshots ### Show more button at the end of the diff ![Screenshot from 2021-09-04 11-12-37](https://user-images.githubusercontent.com/1824502/132091009-b1f6113e-2c04-4be5-8a04-b8ecea56887b.png) ### Show more button at the end of the diff stats box ![Screenshot from 2021-09-04 11-14-54](https://user-images.githubusercontent.com/1824502/132091063-86da5a6d-6628-4b82-bea9-3655cd9f40f6.png)
* Frontend refactor: move Vue related code from `index.js` to `components` ↵wxiaoguang2021-10-157-583/+629
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dir, and remove unused codes. (#17301) * frontend refactor * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> * Update templates/base/head.tmpl Co-authored-by: delvh <dev.lh@web.de> * Update docs/content/doc/developers/guidelines-frontend.md Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * fix typo * fix typo * refactor PageData to pageData * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> * Simply for the visual difference. Co-authored-by: delvh <dev.lh@web.de> * Revert "Apply suggestions from code review" This reverts commit 4d78ad9b0e96ca180e0823de17659a2e0814c099. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Show direct match on top for user search (#17303)Maximilian Weiler2021-10-151-2/+8
| | | | | | | | | This PR makes sure that direct matches in the user search always show on top of the result list. The following places were checked to follow the desired behavior now: - Search when adding a user to a team - Search when adding a user as a collaborator to a repository Signed-off-by: Maximilian Weiler <16721506+maweil@users.noreply.github.com>
* Add user status filter to admin user management page (#16770)wxiaoguang2021-10-122-0/+34
| | | | | | | | | | | | | | | | | | | | It makes Admin's life easier to filter users by various status. * introduce window.config.PageData to pass template data to javascript module and small refactor move legacy window.ActivityTopAuthors to window.config.PageData.ActivityTopAuthors make HTML structure more IDE-friendly in footer.tmpl and head.tmpl remove incorrect <style class="list-search-style"></style> in head.tmpl use log.Error instead of log.Critical in admin user search * use LEFT JOIN instead of SubQuery when admin filters users by 2fa. revert non-en locale. * use OptionalBool instead of status map * refactor SearchUserOptions.toConds to SearchUserOptions.toSearchQueryBase * add unit test for user search * only allow admin to use filters to search users
* Save and view issue/comment content history (#16909)wxiaoguang2021-10-103-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * issue content history * Use timeutil.TimeStampNow() for content history time instead of issue/comment.UpdatedUnix (which are not updated in time) * i18n for frontend * refactor * clean up * fix refactor * re-format * temp refactor * follow db refactor * rename IssueContentHistory to ContentHistory, remove empty model tags * fix html * use avatar refactor to generate avatar url * add unit test, keep at most 20 history revisions. * re-format * syntax nit * Add issue content history table * Update models/migrations/v197.go Co-authored-by: 6543 <6543@obermui.de> * fix merge Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* Move add deploy key form before the list and add a cancel button (#17228)qwerty2872021-10-081-0/+3
|
* Defer Last Commit Info (#16467)zeripath2021-10-082-0/+42
| | | | | | | | | | | One of the biggest reasons for slow repository browsing is that we wait until last commit information has been generated for all files in the repository. This PR proposes deferring this generation to a new POST endpoint that does the look up outside of the main page request. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Reference in new issue modal: dont pre-populate issue title (#17208)Norwin2021-10-021-2/+0
| | | | | * dont prepopulate issue title * cleanup
* Add option to copy line permalink (#17145)qwerty2872021-10-021-26/+25
| | | | | | | | | | | * Add option to copy line permalink * Fix lint * Apply review suggestions * Update code and fix lint * Use features/clipboard.js framework
* Kanban colored boards (#16647)Romain2021-09-292-10/+62
| | | Add a column Color in ProjectBoard and color picker in new / edit project board form.
* Use light/dark theme based on system preference (#17051)Gwyneth Morgan2021-09-271-1/+7
| | | | | | | | Add a new default theme `auto`, which will automatically switch between `gitea` (light) and `arc-green` (dark) themes depending on the user's operating system settings. Closes: #8183
* Fixed issue where creating a reference of an issue would create a tag with ↵Jelle Hulter2021-09-181-1/+1
| | | | | | | | the full name instead of the username if this is the default in the .ini file (#17074) Adds an extra attribute to every issue comment containing the actual username, such that it can be used to tag the original author when clicking on "Reference in new issue" (#17073) Fix #17073
* Do not show issue context popup on external issues (#17050)zeripath2021-09-151-0/+3
| | | | | | | | | The issues pop-up context cannot work for external issues - therefore do not show these. Fix #17047 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use git attributes to determine generated and vendored status for language ↵zeripath2021-09-091-1/+2
| | | | | | | | | | | | | | | | stats and diffs (#16773) Replaces #16262 Replaces #16250 Replaces #14833 This PR first implements a `git check-attr` pipe reader - using `git check-attr --stdin -z --cached` - taking account of the change in the output format in git 1.8.5 and creates a helper function to read a tree into a temporary index file for that pipe reader. It then wires this in to the language stats helper and into the git diff generation. Files which are marked generated will be folded by default. Fixes #14786 Fixes #12653
* Fix wrong attachment removal (#16915)wxiaoguang2021-09-011-20/+11
|
* Add option to update pull request by `rebase` (#16125)a10121127962021-08-311-0/+30
| | | | | * add option to update pull request by `rebase` Signed-off-by: a1012112796 <1012112796@qq.com>
* Add modals to Organization and Team remove/leave (#16471)zeripath2021-08-261-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | * Add modals to Organization and Team remove/leave Add confirmation modals to Organization and Team remove and leave. Fix #16215 Signed-off-by: Andrew Thornton <art27@cantab.net> * avoid for-in Signed-off-by: Andrew Thornton <art27@cantab.net> * Revert "avoid for-in" This reverts commit 2af9a6f9d46ed31b6fc6e3a29e695577dcf09f75. * Apply suggestions from code review Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Actually compute proper foreground color for labels (#16729)Clar Fon2021-08-251-7/+22
|
* Keep attachments on tasklist update (#16750)KN4CK3R2021-08-201-1/+2
| | | | | | | | | | | * Send attachments too. * Use tasklist flag. * use action="ignoreAttachments" instead of "tasklist" * Use boolean parameter. Co-authored-by: zeripath <art27@cantab.net>
* Update JS dependencies (#16708)silverwind2021-08-174-7/+7
| | | | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies - Adapt to recent webpack changes - Add new lint rules and fix issues - Regenerate SVGs and update svgo api usage Fixes: https://github.com/go-gitea/gitea/pull/16492 * adapt jest config and sort keys Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Improve SMTP authentication and Fix user creation bugs (#16612)zeripath2021-08-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improve SMTP authentication, Fix user creation bugs and add LDAP cert/key options This PR has two parts: Improvements for SMTP authentication: * Default to use SMTPS if port is 465, and allow setting of force SMTPS. * Always use STARTTLS if available * Provide CRAM-MD5 mechanism * Add options for HELO hostname disabling * Add options for providing certificates and keys * Handle application specific password response as a failed user login instead of as a 500. Close #16104 Fix creation of new users: * A bug was introduced when allowing users to change usernames which prevents the creation of external users. * The LoginSource refactor also broke this page. Close #16104 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add microsoft oauth2 providers (#16544)zeripath2021-08-051-32/+15
| | | | | | | | | | | | | | | | | * Clean up oauth2 providers Signed-off-by: Andrew Thornton <art27@cantab.net> * Add AzureAD, AzureADv2, MicrosoftOnline OAuth2 providers Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review * remove unused Scopes Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Restore Accessibility for Dropdown (#16576)zeripath2021-08-061-0/+4338
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Restore #10096/#8638 and re-fix #15172 This PR restores the vendored and patched dropdow from #8638. It however, abandons the calls to `click()` using instead the default dropdown click calls instead. This prevents the issue of the dropdown grabbing focus permanently however, this may have negative effects on the effect of focus on the dropdowns. Of note, the behaviour of the template selector dropdown on the repo creation page is slightly odd - I don't believe that this odd behaviour is caused by this PR but rather by the feed source for this. I suspect that the dropdown should be adding a delete button to its selection. Fix #15172 References: #7057 Signed-off-by: Andrew Thornton <art27@cantab.net> * leverage fomantic-build instead Signed-off-by: Andrew Thornton <art27@cantab.net> * as per jookia Signed-off-by: Andrew Thornton <art27@cantab.net>
* Pre-fill suggested New File 'name' and 'content' with Query Params (#16556)AJ ONeal2021-07-291-1/+9
| | | | | * feature: add (GitHub-style) querystrings for pre-filling new file content * docs: add query parameters for new files
* Make Mermaid.js limit configurable (#16519)zeripath2021-07-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | * Make Mermaid.js limit configurable Add `MERMAID_MAX_SOURCE_CHARACTERS` to `[markup]` settings to make the maximum size of a mermaid render configurable. Fix #16513 Signed-off-by: Andrew Thornton <art27@cantab.net> * fixup! Make Mermaid.js limit configurable * Update custom/conf/app.example.ini Co-authored-by: silverwind <me@silverwind.io> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update notification table with only latest data (#16445)zeripath2021-07-171-4/+12
| | | | | | | | | | When marking notifications read the results may be returned out of order or be delayed. This PR sends a sequence number to gitea so that the browser can ensure that only the results of the latest notification change are shown. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Load issue/PR context popup data only when needed (#15955)Lauris BH2021-07-133-55/+152
| | | | | | | * Load issue/PR context popup data only when needed * Add SVG icon Vue component * Remove unneeded check
* fix calculation for finalPage in repo-search component (#16382)65432021-07-131-1/+1
| | | Co-authored-by: Jan Naahs <jan.naahs@naahstea.de>
* Fix various documentation, user-facing, and source comment typos (#16367)luzpaz2021-07-081-2/+2
| | | | | * Fix various doc, user-facing, and source comment typos Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby`
* Fix U2F error reasons always hidden (#16327)Stephen Holdaway2021-07-031-1/+1
| | | | | | | | | This strict equality check in `u2fError` was causing the error description to hide immediately after showing. `Object.keys` always returns strings, but `errorType` argument is usually a number type. Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net>
* Wrap around for previous/next buttons (#16319)Jimmy Praet2021-07-021-10/+8
| | | | | | Fixes #16317 Wrap around from last to first comment when clicking "Next" on last comment. Wrap around from first to last comment when clicking "Previous" on first comment.
* Add custom emoji support (#16004)65432021-06-291-3/+4
|
* Link to previous blames in file blame page (#16259)Norwin2021-06-281-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a link to each blame hunk, to view the blame of an earlier version of the file, similar to GitHub. Also refactors the blame render from fmtstring based to template based. * Fix blame bottom line and add blame prior button * Jump to previous parent commit from the commit. * Fix previous commit link * Fix previous blame link * Fix the given file not exist in the previous commit. * Fix blameRow struct not export * fix theming issues, rename template var * remove unused LastCommit fetch * fix location of blame-hunk divider * rewrite previous commit checks * remove duplicate commit lookup its already resolved and stored in ctx.Repo.Commit! * split out blamePart processing into function Co-authored-by: rogerluo410 <rogerluo410@gmail.com>
* Add previous/next buttons to review comments (#16273)Jimmy Praet2021-06-271-0/+22
| | | | | | Co-authored-by: Norwin <noerw@users.noreply.github.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>