diff --git a/assets/default/css/theme.css b/assets/default/css/theme.css index 26680176598c1b8916aaccacb041713d34074a16..50ffe968a7099930a1714c47ed092b8bf13265db 100644 --- a/assets/default/css/theme.css +++ b/assets/default/css/theme.css @@ -1259,3 +1259,22 @@ img.avatar { border-bottom: 2px solid #ddd; border-bottom-color: rgba(0,0,0,0.1); } + +.freetext-files { + padding: 10px; + margin-top: 10px; + border: 1px dotted #ddd; + border-radius: 4px; + background-color: #f5f5f5; +} +.freetext-files .file { + margin-right: 10px; + display: inline-block; + width: 48%; + padding-top: 0.2em; +} +.freetext-files .title { + font-weight: bold; + margin-bottom: 0.3em; + font-size: 1.1em; +} diff --git a/include/class.forms.php b/include/class.forms.php index 5112c0aefdab633050c213443161cc9a55148739..bfbe4f12e478163b891102e622e01ae3bec11f3b 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -3193,6 +3193,7 @@ class FreeTextField extends FormField { )), 'attachments' => new FileUploadField(array( 'id'=>'attach', + 'label' => __('Attachments'), 'name'=>'files', 'configuration' => array('extensions'=>'') )), @@ -3248,7 +3249,7 @@ class FreeTextField extends FormField { class FreeTextWidget extends Widget { function render($options=array()) { $config = $this->field->getConfiguration(); - ?><div class=""><?php + ?><div class="thread-body" style="padding:0"><?php if ($label = $this->field->getLocal('label')) { ?> <h3><?php echo Format::htmlchars($label); @@ -3264,12 +3265,13 @@ class FreeTextWidget extends Widget { </div> <?php if (($attachments=$this->field->getFiles())) { ?> - <br/> - <section> + <section class="freetext-files"> + <div class="title"><?php echo __('Related Resources'); ?></div> <?php foreach ($attachments as $attach) { ?> - <div> + <div class="file"> <a href="<?php echo $attach->file->getDownloadUrl(); ?>" - target="_blank" class="no-pjax"> + target="_blank" download="<?php echo $attach->file->getDownloadUrl(); + ?>" class="truncate no-pjax"> <i class="icon-file"></i> <?php echo Format::htmlchars($attach->getFilename()); ?> </a> diff --git a/include/client/templates/dynamic-form.tmpl.php b/include/client/templates/dynamic-form.tmpl.php index bcfc9ada252471feb406527b69b274ff945e183f..7a23a4546e734458d2ec14c491da0db26788e105 100644 --- a/include/client/templates/dynamic-form.tmpl.php +++ b/include/client/templates/dynamic-form.tmpl.php @@ -18,7 +18,7 @@ continue; ?> <tr> - <td colspan="2" style="padding-top:8px;"> + <td colspan="2" style="padding-top:10px;"> <?php if (!$field->isBlockLevel()) { ?> <label for="<?php echo $field->getFormName(); ?>"><span class="<?php if ($field->isRequiredForUsers()) echo 'required'; ?>"> diff --git a/scp/css/scp.css b/scp/css/scp.css index c965cb7a97cc4a025750ed740c6e0123b532ff97..cb29126b62d20bacc0fedf2150f847c8195ee254 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -2430,3 +2430,22 @@ td.indented { width: calc(100% - 95px); line-height: 1.4em; } + +.freetext-files { + padding: 10px; + margin-top: 10px; + border: 1px dotted #ddd; + border-radius: 4px; + background-color: #f5f5f5; +} +.freetext-files .file { + margin-right: 10px; + display: inline-block; + width: 48%; + padding-top: 0.2em; +} +.freetext-files .title { + font-weight: bold; + margin-bottom: 0.3em; + font-size: 1.1em; +}