<commit_before>{# get the loged dealer #}
{% set apicall="/api/listings/all.json" %}
{% if is_granted('ROLE_BUSINES') %}
    {% set user= app.security.getToken().getUser().getId() %}
    {% set apicall="/api/listings2/"~user~"/dealer.json" %}
{% endif %}
{% if is_granted('ROLE_ADMIN') and app.session.get('dms_dealer_id') %}
    {% set user= app.session.get('dms_dealer_id') %}
{% set apicall="/api/listings2/"~user~"/dealer.json" %}
{% endif %}
{% import 'NumaDOASiteBundle::components.html.twig' as component %}
var app = angular.module('app', ['angular-loading-bar', 'ngTouch', 'ngAnimate', 'ui.grid', 'ui.grid.moveColumns', 'ui.grid.resizeColumns', 'ui.grid.selection', 'ui.grid.expandable', 'ui.bootstrap', 'ui.grid.pinning']);


app.config(function ($interpolateProvider) {
    $interpolateProvider.startSymbol('{[{').endSymbol('}]}');
});
function getClassName(grid, row, col, columnName) {
    var className = "";
    if (row.entity['featured'] === "1" && row.entity['active']==="1") {
        className = "featured";
    }
    return className;
}

app.controller('MainCtrl', ['$scope', '$http', '$log', '$timeout', 'uiGridConstants', '$q', '$uibModal', function ($scope, $http, $log, $timeout, uiGridConstants, $q, $uibModal) {
    $scope.gridOptions = {
        enableSorting: true,
        showGridFooter: true,
        showGridHeader: true,
        enableFiltering: true,
        enableRowSelection: true,
        enableSelectAll: true,
        selectionRowHeaderWidth: 35,
        rowHeight: 150,
        enableColumnResizing: true,

    };
    $scope.gridOptions.multiSelect = true;
    $scope.gridOptions.columnDefs = [
        {
            enableSorting: false,
            enableFiltering: false,
            name: 'photo',
            enableColumnResizing: true, width: 150,
            cellTemplate: '<a href="{{ path('inventory') }}{[{row.entity.id}]}/edit"><span ng-if="row.entity.photo !== \'\'"><img class="image-angular2" src="{[{row.entity.photo}]}" alt="{[{row.entity.name}]}" height="140px" width="140px" ></span></a>',
            cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
                return 'other-cells ' + getClassName(grid, row, col, 'featured');
            },
        },
        {
            name: 'id',
            enableColumnResizing: true,
            width: 50,
            cellTemplate: '<a href="{{ path('inventory') }}{[{row.entity.id}]}/edit">{[{row.entity.id}]}</a>',
            cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
                return 'other-cells ' + getClassName(grid, row, col, 'featured');
            },
        },
        {name: 'body_style', displayName: 'Body Style / Type', enableColumnResizing: true, width: 50,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');
        },},
        {name: 'year', displayName: 'Year', enableColumnResizing: true, width: 50,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');
        },},
        {name: 'make', enableColumnResizing: true, width: 80,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');
        },},
        {name: 'model', enableColumnResizing: true, width: 100,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');<commit_msg>DMS inventory fix<commit_after>{# get the loged dealer #}
{% set apicall="/api/listings/all.json" %}
{% if is_granted('ROLE_BUSINES') %}
    {% set user= app.security.getToken().getUser().getId() %}
    {% set apicall="/api/listings2/"~user~"/dealer.json" %}
{% endif %}
{% if is_granted('ROLE_ADMIN') and app.session.get('dms_dealer_id') %}
    {% set user= app.session.get('dms_dealer_id') %}
{% set apicall="/api/listings2/"~user~"/dealer.json" %}
{% endif %}
{% import 'NumaDOASiteBundle::components.html.twig' as component %}
var app = angular.module('app', ['angular-loading-bar', 'ngTouch', 'ngAnimate', 'ui.grid', 'ui.grid.moveColumns', 'ui.grid.resizeColumns', 'ui.grid.selection', 'ui.grid.expandable', 'ui.bootstrap', 'ui.grid.pinning']);


app.config(function ($interpolateProvider) {
    $interpolateProvider.startSymbol('{[{').endSymbol('}]}');
});
function getClassName(grid, row, col, columnName) {
    var className = "";
    if (row.entity['featured'] === "1" && row.entity['active']==="1") {
        className = "featured";
    }
    return className;
}

app.controller('MainCtrl', ['$scope', '$http', '$log', '$timeout', 'uiGridConstants', '$q', '$uibModal', function ($scope, $http, $log, $timeout, uiGridConstants, $q, $uibModal) {
    $scope.gridOptions = {
        enableSorting: true,
        showGridFooter: true,
        showGridHeader: true,
        enableFiltering: true,
        enableRowSelection: true,
        enableSelectAll: true,
        selectionRowHeaderWidth: 35,
        rowHeight: 150,
        enableColumnResizing: true,

    };
    $scope.gridOptions.multiSelect = true;
    $scope.gridOptions.columnDefs = [
        {
            enableSorting: false,
            enableFiltering: false,
            name: 'photo',
            enableColumnResizing: true, width: 150,
            cellTemplate: '<a href="{% if is_granted('ROLE_BUSINES') and not(is_granted('ROLE_DMS_USER')) %}{{ path('items') }}{% else %}{{ path('inventory') }}{% endif %}{[{row.entity.id}]}/edit"><span ng-if="row.entity.photo !== \'\'"><img class="image-angular2" src="{[{row.entity.photo}]}" alt="{[{row.entity.name}]}" height="140px" width="140px" ></span></a>',
            cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
                return 'other-cells ' + getClassName(grid, row, col, 'featured');
            },
        },
        {
            name: 'id',
            enableColumnResizing: true,
            width: 50,
            cellTemplate: '<a href="{% if is_granted('ROLE_BUSINES') and not(is_granted('ROLE_DMS_USER')) %}{{ path('items') }}{% else %}{{ path('inventory') }}{% endif %}{[{row.entity.id}]}/edit">{[{row.entity.id}]}</a>',
            cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
                return 'other-cells ' + getClassName(grid, row, col, 'featured');
            },
        },
        {name: 'body_style', displayName: 'Body Style / Type', enableColumnResizing: true, width: 50,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');
        },},
        {name: 'year', displayName: 'Year', enableColumnResizing: true, width: 50,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');
        },},
        {name: 'make', enableColumnResizing: true, width: 80,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');
        },},
        {name: 'model', enableColumnResizing: true, width: 100,cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
            return 'other-cells ' + getClassName(grid, row, col, 'featured');
{'fraction_non_alphanumeric': 0.18243243243243243, 'fraction_numerical': 0.008108108108108109, 'mean_word_length': 3.3818827708703374, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '257740', 'n_tokens_mistral': 2444, 'n_tokens_neox': 2311, 'n_words': 475}