Include gogs as builtin

stable
Jesús Espino 2016-07-21 11:24:10 +02:00 committed by David Barragán Merino
parent 0128aee9f0
commit b9a825620d
21 changed files with 185 additions and 14 deletions

View File

@ -20,6 +20,8 @@
- Drag & Drop ordering for wiki links. - Drag & Drop ordering for wiki links.
- Add a list of all wiki pages - Add a list of all wiki pages
- Add Wiki history - Add Wiki history
- Third party integrations:
- Included gogs as builtin integration.
### Misc ### Misc
- Lots of small and not so small bugfixes. - Lots of small and not so small bugfixes.

View File

@ -341,6 +341,12 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
section: "admin" section: "admin"
} }
) )
$routeProvider.when("/project/:pslug/admin/third-parties/gogs",
{
templateUrl: "admin/admin-third-parties-gogs.html",
section: "admin"
}
)
# Admin - Contrib Plugins # Admin - Contrib Plugins
$routeProvider.when("/project/:pslug/admin/contrib/:plugin", $routeProvider.when("/project/:pslug/admin/contrib/:plugin",
{templateUrl: "contrib/main.html"}) {templateUrl: "contrib/main.html"})

View File

@ -586,3 +586,50 @@ ValidOriginIpsDirective = ->
} }
module.directive("tgValidOriginIps", ValidOriginIpsDirective) module.directive("tgValidOriginIps", ValidOriginIpsDirective)
#############################################################################
## Gogs Controller
#############################################################################
class GogsController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.FiltersMixin)
@.$inject = [
"$scope",
"$tgRepo",
"$tgResources",
"$routeParams",
"tgAppMetaService",
"$translate"
]
constructor: (@scope, @repo, @rs, @params, @appMetaService, @translate) ->
bindMethods(@)
@scope.sectionName = @translate.instant("ADMIN.GOGS.SECTION_NAME")
@scope.project = {}
promise = @.loadInitialData()
promise.then () =>
title = @translate.instant("ADMIN.GOGS.PAGE_TITLE", {projectName: @scope.project.name})
description = @scope.project.description
@appMetaService.setAll(title, description)
promise.then null, @.onInitialDataError.bind(@)
loadModules: ->
return @rs.modules.list(@scope.projectId, "gogs").then (gogs) =>
@scope.gogs = gogs
loadProject: ->
return @rs.projects.getBySlug(@params.pslug).then (project) =>
@scope.projectId = project.id
@scope.project = project
@scope.$emit('project:loaded', project)
return project
loadInitialData: ->
promise = @.loadProject()
promise.then(=> @.loadModules())
return promise
module.controller("GogsController", GogsController)

View File

@ -108,6 +108,7 @@ urls = {
"project-admin-third-parties-github": "/project/:project/admin/third-parties/github" "project-admin-third-parties-github": "/project/:project/admin/third-parties/github"
"project-admin-third-parties-gitlab": "/project/:project/admin/third-parties/gitlab" "project-admin-third-parties-gitlab": "/project/:project/admin/third-parties/gitlab"
"project-admin-third-parties-bitbucket": "/project/:project/admin/third-parties/bitbucket" "project-admin-third-parties-bitbucket": "/project/:project/admin/third-parties/bitbucket"
"project-admin-third-parties-gogs": "/project/:project/admin/third-parties/gogs"
"project-admin-contrib": "/project/:project/admin/contrib/:plugin" "project-admin-contrib": "/project/:project/admin/contrib/:plugin"
# User settings # User settings

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Search results" "RESULTS": "Search results"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Suchergebnisse" "RESULTS": "Suchergebnisse"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Resultados de búsqueda" "RESULTS": "Resultados de búsqueda"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhookit", "SECTION_NAME": "Webhookit",
@ -1628,4 +1632,4 @@
"RESULTS": "Search results" "RESULTS": "Search results"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Résultats de la recherche" "RESULTS": "Résultats de la recherche"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Risultati della ricerca" "RESULTS": "Risultati della ricerca"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Search results" "RESULTS": "Search results"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Search results" "RESULTS": "Search results"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Resultado de pesquisa." "RESULTS": "Resultado de pesquisa."
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Веб-хуки - {{projectName}}", "PAGE_TITLE": "Веб-хуки - {{projectName}}",
"SECTION_NAME": "Веб-хуки", "SECTION_NAME": "Веб-хуки",
@ -1628,4 +1632,4 @@
"RESULTS": "Результаты поиска" "RESULTS": "Результаты поиска"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webbkrok - {{projectName}}", "PAGE_TITLE": "Webbkrok - {{projectName}}",
"SECTION_NAME": "Webbkrokar", "SECTION_NAME": "Webbkrokar",
@ -1628,4 +1632,4 @@
"RESULTS": "Search results" "RESULTS": "Search results"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Github", "SECTION_NAME": "Github",
"PAGE_TITLE": "Github - {{projectName}}" "PAGE_TITLE": "Github - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks - {{projectName}}", "PAGE_TITLE": "Webhooks - {{projectName}}",
"SECTION_NAME": "Webhooks", "SECTION_NAME": "Webhooks",
@ -1628,4 +1632,4 @@
"RESULTS": "Arama sonuçları" "RESULTS": "Arama sonuçları"
} }
} }
} }

