-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #724 from yuvipanda/profile_template
Allow building more complex profile_list templates
- Loading branch information
Showing
6 changed files
with
131 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
include LICENSE | ||
include README.md | ||
graft kubespawner/templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<style>{% include 'style.css' %}</style> | ||
<div class="form-group" id="kubespawner-profiles-list"> | ||
{%- for profile in profile_list %} | ||
{#- Wrap everything in a label tag so clicking anywhere selects the option #} | ||
<label for="profile-item-{{ profile.slug }}" class="profile"> | ||
<div class="radio"> | ||
<input type="radio" | ||
name="profile" | ||
id="profile-item-{{ profile.slug }}" | ||
value="{{ profile.slug }}" | ||
{% if profile.default %}checked{% endif %} /> | ||
</div> | ||
<div> | ||
<h3>{{ profile.display_name }}</h3> | ||
{%- if profile.description %}<p>{{ profile.description }}</p>{%- endif %} | ||
{%- if profile.profile_options %} | ||
<div> | ||
{%- for k, option in profile.profile_options.items() %} | ||
<div class="option"> | ||
<label for="profile-option-{{ profile.slug }}-{{ k }}">{{ option.display_name }}</label> | ||
<select name="profile-option-{{ profile.slug }}-{{ k }}" class="form-control"> | ||
{%- for k, choice in option['choices'].items() %} | ||
<option value="{{ k }}" {% if choice.default %}selected{% endif %}>{{ choice.display_name }}</option> | ||
{%- endfor %} | ||
</select> | ||
</div> | ||
{%- endfor %} | ||
</div> | ||
{%- endif %} | ||
</div> | ||
</label> | ||
{%- endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
.profile divs holds two div tags: one for a radio button, and one | ||
for the profile's content. | ||
*/ | ||
#kubespawner-profiles-list .profile { | ||
display: flex; | ||
flex-direction: row; | ||
font-weight: normal; | ||
border-bottom: 1px solid #ccc; | ||
padding-bottom: 12px; | ||
} | ||
|
||
#kubespawner-profiles-list .profile .radio { | ||
padding: 12px; | ||
} | ||
|
||
/* .option divs holds a label and a select tag */ | ||
#kubespawner-profiles-list .profile .option { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
padding-bottom: 12px; | ||
} | ||
|
||
#kubespawner-profiles-list .profile .option label { | ||
font-weight: normal; | ||
margin-right: 8px; | ||
min-width: 96px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters