@model WhyDonateViewModel

@inject LimitConfigurationList LimitConfigurationList


@{
    ViewData["Title"] = "Why donate?";
    ViewData["Message"] = "Donate to the listrr.pro project";

    var limitConfigs = LimitConfigurationList.LimitConfigurations.Where(x => x.Amount > 0).OrderBy(x => x.Amount);
    var userLimitConfig = LimitConfigurationList.LimitConfigurations.FirstOrDefault(x => x.Level == UserLevel.User);
}

<div class="row">
    <div class="col-md-12">
        <p>The public available instance of listrr.pro relies on donations to keep it up and running. We currently have @Model.Users users which created @Model.Lists lists that get updated every 24 hours.</p>
        <h5>Donations are appreciated in the form of money or time.</h5>
        <p>When donating your time, you could help fix existing bugs, or help implement new features which are listed on our GitHub at <a href="https://github.com/TheUltimateC0der/Listrr/issues">https://github.com/TheUltimateC0der/Listrr/issues</a>.</p>
        <p>When donating your money, you support the public available infrastructure where listrr.pro is running. The money will be used to buy new servers to run listrr on, or coffee to fix bugs or implement new features.</p>
        <hr />
        <h5>Any donor perks?</h5>
        <p>Yes! We currently offer perks for our donors, and will add new perks in the future as listrr.pro evolves!</p>
        <p>Current perks are:</p>

        <table class="table table-dark">
            <thead>
                <tr>
                    <th scope="col">Donation</th>
                    <th scope="col">Lists</th>
                    <th scope="col">Update on edit</th>
                    <th scope="col">Update manual</th>
                    <th scope="col">Exclusion filters</th>
                    <th scope="col">IMDb ratings</th>
                    <th scope="col">Create lists from names</th>
                    <th scope="col">High prio queue</th>
                </tr>
            </thead>
            <tbody>
                @if (userLimitConfig != null)
                {
                    <tr>
                        <th scope="row">Non donor</th>
                        <td>@userLimitConfig.ListLimit</td>
                        <td>@(userLimitConfig.UpdateAfterEdit ? "Yes" : "No")</td>
                        <td>@(userLimitConfig.UpdateManual ? "Yes" : "No")</td>
                        <td>@(userLimitConfig.ExclusionFilters ? "Yes" : "No")</td>
                        <td>@(userLimitConfig.IMDbRatings ? "Yes" : "No")</td>
                        <td>@(userLimitConfig.ListsFromNames ? "Yes" : "No")</td>
                        <td>@(userLimitConfig.QueueName == "donor" ? "Yes" : "No")</td>
                    </tr>
                }

                @foreach (var limitConfig in limitConfigs)
                {
                    <tr>
                        <th scope="row">$@limitConfig.Amount</th>
                        <td>@limitConfig.ListLimit</td>
                        <td>@(limitConfig.UpdateAfterEdit ? "Yes" : "No")</td>
                        <td>@(limitConfig.UpdateManual ? "Yes" : "No")</td>
                        <td>@(limitConfig.ExclusionFilters ? "Yes" : "No")</td>
                        <td>@(limitConfig.IMDbRatings ? "Yes" : "No")</td>
                        <td>@(limitConfig.ListsFromNames ? "Yes" : "No")</td>
                        <td>@(limitConfig.QueueName == "donor" ? "Yes" : "No")</td>
                    </tr>
                }
            </tbody>
        </table>

        <p>If you want to donate to listrr, you can do this via GitHub sponsors by following the link here: <a href="https://github.com/sponsors/TheUltimateC0der">https://github.com/sponsors/TheUltimateC0der</a></p>
        <hr />
        <h5>How do I get my perks?</h5>
        <p>Please connect your GitHub account to the listrr app so that I can check your GitHub username. Everything is completely automated, and you should get your perks within 5 minutes after the information is available through the GitHub graph API.</p>
    </div>
</div>