Browse Source

select owner when creating repository

tags/v1.2.0-rc1
fuxiaohei 11 years ago
parent
commit
80be060735
2 changed files with 22 additions and 1 deletions
  1. +21
    -0
      public/js/app.js
  2. +1
    -1
      templates/repo/create.tmpl

+ 21
- 0
public/js/app.js View File

@@ -758,6 +758,24 @@ function initRepoSetting() {
});
}

function initRepoCreating() {
// owner switch menu click
(function () {
$('#repo-owner-switch .dropdown-menu').on("click", "li", function () {
var uid = $(this).data('uid');
// set to input
$('#repo-owner-id').val(uid);
// set checked class
if (!$(this).hasClass("checked")) {
$(this).parent().find(".checked").removeClass("checked");
$(this).addClass("checked");
}
console.log("set repo owner to uid :",uid);
});
}());
console.log("init repo-creating scripts");
}

(function ($) {
$(function () {
initCore();
@@ -780,6 +798,9 @@ function initRepoSetting() {
if ($('#repo-setting-container').length) {
initRepoSetting();
}
if ($('#repo-create').length) {
initRepoCreating();
}
});
})(jQuery);



+ 1
- 1
templates/repo/create.tmpl View File

@@ -29,7 +29,7 @@
</div>
</div>
</div>
<input type="hidden" value="{{.SignedUserId}}" name="userId"/>
<input type="hidden" value="{{.SignedUserId}}" name="userId" id="repo-owner-id"/>

<!--<div class="col-md-8">
<p class="form-control-static">{{.SignedUserName}}</p>


Loading…
Cancel
Save