Browse Source

select owner when creating repository

for-closed-social
fuxiaohei 10 years ago
parent
commit
72ba273cc9
2 changed files with 7 additions and 4 deletions
  1. +4
    -1
      public/js/app.js
  2. +3
    -3
      templates/repo/create.tmpl

+ 4
- 1
public/js/app.js View File

@ -770,7 +770,10 @@ function initRepoCreating() {
$(this).parent().find(".checked").removeClass("checked"); $(this).parent().find(".checked").removeClass("checked");
$(this).addClass("checked"); $(this).addClass("checked");
} }
console.log("set repo owner to uid :",uid);
// set button group to show clicked owner
$('#repo-owner-avatar').attr("src",$(this).find('img').attr("src"));
$('#repo-owner-name').text($(this).text().trim());
console.log("set repo owner to uid :",uid,$(this).text().trim());
}); });
}()); }());
console.log("init repo-creating scripts"); console.log("init repo-creating scripts");

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

@ -9,9 +9,9 @@
<label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label> <label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label>
<div class="col-md-8"> <div class="col-md-8">
<div class="btn-group" id="repo-owner-switch"> <div class="btn-group" id="repo-owner-switch">
<button type="button" class="btn btn-default">
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username">
{{.SignedUser.Name}}
<button type="button" class="btn btn-default" id="repo-owner-current">
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username" id="repo-owner-avatar">
<span id="repo-owner-name">{{.SignedUser.Name}}</span>
</button> </button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span> <span class="caret"></span>

Loading…
Cancel
Save