Add i18n; avoid injecting unneeded dependencies.

This commit is contained in:
Paulo Reis 2018-08-02 16:20:01 +01:00
parent dc235b91d9
commit 2c2bb4c130
4 changed files with 10 additions and 21 deletions

View file

@ -91,5 +91,5 @@ script(type="text/ng-template", id="historyLabelTooltipTpl")
p.history-label-tooltip-title
i.fa.fa-tag
|  {{ $ctrl.labelText }}
p.history-label-tooltip-owner Created by {{ $ctrl.labelOwnerName }}
p.history-label-tooltip-owner #{translate("history_label_created_by")} {{ $ctrl.labelOwnerName }}
time.history-label-tooltip-datetime {{ labelCreationDateTime | formatDate }}

View file

@ -77,17 +77,6 @@ aside.change-list(
is-owned-by-current-user="label.user_id === $ctrl.currentUser.id"
on-label-delete="deleteLabel(label)"
)
//- .history-entry-label(
//- ng-if="update.labels.length > 0"
//- ng-repeat="label in update.labels"
//- )
//- span.history-entry-label-comment
//- i.fa.fa-tag
//- |  {{ label.comment }}
//- button.history-entry-label-delete-btn(
//- stop-propagation="click"
//- ng-click="deleteLabel(label)"
//- ) ×
div.time {{ update.meta.end_ts | formatDate:'h:mm a' }}
div.action.action-edited(ng-if="history.isV2 && update.pathnames.length > 0")
| #{translate("file_action_edited")}

View file

@ -12,7 +12,7 @@
ng-disabled="history.loadingFileTree"
)
i.fa.fa-tag
|  Label this version
|  #{translate("history_label_this_version")}
button.history-toolbar-btn(
ng-click="toggleHistoryViewMode();"
ng-disabled="history.loadingFileTree"
@ -27,20 +27,20 @@ script(type="text/ng-template", id="historyV2AddLabelModalTemplate")
novalidate
)
.modal-header
h3 Add label
h3 #{translate("history_add_label")}
.modal-body
.alert.alert-danger(ng-show="state.error.message") {{ state.error.message}}
.alert.alert-danger(ng-show="state.error && !state.error.message") #{translate("generic_something_went_wrong")}
.form-group
input.form-control(
type="text"
placeholder="New label name"
placeholder=translate("history_new_label_name")
ng-model="inputs.labelName"
focus-on="open"
required
)
p.help-block(ng-if="update")
| A new label will be added as of
| #{translate("history_new_label_added_at")}
strong {{ update.meta.end_ts | formatDate:'ddd Do MMM YYYY, h:mm a' }}
.modal-footer
button.btn.btn-default(
@ -50,18 +50,18 @@ script(type="text/ng-template", id="historyV2AddLabelModalTemplate")
) #{translate("cancel")}
input.btn.btn-primary(
ng-disabled="addLabelModalForm.$invalid || state.inflight"
ng-value="state.inflight ? 'Adding label' : 'Add label'"
ng-value="state.inflight ? '" + translate("history_adding_label") + "' : '" + translate("history_add_label") + "'"
type="submit"
)
script(type="text/ng-template", id="historyV2DeleteLabelModalTemplate")
.modal-header
h3 Delete label
h3 #{translate("history_delete_label")}
.modal-body
.alert.alert-danger(ng-show="state.error.message") {{ state.error.message}}
.alert.alert-danger(ng-show="state.error && !state.error.message") #{translate("generic_something_went_wrong")}
p.help-block(ng-if="labelDetails")
| Are you sure you want to delete the following label:
| #{translate("history_are_you_sure_delete_label")}
strong "{{ labelDetails.comment }}"
| ?
.modal-footer
@ -74,4 +74,4 @@ script(type="text/ng-template", id="historyV2DeleteLabelModalTemplate")
type="button"
ng-click="deleteLabel()"
ng-disabled="state.inflight"
) {{ state.inflight ? 'Deleting label' : 'Delete label' }}
) {{ state.inflight ? '#{translate("history_deleting_label")}' : '#{translate("history_delete_label")}' }}

View file

@ -2,7 +2,7 @@ define [
"base"
"ide/history/util/displayNameForUser"
], (App, displayNameForUser) ->
historyEntryController = ($scope, $element, $attrs, $filter, _) ->
historyEntryController = ($scope, $element, $attrs, _) ->
ctrl = @
_getUserById = (id) ->
_.find ctrl.users, (user) ->