From c95c09ffea6a47707d2eff090a75733121f08f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Sat, 2 Aug 2014 17:00:53 +0200 Subject: [PATCH] Refactor html of new-attachments --- .../modules/resources/attachments.coffee | 2 +- app/partials/views/modules/attachments.jade | 40 ++----------------- app/styles/modules/common/attachments.scss | 2 +- 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/app/coffee/modules/resources/attachments.coffee b/app/coffee/modules/resources/attachments.coffee index 9e76943d..7ebc59ec 100644 --- a/app/coffee/modules/resources/attachments.coffee +++ b/app/coffee/modules/resources/attachments.coffee @@ -43,7 +43,7 @@ resourceProvider = ($rootScope, $urls, $model, $repo, $auth, $q) -> file.status = "in-progress" file.size = sizeFormat(evt.total) file.progressMessage = "upload #{sizeFormat(evt.loaded)} of #{sizeFormat(evt.total)}" - file.progressPercent = Math.round((evt.loaded / evt.total) * 100) + file.progressPercent = "#{Math.round((evt.loaded / evt.total) * 100)}%" uploadComplete = (evt) => $rootScope.$apply -> diff --git a/app/partials/views/modules/attachments.jade b/app/partials/views/modules/attachments.jade index 4a4b755b..985881be 100644 --- a/app/partials/views/modules/attachments.jade +++ b/app/partials/views/modules/attachments.jade @@ -16,47 +16,15 @@ section.attachments(tg-attachments, ng-model=attachModel) tg-attachment="attach") //- See modules/common/attachments.coffee - AttachmentDirective - //- - //- An attachment ('deprecated' class for deprecxated attachments) - //-div.single-attachment - //- div.attachment-name - //- a(href="", title="Attachment pefildeusuario.png") pefildeusuariopefuario.png - //- div.attachment-comment - //- span.attachment-size (42 B) - //- span A sort description - //- a.settings.icon.icon-edit(href="", "Edit") - //- a.settings.icon.icon-delete(href="", "Delete") - //- a.settings.icon.icon-drag-v(href="", "Drag") - //- - //- An edittable attachment ('deprecated' class for deprecxated attachments) - //-div.single-attachment - //- div.attachment-name - //- a(href="", title="Attachment pefildeusuario.png") pefildeusuariopefuario.png - //- div.editable.editable-attachment-comment - //- span.attachment-size (42 B) - //- input(type="text") - //- div.editable.editable-attachment-deprecated - //- label Deprecated? - //- input(type="checkbox") - //- a.editable.icon.icon-floppy(href="#", "Save") - //- a.editable.icon.icon-delete(href="#", "Cancel") - - //- div.single-attachment(ng-repeat="file in uploadingFiles") - //- div.attachment-name - //- span - //- a(href="", title="{{ file.name }}") file.name - //- div.attachment-comment - //- span.attachment-size ({{ file.size }}) - //- span(ng-if="file.progressMessage", style="color:#72a114; font-weight: bold;") {{ file.progressMessage }} | {{ file.progressPercent }}% div.single-attachment(ng-repeat="file in uploadingFiles") div.attachment-name - a(href="", title="{{ file.name }}") {{ file.name }} + a(href="", tg-bo-title="file.name", tg-bo-html="file.name") div.attachment-size - span.attachment-size {{ file.size }} + span.attachment-size(tg-bo-html="file.size") div.attachment-comments - span {{ file.progressMessage }} - div.percentage(style="width: {{ file.progressPercent }}%") + span(ng-bind="file.progressMessage") + div.percentage(ng-style="{'width': file.progressPercent}") div.attachment-settings a.hidden.more-attachments(href="", title="show deprecated atachments") diff --git a/app/styles/modules/common/attachments.scss b/app/styles/modules/common/attachments.scss index 8da5c117..016472da 100644 --- a/app/styles/modules/common/attachments.scss +++ b/app/styles/modules/common/attachments.scss @@ -135,7 +135,7 @@ .percentage { background: rgba($green-taiga, .1); bottom: 0; - height: 55px; + height: 40px; left: 0; position: absolute; top: 0;