You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

457 lines
19 KiB

Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
6 years ago
  1. {{template "base/head" .}}
  2. <div class="repository settings options">
  3. {{template "repo/header" .}}
  4. {{template "repo/settings/navbar" .}}
  5. <div class="ui container">
  6. {{template "base/alert" .}}
  7. <h4 class="ui top attached header">
  8. {{.i18n.Tr "repo.settings.basic_settings"}}
  9. </h4>
  10. <div class="ui attached segment">
  11. <form class="ui form" action="{{.Link}}" method="post">
  12. {{.CsrfTokenHtml}}
  13. <input type="hidden" name="action" value="update">
  14. <div class="required field {{if .Err_RepoName}}error{{end}}">
  15. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  16. <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
  17. </div>
  18. {{if not .Repository.IsFork}}
  19. <div class="inline field">
  20. <label>{{.i18n.Tr "repo.visibility"}}</label>
  21. <div class="ui checkbox">
  22. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  23. <label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label>
  24. </div>
  25. </div>
  26. {{end}}
  27. <div class="field {{if .Err_Description}}error{{end}}">
  28. <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label>
  29. <textarea id="description" name="description" rows="2">{{.Repository.Description}}</textarea>
  30. </div>
  31. <div class="field {{if .Err_Website}}error{{end}}">
  32. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  33. <input id="website" name="website" type="url" value="{{.Repository.Website}}">
  34. </div>
  35. <div class="field">
  36. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  37. </div>
  38. </form>
  39. </div>
  40. {{if .Repository.IsMirror}}
  41. <h4 class="ui top attached header">
  42. {{.i18n.Tr "repo.settings.mirror_settings"}}
  43. </h4>
  44. <div class="ui attached segment">
  45. <form class="ui form" method="post">
  46. {{.CsrfTokenHtml}}
  47. <input type="hidden" name="action" value="mirror">
  48. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  49. <label>{{.i18n.Tr "repo.mirror_prune"}}</label>
  50. <div class="ui checkbox">
  51. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .MirrorEnablePrune}}checked{{end}}>
  52. <label>{{.i18n.Tr "repo.mirror_prune_desc"}}</label>
  53. </div>
  54. </div>
  55. <div class="inline field {{if .Err_Interval}}error{{end}}">
  56. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  57. <input id="interval" name="interval" value="{{.MirrorInterval}}">
  58. </div>
  59. <div class="field">
  60. <label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
  61. <input id="mirror_address" name="mirror_address" value="{{.Mirror.FullAddress}}" required>
  62. <p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
  63. </div>
  64. <div class="field">
  65. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  66. </div>
  67. </form>
  68. <div class="ui divider"></div>
  69. <form class="ui form" method="post">
  70. {{.CsrfTokenHtml}}
  71. <input type="hidden" name="action" value="mirror-sync">
  72. <div class="inline field">
  73. <label>{{.i18n.Tr "repo.mirror_last_synced"}}</label>
  74. <span>{{.Mirror.UpdatedUnix.AsTime}}</span>
  75. </div>
  76. <div class="field">
  77. <button class="ui blue button">{{$.i18n.Tr "repo.settings.sync_mirror"}}</button>
  78. </div>
  79. </form>
  80. </div>
  81. {{end}}
  82. <h4 class="ui top attached header">
  83. {{.i18n.Tr "repo.settings.advanced_settings"}}
  84. </h4>
  85. <div class="ui attached segment">
  86. <form class="ui form" method="post">
  87. {{.CsrfTokenHtml}}
  88. <input type="hidden" name="action" value="advanced">
  89. {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
  90. <div class="inline field">
  91. <label>{{.i18n.Tr "repo.wiki"}}</label>
  92. <div class="ui checkbox">
  93. <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
  94. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  95. </div>
  96. </div>
  97. <div class="field {{if not $isWikiEnabled}}disabled{{end}}" id="wiki_box">
  98. <div class="field">
  99. <div class="ui radio checkbox">
  100. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}checked{{end}}/>
  101. <label>{{.i18n.Tr "repo.settings.use_internal_wiki"}}</label>
  102. </div>
  103. </div>
  104. <div class="field">
  105. <div class="ui radio checkbox">
  106. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.UnitTypeExternalWiki}}checked{{end}}/>
  107. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  108. </div>
  109. </div>
  110. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
  111. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  112. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
  113. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  114. </div>
  115. </div>
  116. <div class="ui divider"></div>
  117. {{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
  118. <div class="inline field">
  119. <label>{{.i18n.Tr "repo.issues"}}</label>
  120. <div class="ui checkbox">
  121. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
  122. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  123. </div>
  124. </div>
  125. <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
  126. <div class="field">
  127. <div class="ui radio checkbox">
  128. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}checked{{end}}/>
  129. <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  130. </div>
  131. </div>
  132. <div class="field {{if (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
  133. {{if .Repository.CanEnableTimetracker}}
  134. <div class="field">
  135. <div class="ui checkbox">
  136. <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled}}checked{{end}}>
  137. <label>{{.i18n.Tr "repo.settings.enable_timetracker"}}</label>
  138. </div>
  139. </div>
  140. <div class="field {{if not .Repository.IsTimetrackerEnabled}}disabled{{end}}" id="only_contributors">
  141. <div class="ui checkbox">
  142. <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime}}checked{{end}}>
  143. <label>{{.i18n.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
  144. </div>
  145. </div>
  146. {{end}}
  147. </div>
  148. <div class="field">
  149. <div class="ui radio checkbox">
  150. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}checked{{end}}/>
  151. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  152. </div>
  153. </div>
  154. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
  155. <div class="field">
  156. <label for="external_tracker_url">{{.i18n.Tr "repo.settings.external_tracker_url"}}</label>
  157. <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
  158. <p class="help">{{.i18n.Tr "repo.settings.external_tracker_url_desc"}}</p>
  159. </div>
  160. <div class="field">
  161. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  162. <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
  163. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  164. </div>
  165. <div class="inline fields">
  166. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  167. <div class="field">
  168. <div class="ui radio checkbox">
  169. {{$externalTracker := (.Repository.MustGetUnit $.UnitTypeExternalTracker)}}
  170. {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
  171. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if $externalTrackerStyle}}{{if eq $externalTrackerStyle "numeric"}}checked=""{{end}}{{end}}/>
  172. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  173. </div>
  174. </div>
  175. <div class="field">
  176. <div class="ui radio checkbox">
  177. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if $externalTrackerStyle}}{{if eq $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}{{end}} />
  178. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. {{if .Repository.CanEnablePulls}}
  185. <div class="ui divider"></div>
  186. {{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}
  187. {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
  188. <div class="inline field">
  189. <label>{{.i18n.Tr "repo.pulls"}}</label>
  190. <div class="ui checkbox">
  191. <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
  192. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  193. </div>
  194. </div>
  195. <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
  196. <div class="field">
  197. <div class="ui checkbox">
  198. <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
  199. <label>{{.i18n.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
  200. </div>
  201. </div>
  202. <div class="field">
  203. <div class="ui checkbox">
  204. <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
  205. <label>{{.i18n.Tr "repo.settings.pulls.allow_merge_commits"}}</label>
  206. </div>
  207. </div>
  208. <div class="field">
  209. <div class="ui checkbox">
  210. <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
  211. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge"}}</label>
  212. </div>
  213. </div>
  214. <div class="field">
  215. <div class="ui checkbox">
  216. <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
  217. <label>{{.i18n.Tr "repo.settings.pulls.allow_squash_commits"}}</label>
  218. </div>
  219. </div>
  220. </div>
  221. {{end}}
  222. <div class="ui divider"></div>
  223. <div class="field">
  224. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  225. </div>
  226. </form>
  227. </div>
  228. {{if .IsAdmin}}
  229. <h4 class="ui top attached header">
  230. {{.i18n.Tr "repo.settings.admin_settings"}}
  231. </h4>
  232. <div class="ui attached segment">
  233. <form class="ui form" method="post">
  234. {{.CsrfTokenHtml}}
  235. <input type="hidden" name="action" value="admin">
  236. <div class="field">
  237. <div class="ui checkbox">
  238. <input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
  239. <label>{{.i18n.Tr "repo.settings.admin_enable_health_check"}}</label>
  240. </div>
  241. </div>
  242. <div class="ui divider"></div>
  243. <div class="field">
  244. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  245. </div>
  246. </form>
  247. </div>
  248. {{end}}
  249. {{if .IsRepositoryOwner}}
  250. <h4 class="ui top attached warning header">
  251. {{.i18n.Tr "repo.settings.danger_zone"}}
  252. </h4>
  253. <div class="ui attached warning table danger segment">
  254. {{if .Repository.IsMirror}}
  255. <div class="item">
  256. <div class="ui right">
  257. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  258. </div>
  259. <div>
  260. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  261. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  262. </div>
  263. </div>
  264. <div class="ui divider"></div>
  265. {{end}}
  266. <div class="item">
  267. <div class="ui right">
  268. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  269. </div>
  270. <div>
  271. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  272. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  273. </div>
  274. </div>
  275. {{if .Repository.UnitEnabled $.UnitTypeWiki}}
  276. <div class="ui divider"></div>
  277. <div class="item">
  278. <div class="ui right">
  279. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  280. </div>
  281. <div>
  282. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  283. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  284. </div>
  285. </div>
  286. {{end}}
  287. <div class="ui divider"></div>
  288. <div class="item">
  289. <div class="ui right">
  290. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  291. </div>
  292. <div>
  293. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  294. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  295. </div>
  296. </div>
  297. </div>
  298. {{end}}
  299. </div>
  300. </div>
  301. {{if .IsRepositoryOwner}}
  302. {{if .Repository.IsMirror}}
  303. <div class="ui small modal" id="convert-repo-modal">
  304. <div class="header">
  305. {{.i18n.Tr "repo.settings.convert"}}
  306. </div>
  307. <div class="content">
  308. <div class="ui warning message text left">
  309. {{.i18n.Tr "repo.settings.convert_notices_1" | Safe}}
  310. </div>
  311. <form class="ui form" action="{{.Link}}" method="post">
  312. {{.CsrfTokenHtml}}
  313. <input type="hidden" name="action" value="convert">
  314. <div class="field">
  315. <label>
  316. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  317. <span class="text red">{{.Repository.Name}}</span>
  318. </label>
  319. </div>
  320. <div class="required field">
  321. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  322. <input id="repo_name" name="repo_name" required>
  323. </div>
  324. <div class="text right actions">
  325. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  326. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  327. </div>
  328. </form>
  329. </div>
  330. </div>
  331. {{end}}
  332. <div class="ui small modal" id="transfer-repo-modal">
  333. <div class="header">
  334. {{.i18n.Tr "repo.settings.transfer"}}
  335. </div>
  336. <div class="content">
  337. <div class="ui warning message text left">
  338. {{.i18n.Tr "repo.settings.transfer_notices_1" | Safe}} <br>
  339. {{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
  340. </div>
  341. <form class="ui form" action="{{.Link}}" method="post">
  342. {{.CsrfTokenHtml}}
  343. <input type="hidden" name="action" value="transfer">
  344. <div class="field">
  345. <label>
  346. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  347. <span class="text red">{{.Repository.Name}}</span>
  348. </label>
  349. </div>
  350. <div class="required field">
  351. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  352. <input id="repo_name" name="repo_name" required>
  353. </div>
  354. <div class="required field">
  355. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  356. <input id="new_owner_name" name="new_owner_name" required>
  357. </div>
  358. <div class="text right actions">
  359. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  360. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  361. </div>
  362. </form>
  363. </div>
  364. </div>
  365. <div class="ui small modal" id="delete-repo-modal">
  366. <div class="header">
  367. {{.i18n.Tr "repo.settings.delete"}}
  368. </div>
  369. <div class="content">
  370. <div class="ui warning message text left">
  371. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  372. {{.i18n.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
  373. {{if .Repository.NumForks}}<br>
  374. {{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}}
  375. {{end}}
  376. </div>
  377. <form class="ui form" action="{{.Link}}" method="post">
  378. {{.CsrfTokenHtml}}
  379. <input type="hidden" name="action" value="delete">
  380. <div class="field">
  381. <label>
  382. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  383. <span class="text red">{{.Repository.Name}}</span>
  384. </label>
  385. </div>
  386. <div class="required field">
  387. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  388. <input id="repo_name" name="repo_name" required>
  389. </div>
  390. <div class="text right actions">
  391. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  392. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  393. </div>
  394. </form>
  395. </div>
  396. </div>
  397. {{if .Repository.UnitEnabled $.UnitTypeWiki}}
  398. <div class="ui small modal" id="delete-wiki-modal">
  399. <div class="header">
  400. {{.i18n.Tr "repo.settings.wiki_delete"}}
  401. </div>
  402. <div class="content">
  403. <div class="ui warning message text left">
  404. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  405. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  406. </div>
  407. <form class="ui form" action="{{.Link}}" method="post">
  408. {{.CsrfTokenHtml}}
  409. <input type="hidden" name="action" value="delete-wiki">
  410. <div class="field">
  411. <label>
  412. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  413. <span class="text red">{{.Repository.Name}}</span>
  414. </label>
  415. </div>
  416. <div class="required field">
  417. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  418. <input id="repo_name" name="repo_name" required>
  419. </div>
  420. <div class="text right actions">
  421. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  422. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_wiki_delete"}}</button>
  423. </div>
  424. </form>
  425. </div>
  426. </div>
  427. {{end}}
  428. {{end}}
  429. {{template "base/footer" .}}