Skip to content

Home Information - Your home, your data, organized.

Python

Continued layout/style improvements. WIP

Anthony Cassandra1d616ae21f08
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form.html
index 3518e46d..63ac6308 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_form.html
@@ -26,16 +26,7 @@
{% endif %}
{% else %}
- <div class="text-center">
- <button class="btn btn-info" type="button"
- data-toggle="collapse" data-target="#collapseExample"
- aria-expanded="false" aria-controls="collapseExample">
- ADD NEW ATTRIBUTE
- </button>
- </div>
- <div class="collapse" id="collapseExample">
- {% include "attribute/panes/attribute_form_new.html" %}
- </div>
+ {% include "attribute/panes/attribute_form_new.html" %}
{% endif %}
{{ attribute_form.name.error }}
diff --git a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
index 3cc8e740..e518c317 100644
--- a/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
+++ b/src/hi/apps/attribute/templates/attribute/panes/attribute_form_new.html
@@ -1,27 +1,36 @@
-<div class="h5">Add</div>
-
-<div class="input-group" >
- <label for="{{ attribute_form.name.id_for_label }}">{{ attribute_form.name.label }}</label>
- <input type="text"
- id="{{ attribute_form.name.id_for_label }}"
- name="{{ attribute_form.name.html_name }}"
- value="{{ attribute_form.name.value|default_if_none:'' }}">
- <div class="form-error text-danger" >{{ attribute_form.name.errors }}</div>
+<div>
+ <a class="" data-toggle="collapse" href="#collapseExample"
+ role="button" aria-expanded="false" aria-controls="collapseExample">
+ <span class="plus-icon">&#43;</span> Add New Attribute
+ </a>
</div>
-<div class="input-group">
- <label for="{{ attribute_form.value.id_for_label }}">{{ attribute_form.value.label }}</label>
- <textarea rows="2" cols="40"
- id="{{ attribute_form.value.id_for_label }}"
- name="{{ attribute_form.value.html_name }}"
- >{{ attribute_form.value.value|default_if_none:'' }}</textarea>
- <div class="form-error text-danger" >{{ attribute_form.value.errors }}</div>
+<div class="collapse" id="collapseExample">
-</div>
+ <div class="form-group" >
+ <label for="{{ attribute_form.name.id_for_label }}">New {{ attribute_form.name.label }}</label>
+ <input type="text"
+ id="{{ attribute_form.name.id_for_label }}"
+ class="form-control"
+ name="{{ attribute_form.name.html_name }}"
+ value="{{ attribute_form.name.value|default_if_none:'' }}">
+ <div class="form-error text-danger" >{{ attribute_form.name.errors }}</div>
+ </div>
+ <div class="form-group">
+ <label for="{{ attribute_form.value.id_for_label }}">New {{ attribute_form.value.label }}</label>
+ <textarea rows="2" cols="40"
+ id="{{ attribute_form.value.id_for_label }}"
+ class="form-control"
+ name="{{ attribute_form.value.html_name }}"
+ >{{ attribute_form.value.value|default_if_none:'' }}</textarea>
+ <div class="form-error text-danger" >{{ attribute_form.value.errors }}</div>
-<span>
- <input type="checkbox" name="{{ attribute_form.secret.html_name }}"
- id="{{ attribute_form.secret.id_for_label }}"
- {% if attribute_form.secret.value %}checked="on"{% endif %} >
- <label for="{{ attribute_form.secret.id_for_label }}">Mark as secret</label>
-</span>
+ </div>
+
+ <span>
+ <input type="checkbox" name="{{ attribute_form.secret.html_name }}"
+ id="{{ attribute_form.secret.id_for_label }}"
+ {% if attribute_form.secret.value %}checked="on"{% endif %} >
+ <label for="{{ attribute_form.secret.id_for_label }}">Mark as secret</label>
+ </span>
{{ attribute_form.secret.errors }}
+</div>
diff --git a/src/hi/apps/collection/templates/collection/edit/panes/collection_form.html b/src/hi/apps/collection/templates/collection/edit/panes/collection_form.html
index 6e20c849..4bf015be 100644
--- a/src/hi/apps/collection/templates/collection/edit/panes/collection_form.html
+++ b/src/hi/apps/collection/templates/collection/edit/panes/collection_form.html
@@ -10,8 +10,8 @@
</div>
{% endif %}
-<div>
- <div class="input-group mb-2 mr-sm-2">
+<div class="hi-custom-select">
+ <div class="input-group mb-2 mr-sm-2 ">
<div class="input-group-prepend">
<div class="input-group-text">{{ collection_form.collection_type_str.label_tag }}</div>
</div>
@@ -20,7 +20,7 @@
{{ collection_form.collection_type_str.errors }}
</div>
-<div>
+<div class="hi-custom-select">
<div class="input-group mb-2 mr-sm-2">
<div class="input-group-prepend">
<div class="input-group-text">{{ collection_form.collection_view_type_str.label_tag }}</div>
diff --git a/src/hi/apps/entity/forms.py b/src/hi/apps/entity/forms.py
index 1ef6526c..11402ae3 100644
--- a/src/hi/apps/entity/forms.py
+++ b/src/hi/apps/entity/forms.py
@@ -15,7 +15,7 @@ class EntityForm( forms.ModelForm ):
)
entity_type_str = forms.ChoiceField(
- label = 'Entity Type',
+ label = 'Item Type',
choices = EntityType.choices,
initial = EntityType.default_value(),
required = True,
diff --git a/src/hi/apps/entity/templates/entity/edit/modals/entity_add.html b/src/hi/apps/entity/templates/entity/edit/modals/entity_add.html
index be503b50..e2adcd3c 100644
--- a/src/hi/apps/entity/templates/entity/edit/modals/entity_add.html
+++ b/src/hi/apps/entity/templates/entity/edit/modals/entity_add.html
@@ -7,7 +7,7 @@
{% endblock %}
{% block title_text %}
-New Entity
+New Location Item
{% endblock %}
{% block body %}
diff --git a/src/hi/apps/entity/templates/entity/edit/modals/entity_delete.html b/src/hi/apps/entity/templates/entity/edit/modals/entity_delete.html
index 9c517ef4..218e51dd 100644
--- a/src/hi/apps/entity/templates/entity/edit/modals/entity_delete.html
+++ b/src/hi/apps/entity/templates/entity/edit/modals/entity_delete.html
@@ -1,13 +1,13 @@
{% extends "modals/action_with_cancel.html" %}
{% block title_text %}
-Delete Entity?
+Delete Location Item?
{% endblock %}
{% block body %}
<div>
- Please confirm that you want to delete the entity:
+ Please confirm that you want to delete this item:
<ul>
{{ entity.name }}
</ul>
diff --git a/src/hi/apps/entity/templates/entity/edit/panes/entity_details.html b/src/hi/apps/entity/templates/entity/edit/panes/entity_details.html
index ec809ab5..3094a36e 100644
--- a/src/hi/apps/entity/templates/entity/edit/panes/entity_details.html
+++ b/src/hi/apps/entity/templates/entity/edit/panes/entity_details.html
@@ -3,7 +3,7 @@
{% endif %}
<div class="d-flex justify-content-between">
- <div class="h5"><small>Entity</small>: {{ entity.name }}</div>
+ <div class="h5"><small>Item</small>: {{ entity.name }}</div>
<div class="">
<a href="{% url 'edit_item_details_close' %}"
class="btn btn-tertiary" role="button" data-async="true">
@@ -72,7 +72,7 @@
<div class="">
<a href="{% url 'entity_edit_entity_delete' entity_id=entity.id %}"
class="btn btn-danger btn-control" role="button" data-async="true">
- DELETE ENTITY
+ DELETE ITEM
</a>
</div>
{% else %}
diff --git a/src/hi/apps/entity/templates/entity/edit/panes/entity_form.html b/src/hi/apps/entity/templates/entity/edit/panes/entity_form.html
index da187ae5..37f80628 100644
--- a/src/hi/apps/entity/templates/entity/edit/panes/entity_form.html
+++ b/src/hi/apps/entity/templates/entity/edit/panes/entity_form.html
@@ -10,7 +10,7 @@
</div>
{% endif %}
-<div>
+<div class="hi-custom-select">
<div class="input-group mb-2 mr-sm-2">
<div class="input-group-prepend">
<div class="input-group-text">{{ entity_form.entity_type_str.label_tag }}</div>
@@ -19,16 +19,19 @@
</div>
{{ entity_form.entity_type_str.errors }}
</div>
-
-<div>
- {{ entity_form.name.label }}
- {{ entity_form.name }}
- {{ entity_form.name.errors }}
-</div>
-<div class="h5">Attributes</div>
+<div class="input-group">
+ <div class="input-group-prepend">
+ <label for="{{ entity_form.name.id_for_label }}"
+ class="input-group-text">{{ entity_form.name.label }}</label>
+ {{ entity_form.name }}
+ <small class="form-error text-danger">{{ entity_form.name.errors }}</small>
+ </div>
+</div>
+{% if entity_form.entity.pk %}
+<div class="h4">Attributes</div>
<div>
{% include "attribute/panes/attribute_form.html" with attribute_formset=entity_attribute_formset %}
</div>
-
+{% endif %}
diff --git a/src/hi/apps/location/edit/forms.py b/src/hi/apps/location/edit/forms.py
index 62319923..0565144c 100644
--- a/src/hi/apps/location/edit/forms.py
+++ b/src/hi/apps/location/edit/forms.py
@@ -66,7 +66,7 @@ class LocationEditForm( forms.ModelForm ):
)
widgets = {
'name': forms.TextInput( attrs={'class': 'form-control'} ),
- 'order_id': forms.TextInput( attrs={'class': 'form-control'} ),
+ 'order_id': forms.NumberInput( attrs={'class': 'form-control'} ),
}
@@ -105,14 +105,12 @@ class LocationViewEditForm( forms.ModelForm ):
model = LocationView
fields = (
'name',
- 'order_id',
- 'svg_view_box_str',
- 'svg_rotate',
'location_view_type_str',
'svg_style_name_str',
)
-
- svg_rotate = SvgDecimalFormField()
+ widgets = {
+ 'name': forms.TextInput( attrs={'class': 'form-control'} ),
+ }
location_view_type_str = forms.ChoiceField(
label = 'View Type',
@@ -122,7 +120,7 @@ class LocationViewEditForm( forms.ModelForm ):
widget = forms.Select( attrs = { 'class' : 'custom-select' } ),
)
svg_style_name_str = forms.ChoiceField(
- label = 'SVG Style Name',
+ label = 'Style',
choices = SvgStyleName.choices,
initial = SvgStyleName.default_value(),
required = True,
diff --git a/src/hi/apps/location/models.py b/src/hi/apps/location/models.py
index 7f607177..3716ed3b 100644
--- a/src/hi/apps/location/models.py
+++ b/src/hi/apps/location/models.py
@@ -142,7 +142,7 @@ class LocationView( models.Model, ItemTypeModelMixin ):
'Rotate',
)
svg_style_name_str = models.CharField(
- 'Style Name',
+ 'Style',
max_length = 32,
null = False, blank = False,
)
diff --git a/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html b/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html
index 6a644e09..34ce4b4b 100644
--- a/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html
+++ b/src/hi/apps/location/templates/location/edit/panes/location_view_edit.html
@@ -6,14 +6,15 @@
<div>
{% include "location/edit/panes/location_view_edit_form.html" %}
</div>
-
- <button id="hi-add-location-view-button" type="submit" class="btn btn-info"
- name="action" value="update">
- UPDATE
- </button>
+ <div class="text-center" >
+ <button id="hi-add-location-view-button" type="submit" class="btn btn-info"
+ name="action" value="update">
+ UPDATE
+ </button>
+ </div>
</form>
-<div>
+<div class="my-3">
<a href="{% url 'location_edit_location_view_delete' location_view_id=location_view.id %}"
id="hi-delete-location-view-link" class="btn btn-danger btn-control" role="button"
data-async="true">
diff --git a/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.html b/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.html
index 2786c037..3255451c 100644
--- a/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.html
+++ b/src/hi/apps/location/templates/location/edit/panes/location_view_edit_form.html
@@ -10,38 +10,31 @@
</div>
{% endif %}
-<div>
- {{ location_view_edit_form.name.label }}
+<div class="form-group">
+ <label for="{{ location_view_edit_form.name.id_for_label }}">{{ location_view_edit_form.name.label }}</label>
{{ location_view_edit_form.name }}
- {{ location_view_edit_form.name.errors }}
+ <small class="form-error text-danger">{{ location_view_edit_form.name.errors }}</small>
</div>
-<div>
- {{ location_view_edit_form.order_id.label }}
- {{ location_view_edit_form.order_id }}
- {{ location_view_edit_form.order_id.errors }}
-</div>
-<div>
- {{ location_view_edit_form.svg_view_box_str.label }}
- {{ location_view_edit_form.svg_view_box_str }}
- {{ location_view_edit_form.svg_view_box_str.errors }}
-</div>
-<div>
- {{ location_view_edit_form.svg_rotate.label }}
- {{ location_view_edit_form.svg_rotate }}
- {{ location_view_edit_form.svg_rotate.errors }}
-</div>
-<div>
+<div class=" hi-custom-select">
<div class="input-group mb-2 mr-sm-2">
<div class="input-group-prepend">
- <div class="input-group-text">{{ location_view_edit_form.location_view_type_str.label_tag }}</div>
+ <label for="{{ location_view_edit_form.location_view_type_str.id_for_label }}"
+ class="input-group-text">{{ location_view_edit_form.location_view_type_str.label_tag }}</label>
</div>
{{ location_view_edit_form.location_view_type_str }}
</div>
{{ location_view_edit_form.location_view_type_str.errors }}
</div>
-<div>
- {{ location_view_edit_form.svg_style_name_str.label }}
- {{ location_view_edit_form.svg_style_name_str }}
+
+<div class="hi-custom-select">
+ <div class="input-group mb-2 mr-sm-2">
+ <div class="input-group-prepend">
+ <div for="{{ location_view_edit_form.svg_style_name_str.id_for_label }}"
+ class="input-group-text">{{ location_view_edit_form.svg_style_name_str.label_tag }}</div>
+ </div>
+ {{ location_view_edit_form.svg_style_name_str }}
+ </div>
{{ location_view_edit_form.svg_style_name_str.errors }}
</div>
+
diff --git a/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html b/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html
index 97a40c43..f55d3155 100644
--- a/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html
+++ b/src/hi/apps/location/templates/location/edit/panes/location_view_manage_items.html
@@ -4,7 +4,8 @@
{% include "edit/panes/side_header.html" %}
{% endif %}
- <div class="h4 mt-2">Display Items</div>
+ <hr />
+ <div class="h4">Display Items</div>
<div class="">
<a href="{% url 'entity_edit_entity_add' %}"
@@ -22,7 +23,7 @@
{% endfor %}
</div>
{% empty %}
- <div><em>No items defined.</em></div>
+ <div class="mt-3"><em>No items defined.</em></div>
{% endfor %}
{% if collection_view_group.item_list %}
diff --git a/src/hi/static/css/main.css b/src/hi/static/css/main.css
index de111af4..e6916b17 100644
--- a/src/hi/static/css/main.css
+++ b/src/hi/static/css/main.css
@@ -237,7 +237,16 @@ a.underline:visited {
.form-group label {
color: var(--muted-color) !important;
}
-
+.hi-custom-select .input-group-text {
+ height: calc(1.5em + 0.75rem + 2px);
+ line-height: 1.5;
+}
+.plus-icon {
+ font-size: 1.5rem;
+ color: var(--on-status-ok-color);
+ background-color: var(--status-ok-color);
+ padding: 0 0.25rem 0 0.25rem;
+}
#hi-server-error-msg {
position: fixed;
display: none;