Sha256: c4f8c7370af7083d6c7a4fc95923fbb81143ea91e66fae2d8f40d034da87433b

Contents?: true

Size: 1.75 KB

Versions: 41

Compression:

Stored size: 1.75 KB

Contents

<%
promethee_data = Promethee::Data.new master_data, localization_data: localization_data
%>

<script>
  var prometheeLocalizer = angular
    .module('PrometheeLocalizer', ['summernote'])
    .value('data', <%= promethee_data.localization_data_to_json.html_safe %>)
    .filter('htmlSafe', ['$sce', function($sce) {
      return function(val) {
        return $sce.trustAsHtml(val);
      };
    }]);

  prometheeLocalizer.controller('PrometheeLocalizerController', ['$scope', 'data', function($scope, data) {

    $scope.data = data;
    $scope.component = {children: data.components};

    $scope.options = {
      toolbar: [
        ['headline', ['style']],
        ['style', ['bold', 'italic']],
        ['alignment', ['ul', 'ol', 'paragraph']],
        ['code', ['codeview']]
      ]
    };

  }]);
</script>


<div id="prometheeLocalizer"
     class="promethee-localizer"
     ng-app="PrometheeLocalizer"
     ng-controller="PrometheeLocalizerController as prometheeLocalizerController">

  <script type="text/ng-template" id="promethee/localize/component">
    <ng-include src="'promethee/components/' + component.type + '/localize'"></ng-include>
  </script>

  <input type="hidden" name="<%= object_name %>[<%= method_name %>]" id="page_data" value="{{data}}" />

  <% Dir["#{__dir__}/components/*/_localize.html.erb"].map do |file| %>
    <% partial = file.split('app/views/').last.gsub('.html.erb', '').gsub('/_', '/') %>
    <%= render partial %>
  <% end %>

  <% #TODO override templates from current project %>

  <div class="row">
    <div class="col-md-6"><b>Master</b></div>
    <div class="col-md-6"><b>Translation</b></div>
  </div>
  <div ng-repeat="component in component.children">
    <ng-include src="'promethee/localize/component'"></ng-include>
  </div>
</div>

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
promethee-1.5.0 app/views/promethee/_localize.html.erb
promethee-1.4.29 app/views/promethee/_localize.html.erb
promethee-1.4.28 app/views/promethee/_localize.html.erb
promethee-1.4.27 app/views/promethee/_localize.html.erb
promethee-1.4.26 app/views/promethee/_localize.html.erb
promethee-1.4.25 app/views/promethee/_localize.html.erb
promethee-1.4.24 app/views/promethee/_localize.html.erb
promethee-1.4.23 app/views/promethee/_localize.html.erb
promethee-1.4.22 app/views/promethee/_localize.html.erb
promethee-1.4.21 app/views/promethee/_localize.html.erb
promethee-1.4.20 app/views/promethee/_localize.html.erb
promethee-1.4.19 app/views/promethee/_localize.html.erb
promethee-1.4.18 app/views/promethee/_localize.html.erb
promethee-1.4.17 app/views/promethee/_localize.html.erb
promethee-1.4.16 app/views/promethee/_localize.html.erb
promethee-1.4.15 app/views/promethee/_localize.html.erb
promethee-1.4.14 app/views/promethee/_localize.html.erb
promethee-1.4.13 app/views/promethee/_localize.html.erb
promethee-1.4.12 app/views/promethee/_localize.html.erb
promethee-1.4.11 app/views/promethee/_localize.html.erb