<commit_before>﻿@using Tigwi.UI.Models

<script type="text/javascript">
    $(document).ready(function() {
        $('.editAcc').click(function(event) {
            event.stopPropagation();
            $('#editAccountModal').modal('show');
            var name = $(this).attr('id');
            var accountId = name.substring(5, name.length);
            $.ajax({
                url: "@Url.Action("GetAccount", "Account")",
                type: "POST",
                dataType: 'json',
                data: { 'accountId': accountId },
                success: function(data) {
                    $('#Description').val(data.Descr);
                    $('#AccountId').val(accountId);
                    $('#ReturnController').val("Account");
                    $('#ReturnAction').val("List");
                }
            });
        });

        $('.deltAcc').click(function(event) {
            event.stopPropagation();
            $('#deleteAccountModal').modal('show');

            var name = $(this).attr('id');
            var accountId = name.substring(5, name.length);
            $.ajax({
                url: "@Url.Action("GetAccount","Account")",
                type: "POST",
                dataType: 'json',
                data: { 'accountId': accountId },
                success: function(data) {
                    $('#deleteAccountName').html(data.Name);
                    $('#deleteAccountId').val(accountId);
                }
            });
        });
    });

</script>

<section class="accountsView">
    <ul>

        @foreach (var account in Model.Accounts)
        {
            <li>
                <h2> @account.Name </h2>
                <button class="btn btn-primary editAcc" id="acct-@account.Id" ><b>Edit</b></button>
                @if (@account.Admin.Id == CurrentUser.Id)
                {
                    if (@account.Id != @CurrentUser.MainAccount.Id)
                    { 
                        <button class="btn btn-primary deltAcc" id="delt-@<EMAIL>" ><b>Delete</b></button>
                    }       
                }
                else
                {
                    <button class="btn btn-primary leavAcc" id="leav-@<EMAIL>" ><b>Leave</b></button>
                    //TODO Write ConfirmLeaveModal
                }
                <p><b>Description : </b> @account.Description</p>
            </li>
        }
    </ul>
</section>

<commit_msg>add link jscript for edit in ViewAccount<commit_after>﻿@using Tigwi.UI.Models
@using Tigwi.UI.Models.Account
@using Tigwi.UI.Models.User

<script type="text/javascript">
    $(document).ready(function() {
        $('.editAcc').click(function(event) {
            event.stopPropagation();
            $('#editAccountModal').modal('show');
            var name = $(this).attr('id');
            var accountId = name.substring(5, name.length);
            $.ajax({
                url: "@Url.Action("GetAccount", "Account")",
                type: "POST",
                dataType: 'json',
                data: { 'accountId': accountId },
                success: function(data) {
                    $('#Description').val(data.Descr);
                    $('#AccountId').val(accountId);
                    $('#ReturnController').val("Account");
                    $('#ReturnAction').val("List");
                }
            });
        });

        $('.deltAcc').click(function(event) {
            event.stopPropagation();
            $('#deleteAccountModal').modal('show');

            var name = $(this).attr('id');
            var accountId = name.substring(5, name.length);
            $.ajax({
                url: "@Url.Action("GetAccount","Account")",
                type: "POST",
                dataType: 'json',
                data: { 'accountId': accountId },
                success: function(data) {
                    $('#deleteAccountName').html(data.Name);
                    $('#deleteAccountId').val(accountId);
                }
            });
        });
    });

</script>

<section class="accountsView">
    <ul>

        @foreach (var account in Model.Accounts)
        {
            <li>
                <h2> @account.Name </h2>
                <button class="btn btn-primary editAcc" id="acct-@account.Id" ><b>Edit</b></button>
                @if (@account.Admin.Id == CurrentUser.Id)
                {
                    if (@account.Id != @CurrentUser.MainAccount.Id)
                    { 
                        <button class="btn btn-primary deltAcc" id="delt-@account.Id" ><b>Delete</b></button>
                    }       
                }
                else
                {
                    <button class="btn btn-primary leavAcc" id="le<EMAIL>" ><b>Leave</b></button>
                    //TODO Write ConfirmLeaveModal
                }
                <p><b>Description : </b> @account.Description</p>
            </li>
        }
    </ul>
</section>

<section class="modal hide" id="editAccountModal">
    @Html.Partial("_EditAccountModal", new AccountEditViewModel())
</section>


{'fraction_non_alphanumeric': 0.16255184673118706, 'fraction_numerical': 0.0015800908552241755, 'mean_word_length': 1.4206500956022945, 'pattern_counts': {'":': 0, '<': 60, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '4931305', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1324, 'n_words': 224}