superdesk/superdesk-client-core

View on GitHub
scripts/apps/dashboard/workspace-tasks/views/task-preview.html

Summary

Maintainability
Test Coverage
<header>
    <p class="pull-left">{{ :: 'Created on' | translate}} <span sd-reldate-complex datetime="task._created"></span> {{ :: 'by' | translate}} {{ users[task.original_creator].display_name }}</p>
    <button ng-click="close()" class="icn-btn close-preview">
        <i class="icon-close-small"></i>
    </button>
</header>
<div class="content">
    <form name="taskForm">

        <div class="action-bar clearfix" ng-class="{show: editmode}">
            <button class="btn btn--primary pull-right" ng-click="save()" translate>Save</button>
            <button class="btn pull-right" ng-click="reset()" translate>Cancel</button>
        </div>
        <div class="action-menu">
            <button ng-click="edit()" class="change">
                <i class="icon-pencil"></i>
            </button>
            <div class="dropdown dropdown--big pull-right" dropdown>
                <button class="dropdown__toggle condensed" dropdown__toggle><i class="icon-dots-vertical"></i></button>
                <div class="dropdown__menu pull-right"
                    sd-activity-list
                    data-item="item"
                    data-type="task"
                    data-action="edit">
                </div>
            </div>
        </div>

        <ul class="task-labels clearfix" ng-if="!editmode">
            <li><i class="icon-time"></i> <time sd-datetime data-date="task_details.due_date"></time></li>
        </ul>
        <div ng-if="editmode" class="time-edit">
            <div class="field">
                <label translate>Due date</label>
                <div sd-datepicker ng-model="task_details.due_date"></div>
            </div>
            <div class="field">
                <label translate>Due time</label>
                <div sd-timepicker ng-model="task_details.due_time"></div>
            </div>
        </div>

        <div class="assignee-container" ng-if="!editmode">
            <div style="float: inline-start; margin-right: 10px;">
                <sd-user-avatar data-user="users[task_details.user]"></sd-user-avatar>
            </div>
            <div class="assignee-name">
                <span ng-show="task_details.desk">{{desks[task_details.desk].name}} / </span>
                <span ng-show="task_details.user">{{users[task_details.user].display_name}}</span>
                <span ng-hide="task_details.user" translate>Unassigned</span>
            </div>
        </div>
        <div ng-if="editmode" sd-assignee-box data-desk-id="task_details.desk" data-user-id="task_details.user"></div>

        <div ng-if="!editmode" class="title">{{ task.slugline }}</div>
        <textarea ng-if="editmode" class="title" sd-auto-height ng-model="task.slugline" placeholder="{{ :: 'Add title' | translate }}" required></textarea>

        <textarea ng-if="editmode" class="description" sd-auto-height ng-model="task.description_text" placeholder="{{ :: 'Add description' | translate }}"></textarea>
        <div ng-if="!editmode" class="description">{{ task.description_text }}</div>
    </form>

</div>