Allow multiple position in one company experience (#9)

* Add partials for multiple positions on one company

* Remove unnecessary codes + Fix CSS

Co-authored-by: hossainemruz <emruz@appscode.com>
This commit is contained in:
Pau Trepat Segura 2020-07-06 20:02:54 +02:00 committed by GitHub
parent f03e94e5d4
commit 440f424e44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 102 additions and 46 deletions

View file

@ -1,14 +1,5 @@
<div class="col-10 col-lg-8">
<div class="experience-entry-heading">
<h5><a href="{{ .company.url }}">{{ .company.name }}</a></h5>
<h6>{{ .designation }}</h6>
<p class="text-muted">{{ .start }} - {{ if .end }} {{ .end }} {{ else }}Present{{ end }}, {{ .company.location }}</p>
</div>
<p>{{ .company.overview | markdownify }}</p>
<h6 class="text-muted">Responsibilities:</h6>
<ul class="justify-content-around">
{{ range .responsibilities }}
<li>{{ . | markdownify }}</li>
{{ end }}
</ul>
</div>
{{ if gt (len .positions) 1 }}
{{ partial "experiences/multiple-positions" . }}
{{ else }}
{{ partial "experiences/single-position.html" . }}
{{ end }}

View file

@ -0,0 +1,29 @@
<div class="col-10 col-lg-8">
<div class="experience-entry-heading">
<!-- For multiple positions, give emphasis on the company name-->
<h5>{{ if .company.url }}<a href={{.company.url}}>{{ .company.name }}</a>{{ else }}{{ .company.name }}{{ end }}</h5>
<!-- Total experience duration on a company is time between the starting date of the oldest position and ending date of most recent position -->
{{ $oldestPosition := index (last 1 .positions) 0}}
{{ $mostRecentPosition := index (first 1 .positions) 0}}
<p class="text-muted">
{{ $oldestPosition.start }} - {{ if $mostRecentPosition.end }}{{ $mostRecentPosition.end }}{{ else }}Present{{ end }},
{{ .company.location }}
</p>
<!-- Add company overview -->
<p>{{ .company.overview | markdownify }}</p>
</div>
<!-- Add the positions information -->
<div class="positions">
{{ range $index,$position:= .positions }}
<h6 class="designation">{{ $position.designation }}</h6>
<p class="text-muted">{{ $position.start }} - {{if $position.end }} {{ $position.end }} {{else}} Present {{end}}</p>
<!-- Add the responsibilities handled at this position -->
<ul class="justify-content-around">
{{ range $position.responsibilities }}
<li>{{ . | markdownify }}</li>
{{ end }}
</ul>
{{ end }}
</div>
</div>

View file

@ -0,0 +1,21 @@
<div class="col-10 col-lg-8">
<div class="experience-entry-heading">
{{ $position:= index .positions 0 }}
<!-- For single position, give emphasis on the designation-->
<h5>{{ $position.designation }}</h5>
<h6>{{ if .company.url }}<a href={{.company.url}}>{{ .company.name }}</a>{{ else }}{{ .company.name }}{{ end }}</h6>
<!-- Add experience duration info -->
<p class="text-muted">{{ $position.start }} - {{ if $position.end }} {{ $position.end }} {{ else }}Present{{ end }},
{{ .company.location }}
</p>
</div>
<!-- Add company overview -->
<p>{{ .company.overview | markdownify }}</p>
<!-- Add the responsibilities handled at this position -->
<h6 class="text-muted">Responsibilities:</h6>
<ul class="justify-content-around">
{{ range $position.responsibilities }}
<li>{{ . | markdownify }}</li>
{{ end }}
</ul>
</div>