Skip to content

Commit 5b0ca5f

Browse files
committed
Update
1 parent cc4eefa commit 5b0ca5f

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

routers/web/repo/view_home.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,14 @@ func Home(ctx *context.Context) {
434434
ctx.Data["ParentPath"] = "/" + paths[len(paths)-2]
435435
}
436436
}
437+
438+
starList, err := repo_model.GetStarListsForUser(ctx, ctx.Doer.ID)
439+
if err != nil {
440+
ctx.ServerError("SearchStarList", err)
441+
return
442+
}
443+
log.Error("=============================")
444+
ctx.Data["StarList"] = starList
437445
ctx.Data["Paths"] = paths
438446
ctx.Data["TreeLink"] = treeLink
439447
ctx.Data["TreeNames"] = treeNames

templates/repo/star_unstar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<span aria-hidden="true">{{$buttonText}}</span>
88
<span class="ui small label">{{CountFmt .Repository.NumStars}}</span>
99
</button>
10-
{{if .SignedUserID .ContextUser.ID}}
10+
{{if and .IsSigned (gt .ContextUser.ID 0)}}
1111
<a class="ui basic label muted show-modal" data-modal="#choose-star-list" data-modal-modal-form.action="{{AppSubUrl}}/stars/lists">
1212
{{svg "octicon-triangle-down"}}
1313
</a>

templates/shared/star_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
{{if gt (len .StarList) 0}}
4141
<div class="list-box">
4242
{{range .StarList}}
43-
<a href="https://ilo.nz" class="box-row">
43+
<a href="" class="box-row">
4444
<h3 class="name">{{.Name}}</h3>
4545
<div class="repositories">
4646
88 repositories

templates/shared/star_list_dialog.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@
6666
<div class="header">List</div>
6767
<div class="content">
6868
<form class="ui form modal-form" method="post">
69-
{{.CsrfTokenHtml}}
70-
<input type="hidden" name="action" value="edit" />
71-
<div class="field">
72-
<label for="list-name">Name</label>
73-
<input id="list-name" name="name" placeholder="⭐️ Name this list">
74-
</div>
75-
<div class="field">
76-
<label for="list-description">Description</label>
77-
<textarea id="list-description" name="description" placeholder="Write a description"></textarea>
69+
{{ range .StarList}}
70+
<div class="inline field">
71+
<div class="ui checkbox">
72+
<label>{{ .Name }}</label>
73+
<input name="{{.Name}}" type="checkbox">
74+
</div>
7875
</div>
76+
{{ end }}
77+
<div class="divider"></div>
7978
<div class="text right actions">
8079
<button class="ui cancel button">Cancel</button>
80+
<button class="ui button muted show-modal" data-modal="#create-star-list" data-modal-modal-form.action="{{AppSubUrl}}/stars/lists">Create list</button>
8181
<button class="ui primary button">Save</button>
8282
</div>
8383
</form>

0 commit comments

Comments
 (0)