View File

@ -598,6 +598,10 @@
"SECTION_NAME": "Githun", "SECTION_NAME": "Githun",
"PAGE_TITLE": "Gitlab - {{projectName}}" "PAGE_TITLE": "Gitlab - {{projectName}}"
}, },
"GOGS": {
"SECTION_NAME": "Gogs",
"PAGE_TITLE": "Gogs - {{projectName}}"
},
"WEBHOOKS": { "WEBHOOKS": {
"PAGE_TITLE": "Webhooks- {{projectName}}", "PAGE_TITLE": "Webhooks- {{projectName}}",
"SECTION_NAME": "網頁觸發 ", "SECTION_NAME": "網頁觸發 ",
@ -1628,4 +1632,4 @@
"RESULTS": "搜尋結果" "RESULTS": "搜尋結果"
} }
} }
} }

View File

@ -60,7 +60,7 @@ div.wrapper.roles(
) )
a.help-button( a.help-button(
href="https://tree.taiga.io/support/integrations/gitlab-integration/" href="https://tree.taiga.io/support/integrations/gogs-integration/"
target="_blank" target="_blank"
) )
tg-svg(svg-icon="icon-question") tg-svg(svg-icon="icon-question")

View File

@ -0,0 +1,56 @@
doctype html
div.wrapper.roles(
tg-gogs-webhooks
ng-controller="GogsController as ctrl",
ng-init="section='admin'"
)
tg-project-menu
sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="third-parties")
include ../includes/modules/admin-menu
sidebar.menu-tertiary.sidebar(tg-admin-navigation="third-parties-gogs")
include ../includes/modules/admin-submenu-third-parties
section.main.admin-common.admin-third-parties
include ../includes/components/mainTitle
form
fieldset
label(for="secret-key", translate="ADMIN.THIRD_PARTIES.SECRET_KEY")
input(
id="secret-key"
type="text"
name="secret-key"
ng-model="gogs.secret"
placeholder="{{'ADMIN.THIRD_PARTIES.SECRET_KEY' | translate}}"
)
fieldset
.select-input-text(tg-select-input-text)
div
label(for="payload-url", translate="ADMIN.THIRD_PARTIES.PAYLOAD_URL")
.field-with-option
input(
id="payload-url"
type="text"
name="payload-url"
readonly="readonly"
ng-model="gogs.webhooks_url"
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
)
.option-wrapper.select-input-content
tg-svg(svg-icon="icon-clipboard")
.help-copy(translate="COMMON.COPY_TO_CLIPBOARD")
button.button-green.submit-button(
type="submit"
title="{{'COMMON.SAVE' | translate}}"
translate="COMMON.SAVE"
)
a.help-button(
href="https://tree.taiga.io/support/integrations/gogs-integration/"
target="_blank"
)
tg-svg(svg-icon="icon-question")
span(translate="ADMIN.HELP")

View File

@ -13,3 +13,6 @@ section.admin-submenu
li#adminmenu-third-parties-bitbucket li#adminmenu-third-parties-bitbucket
a(href="", tg-nav="project-admin-third-parties-bitbucket:project=project.slug") a(href="", tg-nav="project-admin-third-parties-bitbucket:project=project.slug")
span.title Bitbucket span.title Bitbucket
li#adminmenu-third-parties-gogs
a(href="", tg-nav="project-admin-third-parties-gogs:project=project.slug")
span.title Gogs