N°330 Attachments display as table : portal. Table is now responsive, attachment section is collapsable (collapsed by default)

This commit is contained in:
Pierre Goiffon
2019-12-17 14:27:34 +01:00
parent 705d941979
commit 01f34eea29
4 changed files with 134 additions and 46 deletions

View File

@@ -1061,27 +1061,27 @@ table .group-actions {
margin: 10px;
overflow-x: auto;
}
/* LinkedSet*/
.form_linkedset_toggler, .form_linkedset_toggler:hover, .form_linkedset_toggler:focus {
/* collapsable sections*/
.form_linkedset_toggler, .form_upload_toggler, .form_linkedset_toggler:hover, .form_upload_toggler:hover, .form_linkedset_toggler:focus, .form_upload_toggler:focus {
text-decoration: none;
color: inherit;
}
.form_linkedset_toggler > .text {
.form_linkedset_toggler > .text, .form_upload_toggler > .text {
margin-left: 0.4em;
}
.form_linkedset_toggler > .text:before {
.form_linkedset_toggler > .text:before, .form_upload_toggler > .text:before {
content: "(";
}
.form_linkedset_toggler > .text:after {
.form_linkedset_toggler > .text:after, .form_upload_toggler > .text:after {
content: ")";
}
.form_linkedset_toggler > .glyphicon {
.form_linkedset_toggler > .glyphicon, .form_upload_toggler > .glyphicon {
margin-left: 0.5em;
font-size: 0.85em;
color: #ea7d1e;
transition: transform 0.2s linear;
}
.form_linkedset_toggler > .glyphicon.collapsed {
.form_linkedset_toggler > .glyphicon.collapsed, .form_upload_toggler > .glyphicon.collapsed {
transform: rotateZ(-90deg);
}
/* - DataTables : Loader */
@@ -1111,17 +1111,18 @@ table .group-actions {
.fileupload_field_content > div {
margin-bottom: 15px;
}
.attachments_container .attachmentsList thead > tr > th {
.attachments_container .attachments-list thead > tr > th {
text-align: center;
}
.attachments_container .attachmentsList tbody > tr > td {
.attachments_container .attachments-list tbody > tr > td {
padding: 0.5rem 8px;
text-align: left;
vertical-align: middle;
}
.attachments_container .attachmentsList tbody > tr > td:first-child {
.attachments_container .attachments-list tbody > tr > td:first-child {
text-align: center;
}
.attachments_container .attachmentsList tbody > tr > td:nth-child(3) {
.attachments_container .attachments-list tbody > tr > td:nth-child(3) {
text-align: right;
}
.attachments_container .attachment {

View File

@@ -1142,31 +1142,34 @@ table .group-actions .item-action-wrapper .panel-body > p:last-child{
margin: 10px;
overflow-x: auto;
}
/* LinkedSet*/
.form_linkedset_toggler,
.form_linkedset_toggler:hover,
.form_linkedset_toggler:focus{
text-decoration: none;
color: inherit;
}
.form_linkedset_toggler > .text{
margin-left: 0.4em;
}
.form_linkedset_toggler > .text:before{
content: "(";
}
.form_linkedset_toggler > .text:after{
content: ")";
}
.form_linkedset_toggler > .glyphicon{
margin-left: 0.5em;
font-size: 0.85em;
color: $combodo-orange;
transition: transform 0.2s linear;
}
.form_linkedset_toggler > .glyphicon.collapsed{
transform: rotateZ(-90deg);
/* collapsable sections*/
.form_linkedset_toggler, .form_upload_toggler {
&, &:hover, &:focus {
text-decoration: none;
color: inherit;
}
& > .text {
margin-left: 0.4em;
}
& > .text:before {
content: "(";
}
& > .text:after {
content: ")";
}
& > .glyphicon{
margin-left: 0.5em;
font-size: 0.85em;
color: $combodo-orange;
transition: transform 0.2s linear;
}
& > .glyphicon.collapsed{
transform: rotateZ(-90deg);
}
}
/* - DataTables : Loader */
.form_linkedset_wrapper .datatables_overlay{
padding: 8px !important;
@@ -1195,12 +1198,13 @@ table .group-actions .item-action-wrapper .panel-body > p:last-child{
margin-bottom: 15px;
}
.attachments_container {
.attachmentsList {
.attachments-list {
& thead > tr > th {
text-align: center;
}
& tbody > tr > td {
padding: 0.5rem 8px;
text-align: left;
vertical-align: middle;

View File

@@ -1006,7 +1006,8 @@ class ObjectFormManager extends FormManager
// Adding attachment field
if ($bClassAllowed)
{
$oField = new FileUploadField('attachments_for_form_'.$oForm->GetId());
// set id to a unique key - avoid collisions with another attribute that could exist with the name 'attachments'
$oField = new FileUploadField('attachments_plugin');
$oField->SetLabel(Dict::S('Portal:Attachments'))
->SetUploadEndpoint($this->oContainer->get('url_generator')->generate('p_object_attachment_add'))
->SetDownloadEndpoint($this->oContainer->get('url_generator')->generate('p_object_attachment_download',