SmartIT_Extensions/BMC/smart-it-full/views/feed/feed-add-note-form.html

137 lines
7.2 KiB
HTML

<div class="timeline-note">
<div class="timeline-note__flag-label" ng-if="addFlagNote && flag"><i class="icon-flag"></i>{{'timeline.note.flag.label' | i18n}}</div>
<div class="timeline-note__flag-label" ng-if="addFlagNote && !flag"><i class="icon-flag"></i>{{'timeline.note.removeFlag.label' | i18n}}</div>
<div class="timeline-note__container">
<div class="timeline-note__placeholder" ng-if="!inputText">{{placeholderText}}</div>
<div class="timeline-note__text-container">
<div class="timeline-note__text"
contenteditable="true"
ng-model="inputText"
role="textbox"
tabindex="0"
aria-label="{{'timeline.note.addNote.placeholder' | i18n}}"
ng-keyup="handleSmartInputChange($event)"
ng-keydown="handleSmartInputKeyDown($event)"
ng-paste="handleSmartInputPaste($event)"
ng-click="dismissPopup()"></div>
</div>
<smart-recorder-search ng-if="showPopup" class="smart-recorder__popup_activity-worknote" vertical-screen-fit="activityWorknoteSearch">
</smart-recorder-search>
<!--Viktor: to make pseudo class :empty behaive correctly this should go in one line -->
<div class="timeline-note__parameters clearfix"><div class="timeline-note__type" ng-if="worknoteTypes.length">
{{'timeline.note.type' | i18n}}:&nbsp;
<div class="timeline-note__type-selector dropdown" >
<button type="button" class="btn_link dropdown-toggle" title="{{'timeline.note.type' | i18n}}" tabindex="0">
{{(selectedWorknoteType.index ? selectedWorknoteType.label : 'common.placeholder.selectOne' ) | i18n}}
<i class="icon-triangle_down"></i>
</button>
<ul class="dropdown-menu">
<li ng-repeat="worknoteType in worknoteTypes | filter: {hasParentSection: '!true'}">
<div ng-if="worknoteType.type == 'section'" class="{{ worknoteType.expanded ? 'dropdown-item__header_expanded' : 'dropdown-item__header_collapsed'}}"
aria-expanded="{{worknoteType.expanded}}" role="menuitem" tabindex="0" title="{{ userModel.isAccessibleUser ? ('filter.tree.levelPos' | i18n: [1, ($index+1)]) : '' }}"
ng-click="expandWorknoteTypeSection($event, worknoteType)" ng-enter="expandWorknoteTypeSection($event, worknoteType)">
{{worknoteType.label}}
</div>
<div ng-if="worknoteType.type == 'section'" collapse="!worknoteType.expanded">
<div ng-repeat="type in worknoteType.options">
<div ng-keydown="handleKeydown($event, type)" ng-click="selectWorknoteType(type)" ng-enter="selectWorknoteType(type)" role="menuitemcheckbox" tabindex="0"
aria-checked="{{type.index == selectedWorknoteType.index}}" title="{{ userModel.isAccessibleUser ? ('filter.tree.levelPos' | i18n: [2, ($index+1)]) : '' }}"
class="{{(type.index == selectedWorknoteType.index) ? 'dropdown-item_selected' : 'dropdown-item'}}">
{{type.label}}
</div>
</div>
</div>
<div ng-if="worknoteType.type == 'option'" ng-keydown="handleKeydown($event, worknoteType)" ng-click="selectWorknoteType(worknoteType)" ng-enter="selectWorknoteType(worknoteType)" role="menuitemcheckbox" tabindex="0"
aria-checked="{{worknoteType.index == selectedWorknoteType.index}}" title="{{ userModel.isAccessibleUser ? ('filter.tree.levelPos' | i18n: [2, ($index+1)]) : '' }}"
class="{{(worknoteType.index == selectedWorknoteType.index) ? 'dropdown-item_selected' : 'dropdown-item'}}">
{{worknoteType.label}}
</div>
</li>
</ul>
</div>
</div>
<div class="timeline-note__access" ng-if="state.isPublicEnabled && !isFlagThread">
<label>
<input type="checkbox" ng-model="state.access">
{{"timeline.note.public" | i18n}}
</label>
</div>
<div class="timeline-note__access" ng-if="state.isVendorEnabled">
<label ng-if="!state.isMultipleVendorTickets">
<input type="checkbox" ng-model="state.shareWithVendor">
{{"timeline.note.shareWithVendor" | i18n : parentContext.brokerVendorName}}
</label>
<div dropdown ng-if="state.isMultipleVendorTickets">
<label class="dropdown-toggle">
<input type="checkbox"
ng-model="state.shareWithVendor"
ng-click="updateShareWithVendorFlag()"
ng-enter="updateShareWithVendorFlag()">
{{"timeline.note.shareWithVendor" | i18n : parentContext.brokerVendorName}}
</label>
<ul class="dropdown-menu" prevent-console-filter-close="" vertical-screen-fit="shareWithVendorList">
<li class="dropdown-item__header">{{'timeline.note.chooseTickets'| i18n}}</li>
<li>
<div ng-repeat="option in parentContext.vendorInfo | orderBy: ['id']">
<div class="{{option.selected ? 'dropdown-item_selected' : 'dropdown-item'}}"
tabindex="0"
ng-keydown="handleKeydownOnUpdate($event, option)"
ng-click="updateVendorTicketList(option)"
ng-enter="updateVendorTicketList(option)"
role="menuitemcheckbox"
aria-checked="{{option.selected}}"
title="{{option.id + ' ' + option.title}}">
{{option.id + ' ' + option.title}}
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="timeline-note__access" ng-if="isFlagThread && !state.isThreadUnflagged && isUnflagEditAllowed">
<label>
<input type="checkbox" ng-model="state.unflagging">
{{"timeline.note.unflag.checkbox" | i18n}}
</label>
</div>
</div>
<div class="timeline-note__attachments" contenteditable="false">
<div ng-include="'views/common/feed-attachments.html'"></div>
</div>
<div class="timeline-note__message">
<div ng-if="type!=='request' && attachments.length >= 3">{{'timeline.note.max.attachments'| i18n:(3)}}</div>
<div ng-if="type==='request' && attachments.length >= 1">{{'timeline.note.max.attachment'| i18n:(1)}}</div>
</div>
</div>
<div class="timeline-note__controls clearfix">
<ul class="timeline-note__controls-container">
<li class="{{showPopup ? 'timeline-note_control_disabled' : 'timeline-note_control'}}" ng-click="toggleMentioning()" ng-enter="toggleMentioning()"
title="{{'common.button.add' | i18n}} @" role="link" tabindex="0">
<i class="icon-at"></i>
</li>
<li class="timeline-note_control" ng-if="state.isAttachEnabled && !addFlagNote && !isFlagThread">
<button role="link" title="{{'common.labels.attach' | i18n}}" class="icon-paperclip timeline-file-input-img"
ng-class="{'disabled': (type!=='request' && attachments.length>=3) || (type==='request' && attachments.length>=1)}" upload-file></button>
<input id="uploadAttachment" type="file" name="file" onchange="angular.element(this).scope().handleFileChange(this)" class="timeline-note__file-input"
ng-disabled="(type!=='request' && attachments.length>=3) || (type==='request' && attachments.length>=1)" ie-activate-by-enter/>
</li>
</ul>
<div class="timeline-note__btn-container">
<button type="submit" class="small-btn_primary" ng-show="state.isPostButtonVisible" ng-disabled="!(inputText.trim())" ng-click="submitNote($event)">{{"timeline.note.post.label" | i18n}}</button>
<button type="button" class="small-btn_secondary" ng-click="dismissNoteForm($event)">{{"timeline.note.cancel" | i18n}}</button>
</div>
<div class="timeline-note__controls-hint" ng-if="isDraft">
{{'timeline.note.draftHint' | i18n}}
</div>
</div>
<div loading-spinner if="state.savingNote" centered="true" overlay="true"></div>
</div>