Skip to content

Commit

Permalink
feat(access): add notes field to organization
Browse files Browse the repository at this point in the history
!28 #39 #13
  • Loading branch information
jon-nfc committed Jun 17, 2024
1 parent 14acea3 commit 8486618
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/access/forms/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Meta:
model = Organization
fields = [
'name',
'slug',
'manager',
'model_notes',
]


Expand Down
6 changes: 6 additions & 0 deletions app/access/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def save(self, *args, **kwargs):
help_text = 'Organization Manager'
)

model_notes = models.TextField(
blank = True,
default = None,
null= True,
)

slug = AutoSlugField()

created = AutoCreatedField()
Expand Down
84 changes: 78 additions & 6 deletions app/access/templates/access/organization.html.j2
Original file line number Diff line number Diff line change
@@ -1,17 +1,89 @@
{% extends 'base.html.j2' %}

{% load markdown %}

{% block title %}Organization - {{ organization.name }}{% endblock %}

{% block content %}
<style>
form div .helptext {
background-color: rgb(0, 140, 255);
display: block;
}
.detail-view-field {
display:unset;
height: 30px;
line-height: 30px;
padding: 0px 20px 40px 20px;
}
.detail-view-field label {
display: inline-block;
font-weight: bold;
width: 200px;
margin: 10px;
/*padding: 10px;*/
height: 30px;
line-height: 30px;
}
.detail-view-field span {
display: inline-block;
width: 340px;
margin: 10px;
/*padding: 10px;*/
border-bottom: 1px solid #ccc;
height: 30px;
line-height: 30px;
}
</style>

<div style="align-items:flex-start; align-content: center; display: flexbox; width: 100%">
<div style="display: inline; width: 40%; margin: 30px;">

<div class="detail-view-field">
<label>{{ form.name.label }}</label>
<span>{{ form.name.value }}</span>
</div>

<div class="detail-view-field">
<label>{{ form.manager.label }}</label>
<span>{{ form.manager.value }}</span>
</div>

<div class="detail-view-field">
<label>{{ form.created.label }}</label>
<span>{{ form.created.value }}</span>
</div>

<div class="detail-view-field">
<label>{{ form.modified.label }}</label>
<span>{{ form.modified.value }}</span>
</div>

</div>

<form>
<div>{{ form.as_p }}</div>
</form>
<div style="display: inline; width: 40%; margin: 30px; text-align: left;">
<div>
<label style="font-weight: bold; width: 100%; border-bottom: 1px solid #ccc; display: block; text-align: inherit;">{{ form.model_notes.label }}</label>

{% include 'icons/issue_link.html.j2' with issue=13 %}<br>
<div style="display: inline-block; text-align: left;">{{ form.model_notes.value | markdown | safe }}</div>
</div>
</div>

<input type="button" value="<< Back" onclick="window.location='{% url 'Access:Organizations' %}';">
<input type="button" value="New Team" onclick="window.location='{% url 'Access:_team_add' organization.id %}';">
<div style="display: block;">
<input type="button" value="<< Back" onclick="window.location='{% url 'Access:Organizations' %}';">
<input type="button" value="New Team" onclick="window.location='{% url 'Access:_team_add' organization.id %}';">
</div>

<hr />
<table>
Expand Down
2 changes: 1 addition & 1 deletion app/itam/templates/itam/device.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
Details
<span style="font-weight: normal; float: right;">{% include 'icons/issue_link.html.j2' with issue=6 %}</span>
</h3>
<div align-items:flex-start; align-content: center; display: flexbox; width: 100%">
<div style="align-items:flex-start; align-content: center; display: flexbox; width: 100%">

<div style="display: inline; width: 40%; margin: 30px;">

Expand Down

0 comments on commit 8486618

Please sign in to comment.