-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: reformat instrument detail init
- Loading branch information
1 parent
ca06214
commit f552546
Showing
6 changed files
with
323 additions
and
300 deletions.
There are no files selected for viewing
196 changes: 99 additions & 97 deletions
196
web-app/django/VIM/apps/instruments/static/instruments/css/detail.css
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,97 +1,99 @@ | ||
.instrument-detail { | ||
display: flex; | ||
flex-wrap: nowrap; | ||
align-items: center; | ||
flex-direction: column; | ||
padding: 50px; | ||
} | ||
.detail-header { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
flex-wrap: wrap; | ||
width: 100%; | ||
} | ||
.detail-header hr { | ||
width: 100%; | ||
} | ||
.detail-body { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
justify-content: space-evenly; | ||
align-items: flex-start; | ||
width: 100%; | ||
} | ||
.detail-image { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
} | ||
.instrument-image { | ||
max-width: 50%; | ||
margin-right: 10px; | ||
} | ||
.detail-image-caption { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
} | ||
.instrument-forms { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
width: 100%; | ||
} | ||
.name-form-item { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
.name-field { | ||
width: 90%; | ||
} | ||
input.edit-field { | ||
width: inherit; | ||
} | ||
th[scope="col"] { | ||
width: 30%; | ||
} | ||
th[scope="row"] { | ||
width: 20%; | ||
} | ||
.button-group { | ||
display:flex; | ||
flex-direction: row; | ||
} | ||
.edit-field, .btn.cancel, .btn.publish { | ||
display: none; | ||
} | ||
.btn { | ||
display: inline-block; | ||
padding: 5px 10px; | ||
cursor: pointer; | ||
text-align: center; | ||
text-decoration: none; | ||
outline: none; | ||
color: #fff; | ||
border: none; | ||
border-radius: 3px; | ||
margin-right: 5px; | ||
} | ||
.btn.edit { | ||
background-color: #ffc107; | ||
} | ||
.btn.cancel { | ||
background-color: #dc3545; | ||
} | ||
.btn.publish { | ||
background-color: #28a745; | ||
} | ||
.instrument-detail { | ||
display: flex; | ||
flex-wrap: nowrap; | ||
align-items: center; | ||
flex-direction: column; | ||
padding: 50px; | ||
} | ||
.detail-header { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
flex-wrap: wrap; | ||
width: 100%; | ||
} | ||
.detail-header hr { | ||
width: 100%; | ||
} | ||
.detail-body { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
justify-content: space-evenly; | ||
align-items: flex-start; | ||
width: 100%; | ||
} | ||
.detail-image { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
} | ||
.instrument-image { | ||
max-width: 50%; | ||
margin-right: 10px; | ||
} | ||
.detail-image-caption { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
} | ||
.instrument-forms { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
width: 100%; | ||
} | ||
.name-form-item { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
.name-field { | ||
width: 90%; | ||
} | ||
input.edit-field { | ||
width: inherit; | ||
} | ||
th[scope='col'] { | ||
width: 30%; | ||
} | ||
th[scope='row'] { | ||
width: 20%; | ||
} | ||
.button-group { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.edit-field, | ||
.btn.cancel, | ||
.btn.publish { | ||
display: none; | ||
} | ||
.btn { | ||
display: inline-block; | ||
padding: 5px 10px; | ||
cursor: pointer; | ||
text-align: center; | ||
text-decoration: none; | ||
outline: none; | ||
color: #fff; | ||
border: none; | ||
border-radius: 3px; | ||
margin-right: 5px; | ||
} | ||
.btn.edit { | ||
background-color: #ffc107; | ||
} | ||
.btn.cancel { | ||
background-color: #dc3545; | ||
} | ||
.btn.publish { | ||
background-color: #28a745; | ||
} |
6 changes: 3 additions & 3 deletions
6
web-app/django/VIM/apps/instruments/static/instruments/css/index.css
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,9 +1,9 @@ | ||
@import url('https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css'); | ||
|
||
h2 { | ||
color: #435334; | ||
font-size: 30px; | ||
font-weight: 800; | ||
color: #435334; | ||
font-size: 30px; | ||
font-weight: 800; | ||
} | ||
|
||
h4 { | ||
|
83 changes: 41 additions & 42 deletions
83
web-app/django/VIM/apps/instruments/static/instruments/js/InstrumentDetail.js
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,42 +1,41 @@ | ||
|
||
document.addEventListener('DOMContentLoaded', function() { | ||
const editButtons = document.querySelectorAll('.btn.edit'); | ||
const cancelButtons = document.querySelectorAll('.btn.cancel'); | ||
const publishButtons = document.querySelectorAll('.btn.publish'); | ||
|
||
editButtons.forEach(button => { | ||
button.addEventListener('click', function() { | ||
const parentTd = this.closest('td'); | ||
parentTd.querySelector('.view-field').style.display = 'none'; | ||
parentTd.querySelector('.edit-field').style.display = 'inline-block'; | ||
parentTd.querySelector('.btn.cancel').style.display = 'inline-block'; | ||
parentTd.querySelector('.btn.publish').style.display = 'inline-block'; | ||
this.style.display = 'none'; | ||
}); | ||
}); | ||
|
||
cancelButtons.forEach(button => { | ||
button.addEventListener('click', function() { | ||
const parentTd = this.closest('td'); | ||
parentTd.querySelector('.view-field').style.display = 'inline'; | ||
parentTd.querySelector('.edit-field').style.display = 'none'; | ||
parentTd.querySelector('.btn.edit').style.display = 'inline-block'; | ||
parentTd.querySelector('.btn.publish').style.display = 'none'; | ||
this.style.display = 'none'; | ||
}); | ||
}); | ||
|
||
publishButtons.forEach(button => { | ||
button.addEventListener('click', function() { | ||
const parentTd = this.closest('td'); | ||
const newValue = parentTd.querySelector('.edit-field').value; | ||
// TODO: request to update the value on the server | ||
parentTd.querySelector('.view-field').textContent = newValue; | ||
parentTd.querySelector('.view-field').style.display = 'inline'; | ||
parentTd.querySelector('.edit-field').style.display = 'none'; | ||
parentTd.querySelector('.btn.edit').style.display = 'inline-block'; | ||
this.style.display = 'none'; | ||
parentTd.querySelector('.btn.cancel').style.display = 'none'; | ||
}); | ||
}); | ||
}); | ||
document.addEventListener('DOMContentLoaded', function () { | ||
const editButtons = document.querySelectorAll('.btn.edit'); | ||
const cancelButtons = document.querySelectorAll('.btn.cancel'); | ||
const publishButtons = document.querySelectorAll('.btn.publish'); | ||
|
||
editButtons.forEach((button) => { | ||
button.addEventListener('click', function () { | ||
const parentTd = this.closest('td'); | ||
parentTd.querySelector('.view-field').style.display = 'none'; | ||
parentTd.querySelector('.edit-field').style.display = 'inline-block'; | ||
parentTd.querySelector('.btn.cancel').style.display = 'inline-block'; | ||
parentTd.querySelector('.btn.publish').style.display = 'inline-block'; | ||
this.style.display = 'none'; | ||
}); | ||
}); | ||
|
||
cancelButtons.forEach((button) => { | ||
button.addEventListener('click', function () { | ||
const parentTd = this.closest('td'); | ||
parentTd.querySelector('.view-field').style.display = 'inline'; | ||
parentTd.querySelector('.edit-field').style.display = 'none'; | ||
parentTd.querySelector('.btn.edit').style.display = 'inline-block'; | ||
parentTd.querySelector('.btn.publish').style.display = 'none'; | ||
this.style.display = 'none'; | ||
}); | ||
}); | ||
|
||
publishButtons.forEach((button) => { | ||
button.addEventListener('click', function () { | ||
const parentTd = this.closest('td'); | ||
const newValue = parentTd.querySelector('.edit-field').value; | ||
// TODO: request to update the value on the server | ||
parentTd.querySelector('.view-field').textContent = newValue; | ||
parentTd.querySelector('.view-field').style.display = 'inline'; | ||
parentTd.querySelector('.edit-field').style.display = 'none'; | ||
parentTd.querySelector('.btn.edit').style.display = 'inline-block'; | ||
this.style.display = 'none'; | ||
parentTd.querySelector('.btn.cancel').style.display = 'none'; | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.