Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Enterprise Support #23

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added settings to github_add page (fix redirect)
  • Loading branch information
floatdrop committed Feb 14, 2014
commit 52554b4ca1b6d052fa160ac3b06210b15196d4ef
4 changes: 3 additions & 1 deletion pkg/handler/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ func RepoDashboard(w http.ResponseWriter, r *http.Request, u *User, repo *Repo)
}

func RepoAdd(w http.ResponseWriter, r *http.Request, u *User) error {
settings := database.SettingsMust()
teams, err := database.ListTeams(u.ID)
if err != nil {
return err
}
data := struct {
User *User
Teams []*Team
}{u, teams}
Settings *Settings
}{u, teams, settings}
// if the user hasn't linked their GitHub account
// render a different template
if len(u.GithubToken) == 0 {
Expand Down
4 changes: 3 additions & 1 deletion pkg/template/pages/github_add.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h1>
<a class="btn btn-default pull-right" href="/auth/login/github" style="font-size: 18px;background:#f4f4f4;">Re-Link Account</a>
</div>
<form class="form-repo" method="POST" action="/new/github.com">
<input type="hidden" name="domain" autocomplete="off" value="{{.Settings.GitHubDomain}}">
<div class="field-group">
<div>
<label>GitHub Owner</label>
Expand Down Expand Up @@ -84,7 +85,8 @@ <h1>
if (this.status == 200) {
var name = $("input[name=name]").val()
var owner = $("input[name=owner]").val()
window.location.pathname = "/github.com/"+owner+"/"+name
var domain = $("input[name=domain]").val()
window.location.pathname = "/" + domain + "/"+owner+"/"+name
} else {
$("#failureAlert").text("Unable to setup the Repository");
$("#failureAlert").show().removeClass("hide");
Expand Down