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

options.tmpl 24 kB

Template Repositories (#8768) * Start work on templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Continue work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix IsTemplate vs IsGenerated Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tabs vs spaces * Tabs vs Spaces * Add templates to API & start adding tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix integration tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove unused User Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move template tests to existing repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Minor re-check updates and cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix optionalbool Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test fixes and icon change Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add new user and repo for tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests (finally) Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update meta repo with env variables Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move generation to create page Combine with repo create template Modify API search to prioritize owner for repo Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests and coverage Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix swagger and JS lint Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix API searching for own private repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change wording Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix repo search test. User had a private repo that didn't show up Signed-off-by: jolheiser <john.olheiser@gmail.com> * Another search test fix Signed-off-by: jolheiser <john.olheiser@gmail.com> * Clarify git content Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Feedback updates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add topics WIP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Finish adding topics Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update locale Signed-off-by: jolheiser <john.olheiser@gmail.com>
6 years ago
Repository avatars (#6986) * Repository avatars - first variant of code from old work for gogs - add migration 87 - add new option in app.ini - add en-US locale string - add new class in repository.less * Add changed index.css, remove unused template name * Update en-us doc about configuration options * Add comments to new functions, add new option to docker app.ini * Add comment for lint * Remove variable, not needed * Fix formatting * Update swagger api template * Check if avatar exists * Fix avatar link/path checks * Typo * TEXT column can't have a default value * Fixes: - remove old avatar file on upload - use ID in name of avatar file - users may upload same files - add simple tests * Fix fmt check * Generate PNG instead of "static" GIF * More informative comment * Fix error message * Update avatar upload checks: - add file size check - add new option - update config docs - add new string to en-us locale * Fixes: - use FileHEader field for check file size - add new test - upload big image * Fix formatting * Update comments * Update log message * Removed wrong style - not needed * Use Sync2 to migrate * Update repos list view - bigger avatar - fix html blocks alignment * A little adjust avatar size * Use small icons for explore/repo list * Use new cool avatar preparation func by @lafriks * Missing changes for new function * Remove unused import, move imports * Missed new option definition in app.ini Add file size check in user/profile avatar upload * Use smaller field length for Avatar * Use session to update repo DB data, update DeleteAvatar - use session too * Fix err variable definition * As suggested @lafriks - return as soon as possible, code readability
7 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  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. <div class="inline field">
  19. <label>{{.i18n.Tr "repo.repo_size"}}</label>
  20. <span>{{SizeFmt .Repository.Size}}</span>
  21. </div>
  22. <div class="inline field">
  23. <label>{{.i18n.Tr "repo.template"}}</label>
  24. <div class="ui checkbox">
  25. <input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
  26. <label>{{.i18n.Tr "repo.template_helper"}}</label>
  27. </div>
  28. </div>
  29. {{if not .Repository.IsFork}}
  30. <div class="inline field">
  31. <label>{{.i18n.Tr "repo.visibility"}}</label>
  32. <div class="ui checkbox">
  33. {{if .IsAdmin}}
  34. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  35. {{else}}
  36. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}>
  37. {{end}}
  38. <label>{{.i18n.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
  39. </div>
  40. </div>
  41. {{end}}
  42. <div class="field {{if .Err_Description}}error{{end}}">
  43. <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label>
  44. <textarea id="description" name="description" rows="2">{{.Repository.Description}}</textarea>
  45. </div>
  46. <div class="field {{if .Err_Website}}error{{end}}">
  47. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  48. <input id="website" name="website" type="url" value="{{.Repository.Website}}">
  49. </div>
  50. <div class="field">
  51. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  52. </div>
  53. </form>
  54. <div class="ui divider"></div>
  55. <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
  56. {{.CsrfTokenHtml}}
  57. <div class="inline field">
  58. <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
  59. <input name="avatar" type="file" >
  60. </div>
  61. <div class="field">
  62. <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
  63. <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
  64. </div>
  65. </form>
  66. </div>
  67. {{if .Repository.IsMirror}}
  68. <h4 class="ui top attached header">
  69. {{.i18n.Tr "repo.settings.mirror_settings"}}
  70. </h4>
  71. <div class="ui attached segment">
  72. <form class="ui form" method="post">
  73. {{.CsrfTokenHtml}}
  74. <input type="hidden" name="action" value="mirror">
  75. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  76. <label>{{.i18n.Tr "repo.mirror_prune"}}</label>
  77. <div class="ui checkbox">
  78. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .MirrorEnablePrune}}checked{{end}}>
  79. <label>{{.i18n.Tr "repo.mirror_prune_desc"}}</label>
  80. </div>
  81. </div>
  82. <div class="inline field {{if .Err_Interval}}error{{end}}">
  83. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  84. <input id="interval" name="interval" value="{{.MirrorInterval}}">
  85. </div>
  86. <div class="field {{if .Err_MirrorAddress}}error{{end}}">
  87. <label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
  88. <input id="mirror_address" name="mirror_address" value="{{MirrorFullAddress .Mirror}}" required>
  89. <p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
  90. </div>
  91. <div class="ui accordion optional field">
  92. <label class="ui title {{if .Err_Auth}}text red active{{end}}">
  93. <i class="icon dropdown"></i>
  94. <label for="">{{.i18n.Tr "repo.need_auth"}}</label>
  95. </label>
  96. <div class="content {{if .Err_Auth}}active{{else if (MirrorUserName .Mirror)}}active{{end}}">
  97. <div class="inline field {{if .Err_Auth}}error{{end}}">
  98. <label for="mirror_username">{{.i18n.Tr "username"}}</label>
  99. <input id="mirror_username" name="mirror_username" value="{{MirrorUserName .Mirror}}" {{if not .mirror_username}}data-need-clear="true"{{end}}>
  100. </div>
  101. <input class="fake" type="password">
  102. <div class="inline field {{if .Err_Auth}}error{{end}}">
  103. <label for="mirror_password">{{.i18n.Tr "password"}}</label>
  104. <input id="mirror_password" name="mirror_password" type="password" value="{{MirrorPassword .Mirror}}" {{if not .mirror_password}}data-need-clear="true"{{end}}>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="field">
  109. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  110. </div>
  111. </form>
  112. <div class="ui divider"></div>
  113. <form class="ui form" method="post">
  114. {{.CsrfTokenHtml}}
  115. <input type="hidden" name="action" value="mirror-sync">
  116. <div class="inline field">
  117. <label>{{.i18n.Tr "repo.mirror_last_synced"}}</label>
  118. <span>{{.Mirror.UpdatedUnix.AsTime}}</span>
  119. </div>
  120. <div class="field">
  121. <button class="ui blue button">{{$.i18n.Tr "repo.settings.sync_mirror"}}</button>
  122. </div>
  123. </form>
  124. </div>
  125. {{end}}
  126. <h4 class="ui top attached header">
  127. {{.i18n.Tr "repo.settings.advanced_settings"}}
  128. </h4>
  129. <div class="ui attached segment">
  130. <form class="ui form" method="post">
  131. {{.CsrfTokenHtml}}
  132. <input type="hidden" name="action" value="advanced">
  133. {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
  134. <div class="inline field">
  135. <label>{{.i18n.Tr "repo.wiki"}}</label>
  136. <div class="ui checkbox">
  137. <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
  138. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  139. </div>
  140. </div>
  141. <div class="field {{if not $isWikiEnabled}}disabled{{end}}" id="wiki_box">
  142. <div class="field">
  143. <div class="ui radio checkbox">
  144. <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}}/>
  145. <label>{{.i18n.Tr "repo.settings.use_internal_wiki"}}</label>
  146. </div>
  147. </div>
  148. <div class="field">
  149. <div class="ui radio checkbox">
  150. <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}}/>
  151. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  152. </div>
  153. </div>
  154. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
  155. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  156. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
  157. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  158. </div>
  159. </div>
  160. <div class="ui divider"></div>
  161. {{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
  162. <div class="inline field">
  163. <label>{{.i18n.Tr "repo.issues"}}</label>
  164. <div class="ui checkbox">
  165. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
  166. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  167. </div>
  168. </div>
  169. <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
  170. <div class="field">
  171. <div class="ui radio checkbox">
  172. <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}}/>
  173. <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  174. </div>
  175. </div>
  176. <div class="field {{if (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
  177. {{if .Repository.CanEnableTimetracker}}
  178. <div class="field">
  179. <div class="ui checkbox">
  180. <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled}}checked{{end}}>
  181. <label>{{.i18n.Tr "repo.settings.enable_timetracker"}}</label>
  182. </div>
  183. </div>
  184. <div class="field {{if not .Repository.IsTimetrackerEnabled}}disabled{{end}}" id="only_contributors">
  185. <div class="ui checkbox">
  186. <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime}}checked{{end}}>
  187. <label>{{.i18n.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
  188. </div>
  189. </div>
  190. {{end}}
  191. <div class="field">
  192. <div class="ui checkbox">
  193. <input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled)}}checked{{end}}>
  194. <label>{{.i18n.Tr "repo.issues.dependency.setting"}}</label>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="field">
  199. <div class="ui radio checkbox">
  200. <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}}/>
  201. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  202. </div>
  203. </div>
  204. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
  205. <div class="field">
  206. <label for="external_tracker_url">{{.i18n.Tr "repo.settings.external_tracker_url"}}</label>
  207. <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
  208. <p class="help">{{.i18n.Tr "repo.settings.external_tracker_url_desc"}}</p>
  209. </div>
  210. <div class="field">
  211. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  212. <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}">
  213. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  214. </div>
  215. <div class="inline fields">
  216. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  217. <div class="field">
  218. <div class="ui radio checkbox">
  219. {{$externalTracker := (.Repository.MustGetUnit $.UnitTypeExternalTracker)}}
  220. {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
  221. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if $externalTrackerStyle}}{{if eq $externalTrackerStyle "numeric"}}checked=""{{end}}{{end}}/>
  222. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  223. </div>
  224. </div>
  225. <div class="field">
  226. <div class="ui radio checkbox">
  227. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if $externalTrackerStyle}}{{if eq $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}{{end}} />
  228. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. </div>
  234. {{if .Repository.CanEnablePulls}}
  235. <div class="ui divider"></div>
  236. {{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}
  237. {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
  238. <div class="inline field">
  239. <label>{{.i18n.Tr "repo.pulls"}}</label>
  240. <div class="ui checkbox">
  241. <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
  242. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  243. </div>
  244. </div>
  245. <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
  246. <div class="field">
  247. <div class="ui checkbox">
  248. <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
  249. <label>{{.i18n.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
  250. </div>
  251. </div>
  252. <div class="field">
  253. <div class="ui checkbox">
  254. <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
  255. <label>{{.i18n.Tr "repo.settings.pulls.allow_merge_commits"}}</label>
  256. </div>
  257. </div>
  258. <div class="field">
  259. <div class="ui checkbox">
  260. <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
  261. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge"}}</label>
  262. </div>
  263. </div>
  264. <div class="field">
  265. <div class="ui checkbox">
  266. <input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}>
  267. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge_commit"}}</label>
  268. </div>
  269. </div>
  270. <div class="field">
  271. <div class="ui checkbox">
  272. <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
  273. <label>{{.i18n.Tr "repo.settings.pulls.allow_squash_commits"}}</label>
  274. </div>
  275. </div>
  276. </div>
  277. {{end}}
  278. <div class="ui divider"></div>
  279. <div class="field">
  280. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  281. </div>
  282. </form>
  283. </div>
  284. {{if .IsAdmin}}
  285. <h4 class="ui top attached header">
  286. {{.i18n.Tr "repo.settings.admin_settings"}}
  287. </h4>
  288. <div class="ui attached segment">
  289. <form class="ui form" method="post">
  290. {{.CsrfTokenHtml}}
  291. <input type="hidden" name="action" value="admin">
  292. <div class="field">
  293. <div class="ui checkbox">
  294. <input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
  295. <label>{{.i18n.Tr "repo.settings.admin_enable_health_check"}}</label>
  296. </div>
  297. </div>
  298. <div class="ui checkbox">
  299. <input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{ if .Repository.CloseIssuesViaCommitInAnyBranch }}checked{{end}}>
  300. <label>{{.i18n.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
  301. </div>
  302. <div class="ui divider"></div>
  303. <div class="field">
  304. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  305. </div>
  306. </form>
  307. </div>
  308. {{end}}
  309. {{if .Permission.IsOwner}}
  310. <h4 class="ui top attached warning header">
  311. {{.i18n.Tr "repo.settings.danger_zone"}}
  312. </h4>
  313. <div class="ui attached warning table danger segment">
  314. {{if .Repository.IsMirror}}
  315. <div class="item">
  316. <div class="ui right">
  317. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  318. </div>
  319. <div>
  320. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  321. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  322. </div>
  323. </div>
  324. <div class="ui divider"></div>
  325. {{end}}
  326. <div class="item">
  327. <div class="ui right">
  328. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  329. </div>
  330. <div>
  331. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  332. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  333. </div>
  334. </div>
  335. {{if .Permission.CanRead $.UnitTypeWiki}}
  336. <div class="ui divider"></div>
  337. <div class="item">
  338. <div class="ui right">
  339. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  340. </div>
  341. <div>
  342. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  343. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  344. </div>
  345. </div>
  346. {{end}}
  347. <div class="ui divider"></div>
  348. <div class="item">
  349. <div class="ui right">
  350. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  351. </div>
  352. <div>
  353. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  354. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  355. </div>
  356. </div>
  357. {{if not .Repository.IsMirror}}
  358. <div class="ui divider"></div>
  359. <div class="item">
  360. <div class="ui right">
  361. <button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
  362. {{if .Repository.IsArchived}}
  363. {{.i18n.Tr "repo.settings.unarchive.button"}}
  364. {{else}}
  365. {{.i18n.Tr "repo.settings.archive.button"}}
  366. {{end}}
  367. </button>
  368. </div>
  369. <div>
  370. {{if .Repository.IsArchived}}
  371. <h5>{{.i18n.Tr "repo.settings.unarchive.header"}}</h5>
  372. <p>{{.i18n.Tr "repo.settings.unarchive.text"}}</p>
  373. {{else}}
  374. <h5>{{.i18n.Tr "repo.settings.archive.header"}}</h5>
  375. <p>{{.i18n.Tr "repo.settings.archive.text"}}</p>
  376. {{end}}
  377. </div>
  378. </div>
  379. {{end}}
  380. </div>
  381. {{end}}
  382. </div>
  383. </div>
  384. {{if .Permission.IsOwner}}
  385. {{if .Repository.IsMirror}}
  386. <div class="ui small modal" id="convert-repo-modal">
  387. <div class="header">
  388. {{.i18n.Tr "repo.settings.convert"}}
  389. </div>
  390. <div class="content">
  391. <div class="ui warning message text left">
  392. {{.i18n.Tr "repo.settings.convert_notices_1"}}
  393. </div>
  394. <form class="ui form" action="{{.Link}}" method="post">
  395. {{.CsrfTokenHtml}}
  396. <input type="hidden" name="action" value="convert">
  397. <div class="field">
  398. <label>
  399. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  400. <span class="text red">{{.Repository.Name}}</span>
  401. </label>
  402. </div>
  403. <div class="required field">
  404. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  405. <input id="repo_name" name="repo_name" required>
  406. </div>
  407. <div class="text right actions">
  408. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  409. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  410. </div>
  411. </form>
  412. </div>
  413. </div>
  414. {{end}}
  415. <div class="ui small modal" id="transfer-repo-modal">
  416. <div class="header">
  417. {{.i18n.Tr "repo.settings.transfer"}}
  418. </div>
  419. <div class="content">
  420. <div class="ui warning message text left">
  421. {{.i18n.Tr "repo.settings.transfer_notices_1"}} <br>
  422. {{.i18n.Tr "repo.settings.transfer_notices_2"}}
  423. </div>
  424. <form class="ui form" action="{{.Link}}" method="post">
  425. {{.CsrfTokenHtml}}
  426. <input type="hidden" name="action" value="transfer">
  427. <div class="field">
  428. <label>
  429. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  430. <span class="text red">{{.Repository.Name}}</span>
  431. </label>
  432. </div>
  433. <div class="required field">
  434. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  435. <input id="repo_name" name="repo_name" required>
  436. </div>
  437. <div class="required field">
  438. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  439. <input id="new_owner_name" name="new_owner_name" required>
  440. </div>
  441. <div class="text right actions">
  442. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  443. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  444. </div>
  445. </form>
  446. </div>
  447. </div>
  448. <div class="ui small modal" id="delete-repo-modal">
  449. <div class="header">
  450. {{.i18n.Tr "repo.settings.delete"}}
  451. </div>
  452. <div class="content">
  453. <div class="ui warning message text left">
  454. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  455. {{.i18n.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
  456. {{if .Repository.NumForks}}<br>
  457. {{.i18n.Tr "repo.settings.delete_notices_fork_1"}}
  458. {{end}}
  459. </div>
  460. <form class="ui form" action="{{.Link}}" method="post">
  461. {{.CsrfTokenHtml}}
  462. <input type="hidden" name="action" value="delete">
  463. <div class="field">
  464. <label>
  465. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  466. <span class="text red">{{.Repository.Name}}</span>
  467. </label>
  468. </div>
  469. <div class="required field">
  470. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  471. <input id="repo_name" name="repo_name" required>
  472. </div>
  473. <div class="text right actions">
  474. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  475. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  476. </div>
  477. </form>
  478. </div>
  479. </div>
  480. {{if .Repository.UnitEnabled $.UnitTypeWiki}}
  481. <div class="ui small modal" id="delete-wiki-modal">
  482. <div class="header">
  483. {{.i18n.Tr "repo.settings.wiki_delete"}}
  484. </div>
  485. <div class="content">
  486. <div class="ui warning message text left">
  487. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  488. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  489. </div>
  490. <form class="ui form" action="{{.Link}}" method="post">
  491. {{.CsrfTokenHtml}}
  492. <input type="hidden" name="action" value="delete-wiki">
  493. <div class="field">
  494. <label>
  495. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  496. <span class="text red">{{.Repository.Name}}</span>
  497. </label>
  498. </div>
  499. <div class="required field">
  500. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  501. <input id="repo_name" name="repo_name" required>
  502. </div>
  503. <div class="text right actions">
  504. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  505. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_wiki_delete"}}</button>
  506. </div>
  507. </form>
  508. </div>
  509. </div>
  510. {{end}}
  511. {{if not .Repository.IsMirror}}
  512. <div class="ui basic modal" id="archive-repo-modal">
  513. <div class="ui icon header">
  514. {{if .Repository.IsArchived}}
  515. {{.i18n.Tr "repo.settings.unarchive.header"}}
  516. {{else}}
  517. {{.i18n.Tr "repo.settings.archive.header"}}
  518. {{end}}
  519. </div>
  520. <div class="content center">
  521. <p>
  522. {{if .Repository.IsArchived}}
  523. {{.i18n.Tr "repo.settings.unarchive.text"}}
  524. {{else}}
  525. {{.i18n.Tr "repo.settings.archive.text"}}
  526. {{end}}
  527. </p>
  528. </div>
  529. <form action="{{.Link}}" method="post">
  530. {{.CsrfTokenHtml}}
  531. <input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}">
  532. <input type="hidden" name="repo_id" value="{{.Repository.ID}}">
  533. <div class="center actions">
  534. <div class="ui basic cancel inverted button">{{.i18n.Tr "settings.cancel"}}</div>
  535. <button class="ui basic inverted yellow button">{{.i18n.Tr "modal.yes"}}</button>
  536. </div>
  537. </form>
  538. </div>
  539. {{end}}
  540. {{end}}
  541. {{template "base/footer" .}}