File tree Expand file tree Collapse file tree 7 files changed +24
-23
lines changed Expand file tree Collapse file tree 7 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -144,10 +144,21 @@ func (p *Project) Link() string {
144144	return  "" 
145145}
146146
147+ func  (p  * Project ) IconName () string  {
148+ 	if  p .IsRepositoryProject () {
149+ 		return  "octicon-project" 
150+ 	}
151+ 	return  "octicon-project-symlink" 
152+ }
153+ 
147154func  (p  * Project ) IsOrganizationProject () bool  {
148155	return  p .Type  ==  TypeOrganization 
149156}
150157
158+ func  (p  * Project ) IsRepositoryProject () bool  {
159+ 	return  p .Type  ==  TypeRepository 
160+ }
161+ 
151162func  init () {
152163	db .RegisterModel (new (Project ))
153164}
Original file line number Diff line number Diff line change 3838		<div class="milestone list">
3939			{{range .Projects}}
4040				<li class="item">
41- 					{{svg "octicon-project-symlink" }} <a href="{{.Link}}">{{.Title}}</a>
41+ 					{{svg .IconName }} <a href="{{.Link}}">{{.Title}}</a>
4242					<div class="meta">
4343						{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
4444						{{if .IsClosed}}
Original file line number Diff line number Diff line change 100100								</div>
101101								{{range .OpenProjects}}
102102									<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
103- 										{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
104- 										{{.Title}}
103+ 										{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
105104									</a>
106105								{{end}}
107106							{{end}}
112111								</div>
113112								{{range .ClosedProjects}}
114113									<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
115- 										{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
116- 										{{.Title}}
114+ 										{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
117115									</a>
118116								{{end}}
119117							{{end}}
273271								</div>
274272								{{range .OpenProjects}}
275273									<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
276- 										{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
277- 										{{.Title}}
274+ 										{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
278275									</div>
279276								{{end}}
280277							{{end}}
285282								</div>
286283								{{range .ClosedProjects}}
287284									<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
288- 										{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
289- 										{{.Title}}
285+ 										{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
290286									</div>
291287								{{end}}
292288							{{end}}
Original file line number Diff line number Diff line change 134134							</div>
135135							{{range .OpenProjects}}
136136								<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
137- 									{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
138- 									{{.Title}}
137+ 									{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
139138								</a>
140139							{{end}}
141140						{{end}}
146145							</div>
147146							{{range .ClosedProjects}}
148147								<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
149- 									{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
150- 									{{.Title}}
148+ 									{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
151149								</a>
152150							{{end}}
153151						{{end}}
159157				<div class="selected">
160158					{{if .Project}}
161159						<a class="item muted sidebar-item-link" href="{{.Project.Link}}">
162- 							{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
163- 							{{.Project.Title}}
160+ 							{{svg .Project.IconName 18 "gt-mr-3"}}{{.Project.Title}}
164161						</a>
165162					{{end}}
166163				</div>
Original file line number Diff line number Diff line change 196196						</div>
197197						{{range .OpenProjects}}
198198							<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
199- 								{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
200- 								{{.Title}}
199+ 								{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
201200							</a>
202201						{{end}}
203202					{{end}}
208207						</div>
209208						{{range .ClosedProjects}}
210209							<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
211- 								{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
212- 								{{.Title}}
210+ 								{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
213211							</a>
214212						{{end}}
215213					{{end}}
220218				<div class="selected">
221219					{{if .Issue.ProjectID}}
222220						<a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}">
223- 							{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
224- 							{{.Issue.Project.Title}}
221+ 							{{svg .Issue.Project.IconName 18 "gt-mr-3"}}{{.Issue.Project.Title}}
225222						</a>
226223					{{end}}
227224				</div>
Original file line number Diff line number Diff line change 4040		<div class="milestone list">
4141			{{range .Projects}}
4242				<li class="item">
43- 					{{svg "octicon-project" }} <a href="{{.Link}}">{{.Title}}</a>
43+ 					{{svg .IconName }} <a href="{{.Link}}">{{.Title}}</a>
4444					<div class="meta">
4545						{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
4646						{{if .IsClosed}}
Original file line number Diff line number Diff line change 8888					{{end}}
8989					{{if .Project}}
9090						<a class="project" href="{{.Project.Link}}">
91- 							{{if  .Project.IsOrganizationProject}}{{svg "octicon-project-symlink"  14 "gt-mr-2"}}{{else}}{{svg "octicon-project" 14 "gt-mr-2"}}{{end }}{{.Project.Title}}
91+ 							{{svg  .Project.IconName  14 "gt-mr-2"}}{{.Project.Title}}
9292						</a>
9393					{{end}}
9494					{{if .Ref}}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments