aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/index.js
Commit message (Collapse)AuthorAgeFilesLines
* Prettify number of issues (#17760)Gusted2022-06-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prettify number of issues - Use the PrettyNumber function to add commas in large amount of issues. * Use client-side formatting * prettify on both server and client * remove unused i18n entries * handle more cases, support other int types in PrettyNumber * specify locale to avoid issues with node default locale * remove superfluos argument * introduce template helper, octicon tweaks, js refactor * Update modules/templates/helper.go * Apply some suggestions. * Add comment * Update templates/user/dashboard/issues.tmpl Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Feature: Find files in repo (#15028)Roger Luo2022-06-091-0/+2
| | | | | | | | | | | | | | | | * Create finding files page ui in repo page * Get tree entries for find repo files. * Move find files JS to individual file. * gen swagger. * Add enry.IsVendor to exclude entries Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Allow to mark files in a PR as viewed (#19007)delvh2022-05-071-1/+2
| | | Users can now mark files in PRs as viewed, resulting in them not being shown again by default when they reopen the PR again.
* Add "Allow edits from maintainer" feature (#18002)qwerty2872022-04-281-0/+2
| | | | | | | | | | | | | | | | | Adds a feature [like GitHub has](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) (step 7). If you create a new PR from a forked repo, you can select (and change later, but only if you are the PR creator/poster) the "Allow edits from maintainers" option. Then users with write access to the base branch get more permissions on this branch: * use the update pull request button * push directly from the command line (`git push`) * edit/delete/upload files via web UI * use related API endpoints You can't merge PRs to this branch with this enabled, you'll need "full" code write permissions. This feature has a pretty big impact on the permission system. I might forgot changing some things or didn't find security vulnerabilities. In this case, please leave a review or comment on this PR. Closes #17728 Co-authored-by: 6543 <6543@obermui.de>
* Allow commit status popup on /pulls page (#19507)parnic2022-04-261-1/+7
| | | | | | | | | | | * Allow commit status popup on /pulls page The /pulls page doesn't contain a "repository" element, so the early-out here was preventing the commit status popup hook from working. However, the only thing the .repository element is being used for here is determining whether the popup should be on the right or on the left, so we don't actually need the element to exist for the hook to work. Pull request #19375 allows the statuses on /pulls pages to appear clickable, but this commit is required to make the popup actually work there. * Move commit statuses popup hook to dedicated func * Add missing import
* Show messages for users if the ROOT_URL is wrong, show JavaScript errors ↵wxiaoguang2022-03-301-2/+5
| | | | | | | | | | | | | | (#18971) * ROOT_URL issues: some users did wrong to there app.ini config, then: * The assets can not be loaded (AppSubUrl != "" and users try to access http://host:3000/) *The ROOT_URL is wrong, then many URLs in Gitea are broken. Now Gitea show enough information to users. * JavaScript error issues, there are many users affected by JavaScript errors, some are caused by frontend bugs, some are caused by broken customized templates. If these JS errors can be found at first time, then maintainers do not need to ask about how bug occurs again and again. * Some people like to modify the `head.tmpl`, so we separate the script part to `head_script.tmpl`, then it's much safer. * use specialized CSS class "js-global-error", end users still have a chance to hide error messages by customized CSS styles.
* Fix behavior or checkbox submission. (#18851)Gusted2022-02-221-0/+2
|
* Use explicit jQuery import, remove unused eslint globals (#18435)silverwind2022-01-281-0/+1
| | | | | - Don't rely on globals (window.$) for jQuery import - Remove eslint globals no longer in use
* Support webauthn (#17957)Lunny Xiao2022-01-141-3/+3
| | | | | | | Migrate from U2F to Webauthn Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve ellipsis buttons (#17773)silverwind2021-11-221-2/+2
| | | | | | | | | | | | * Improve ellipsis buttons - Remove icon font usage - Add aria-expanded attribute * rename function to match Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Improve async/await usage, and sort init calls in `index.js` (#17386)wxiaoguang2021-11-091-72/+75
| | | | * 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
* Split `index.js` to separate files (#17315)wxiaoguang2021-10-171-3449/+108
| | | | | | | | | | | | | | | | | | * 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-151-0/+2
| | | | | | | | | | | | | | | | | 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-151-556/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-121-0/+2
| | | | | | | | | | | | | | | | | | | | 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-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-081-0/+2
| | | | | | | | | | | 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-291-6/+15
| | | Add a column Color in ProjectBoard and color picker in new / edit project board form.
* 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
* 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>
* Update JS dependencies (#16708)silverwind2021-08-171-1/+1
| | | | | | | | | | | | | | * 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>
* 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
* 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.
* 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>
* Add scroll-margin-top to account for sticky header (#16269)Jimmy Praet2021-06-271-1/+1
| | | | | Fixes #16263 Co-authored-by: zeripath <art27@cantab.net>
* Add Status Updates whilst Gitea migrations are occurring (#15076)zeripath2021-06-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add migrating message Signed-off-by: Andrew Thornton <art27@cantab.net> * simplify messenger Signed-off-by: Andrew Thornton <art27@cantab.net> * make messenger an interface Signed-off-by: Andrew Thornton <art27@cantab.net> * rename Signed-off-by: Andrew Thornton <art27@cantab.net> * prepare for merge Signed-off-by: Andrew Thornton <art27@cantab.net> * as per tech Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix spelling (#16179)Jonathan Tran2021-06-161-3/+3
| | | Co-authored-by: Jonathan Tran <jon@allspice.io>
* Add attachments for PR reviews (#16075)KN4CK3R2021-06-141-28/+49
| | | | | | | | | | | | | * First step for multiple dropzones per page. * Allow attachments on review comments. * Lint. * Fixed accidental initialize of the review textarea. * Initialize SimpleMDE textarea. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* update ``.raw-content`` when edit issue/comment content (#16021)a10121127962021-05-311-0/+2
| | | | | | | | | | | * update ``.raw-content`` when edit issue/comment content fix #16000 Signed-off-by: a1012112796 <1012112796@qq.com> * handle empty content Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add links to toggle WIP status (#14677)Jimmy Praet2021-05-271-0/+11
| | | | | | | | | | * Add links to toggle PR WIP status * Allow PR author to toggle WIP status * refactors and restyling, remove links from translations Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>
* Add possibility to make branch in branch page (#15960)Viktor Yakovchuk2021-05-241-0/+5
| | | | | | | | | | | | | | | * Add possibility to make branch in branch page (#15911) Add possibility to make branch in branch page in the area next to Download and Delete buttons. It is a more intuitive place in the interface compared to what is already there. Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net> * Update templates/repo/branch/list.tmpl Co-authored-by: zeripath <art27@cantab.net>
* Make tasklist checkboxes clickable (#15791)KN4CK3R2021-05-231-6/+8
| | | | Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Remove fomantic accordion module (#15951)silverwind2021-05-231-1/+0
| | | | | | | Replace it with native <detail> element. Did some slight restyling on the release downloads, new behaviour should be exactly the same otherwise. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix and restyle menu on code line (#15913)silverwind2021-05-181-54/+4
| | | | | | | | | | | | | * Fix and restyle menu on code line * fix multiline and more tweaks * move to separate files * remove has-context-menu class Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Code comments improvements (#15722)silverwind2021-05-081-2/+2
| | | | | | | | | - Right-align the Reply and Resolve buttons - Center Resolved text and add some padding - Add padding to inline comments - Indent the comment content to align with author name - Re-parent form to allow better button layout space. Co-authored-by: zeripath <art27@cantab.net>
* Rename StaticUrlPrefix to AssetUrlPrefix (#15779)silverwind2021-05-081-2/+2
| | | | Use a new name for this template/frontend variable to make it distinct from the server variable StaticURLPrefix.
* Add selecting tags on the compare page (#15723)Jonathan Tran2021-05-071-1/+18
| | | | | | | | | | | * Add selecting tags on the compare page * Remove unused condition and change indentation * Fix tag tab in dropdown to be black * Add compare tag integration test Co-authored-by: Jonathan Tran <jon@allspice.io>