Skip to content

Commit

Permalink
added the ability to add extra information to fields
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jan 17, 2023
1 parent 795f3b6 commit 552ba2c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
13 changes: 13 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ paths:
text: 'Boltzmannstr. 3, EG, 85748 Garching b. München'
- name: Sitzplätze
text: '522'
extra:
header: Genauere Angaben
body: "für Prüfungen: 102 in eng, 71 in weit, 49 in corona"

calendar_url: 'https://campus.tum.de/tumonline/tvKalender.wSicht?cOrg=19691&cRes=12559&cReadonly=J'
ranking_factors:
rank_combined: 900
Expand Down Expand Up @@ -1089,6 +1093,15 @@ components:
text:
type: string
example: 5602.EG.001
extra:
type: object
properties:
header:
type: string
example: Genauere Angaben
body:
type: string
example: "für Prüfungen: 102 in eng, 71 in weit, 49 in corona"
required:
- name
- text
Expand Down
41 changes: 39 additions & 2 deletions webclient/src/views/view/view-view.inc
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,24 @@
<tbody>
<tr v-for="prop in view_data.props.computed">
<td><strong>{{ prop.name }}</strong></td>
<td>{{ prop.text }}</td>
<td>{{ prop.text }}
<div class="popover ms-2" v-if="prop.extra?.body">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
</svg>
<div class="popover-container">
<div class="card">
<div class="card-header h6" v-if="prop.extra.header">
{{prop.extra.header}}
</div>
<div class="card-body">
{{prop.extra.body}}
</div>
</div>
</div>
</div>
</td>
</tr>
<tr v-if="view_data.props.links">
<td><strong>${{ _.view_view.info_table.links }}$</strong></td>
Expand Down Expand Up @@ -440,7 +457,27 @@
<tbody>
<tr v-for="prop in view_data.props.computed">
<td><strong>{{ prop.name }}</strong></td>
<td>{{ prop.text }}</td>
<td>{{ prop.text }}
<div class="popover" v-if="prop.extra?.body">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
</svg>
<div class="popover-container">
<div class="card">
<div class="card-header" v-if="prop.extra.header">
{{ prop.extra.header }}
</div>
<div class="card-body">
{{ prop.extra.body }}
</div>
<div class="card-footer" v-if="prop.extra.footer">
{{ prop.extra.footer }}
</div>
</div>
</div>
</div>
</td>
</tr>
<tr v-if="view_data.props.links">
<td><strong>${{ _.view_view.info_table.links }}$</strong></td>
Expand Down
5 changes: 5 additions & 0 deletions webclient/src/views/view/view-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@
&:last-child {
border-bottom: 0;
}

&.popover svg {
margin-left: 5px;
margin-bottom: -2px;
}
}

ul {
Expand Down

0 comments on commit 552ba2c

Please sign in to comment.