Skip to content

Commit

Permalink
Se agrego editor summernote al envío de mails
Browse files Browse the repository at this point in the history
  • Loading branch information
jogianotti committed May 20, 2016
1 parent 4412301 commit 5260c4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,14 @@ orderControllers.controller('OrderCtrl', function ($scope, $http, Upload, $filte
$scope.contacts = null;
$scope.templates = MailTemplate.query();
$scope.forms.email.address = email;

$(document).ready(function () {
$('#email_summernote').summernote({
height: 200,
code: 'asdfasdfasdf'
});
});

$('#email-modal').modal('show');
};

Expand Down Expand Up @@ -1018,6 +1026,8 @@ orderControllers.controller('OrderCtrl', function ($scope, $http, Upload, $filte
});
$scope.forms.email.subject = !_.isUndefined(template) ? template.title : '';
$scope.forms.email.text = !_.isUndefined(template) ? template.text : '';

$('#email_summernote').code($scope.forms.email.text);
};

$scope.validateEmail = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
</div>
<div class="form-group" ng-if="templates.length > 1">
<label for="template">{{'template' | translate}}</label>
<select ui-select2="select2Templates" ng-model="forms.email.template" class="form-control" name="template" id="template" ng-click="templateChanged()">
<select id="email_template_select" ui-select2="select2Templates" ng-model="forms.email.template" class="form-control" name="template" id="template" ng-click="templateChanged()">
<option></option>
<option ng-repeat="t in templates" value="{{t.id}}">{{t.title}}</option>
</select>
Expand All @@ -171,9 +171,9 @@
</div>
<div class="form-group" ng-class="texterror">
<label for="text">{{'text' | translate }}</label>
<textarea class="form-control" name="text" id="text" ng-model="forms.email.text" required >
<input type="hidden" name="order_id" id="order_id" ng-model="order.id"/>
<textarea id="email_summernote" class="form-control" name="text" id="text" ng-model="forms.email.text" required >
</textarea>
<input type="hidden" name="order_id" id="order_id" ng-model="order.id"/>
</div>
</form>
{% endverbatim %}
Expand Down Expand Up @@ -1303,9 +1303,8 @@
{{ parent() }}
<script type="text/javascript">
var request_id
= {{ entity.code }};
</script>
{% javascripts 'bundles/celsius3core/ng/CCI/app.js'
= {{ entity.code }};</script>
{% javascripts 'bundles/celsius3core/ng/CCI/app.js'
'bundles/celsius3core/ng/CCI/directives.js'
'bundles/celsius3core/ng/CCI/resources.js' package="admin_order" filter='?uglifyjs2' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
Expand Down

0 comments on commit 5260c4d

Please sign in to comment.