<commit_before>@import modules.CustomGitHubProvider

@(
        gitHubProvider: CustomGitHubProvider,
        user: Option[models.User],
        repo: Repository,
        feedback: Seq[Feedback],
        totalPages: Int,
        permission: Boolean
        )(owner: String, repositoryName: String, currentPage: Int)(implicit request: RequestHeader)

@main("GitRank - " + owner + "/" + repositoryName, gitHubProvider, user) {

    @if(feedback.isEmpty) {
        <div class="ui active page dimmer">
            <div class="content">
                <div class="center">
                    <h2 class="ui inverted header">
                        No registered feedback for this repository, yet
                    </h2>
                    @if(permission) {
                        <a href="@routes.ApplicationController.giveFeedbackPage(owner, repositoryName)" class="ui primary labeled icon button">
                            <i class="plus icon"></i>
                            Add First feedback
                        </a>
                    }
                </div>
            </div>
        </div>
    } else {

        <div class="ui container">

            <h2 class="ui repository header">
                <i class="mega-octicon octicon-repo"></i>
                <div class="content">
                    <a href="https://github.com/@owner">@owner</a>
                    /<a href="https://github.com/@owner/@repositoryName">@repositoryName</a>
                </div>
            </h2>

            <div class="ui middle aligned grid">
                <div class="divided row">
                    <div class="thirteen wide column">
                        <div id="scoreChart"></div>
                    </div>
                    <div class="three wide center aligned column">
                        <div class="ui statistic">
                            <div class="value">
                                @repo.score/5
                            </div>
                            <div class="label">
                                Score
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <div class="ui comments feedback">
                <h3 class="ui dividing header">
                    <i class="bullhorn icon"></i>
                    <div class="content">
                        Feedback
                    </div>
                    @if(permission){
                        <a href="@routes.ApplicationController.giveFeedbackPage(owner, repositoryName)" class="ui primary button"><i class="plus icon"></i>
                        Add</a>
                    }
                </h3>
                @for(f <- feedback) {
                    <div class="comment">
                        <a class="avatar">
                            <img src="@f.user.avatarURL">
                        </a>
                        <div class="content">
                            <a class="author">@f.user.fullName</a>
                            <div class="metadata">
                                <span data-content="Karma" class="popup"> @f.score.karma <i class="fire icon"></i></span>
                                <span class="date">on @f.score.timestamp.format("dd MMM yyyy") </span>
                            </div>
                            <div class="text"> @f.score.feedback </div>
                            <div class="actions">
                                <span data-content="Documentation" class="popup"> @f.score.docScore <i class="icon book"></i></span>
                                <span data-content="Maturity" class="popup"> @f.score.maturityScore <i class="icon leaf"></i></span>
                                <span data-content="Design" class="popup"> @f.score.designScore <i class="icon university"></i></span>
                                <span data-content="Support" class="popup"> @f.score.supportScore <i class="icon life ring"></i></span>
                            </div>
                        </div>
                    </div>
                }
            </div>

            @if(totalPages != 0) {
                <div class="align-center">
                    <div class="ui pagination menu">

                        <a
                        href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage - 1))"
                        class="@if(currentPage == 1) {disabled} item">
                            <
                        </a>

                        @if(currentPage != 1 && currentPage != 2) {
                            <a class="disabled item">
                                ...
                            </a>
                        }

                        @if(currentPage - 1 > 0) {
                            <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage - 1))"
                            class="item">
                            @(currentPage - 1)
                            </a>
                        }

                        <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage))"
                        class="item">
                        @currentPage
                        </a>

                        @if(currentPage + 1 < totalPages) {
                            <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage + 1))"
                            class="item">
                            @(currentPage + 1)
                            </a>
                        }

                        @if(currentPage != totalPages && currentPage != totalPages - 1) {
                            <a class="disabled item">
                                ...
                            </a>
                        }

                        <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage + 1))"
                        class="@if(currentPage == totalPages) {disabled} item">
                            >
                        </a>
                    </div>
                </div>
            }
        </div>
    }


    <script src="@routes.Assets.at("lib/d3js/d3.min.js")" type="text/javascript"></script>
    <script src="@routes.Assets.at("javascripts/repository.js")" type="text/javascript"></script>
}<commit_msg>Add login button as an alternative when user is not logged in and the repository doesn't have any feedback<commit_after>@import modules.CustomGitHubProvider

@(
        gitHubProvider: CustomGitHubProvider,
        user: Option[models.User],
        repo: Repository,
        feedback: Seq[Feedback],
        totalPages: Int,
        permission: Boolean
        )(owner: String, repositoryName: String, currentPage: Int)(implicit request: RequestHeader)

@main("GitRank - " + owner + "/" + repositoryName, gitHubProvider, user) {

    @if(feedback.isEmpty) {
        <div class="ui active page dimmer">
            <div class="content">
                <div class="center">
                    <h2 class="ui inverted header">
                        No registered feedback for this repository, yet
                    </h2>
                    @if(permission) {
                        <a href="@routes.ApplicationController.giveFeedbackPage(owner, repositoryName)" class="ui primary labeled icon button">
                            <i class="plus icon"></i>
                            Add First feedback
                        </a>
                    } else {
                        <a href="@routes.SocialAuthController.authenticate(gitHubProvider.id)" class="ui primary button">
                            <span class="octicon octicon-mark-github"></span> Login
                        </a>
                    }
                </div>
            </div>
        </div>
    } else {

        <div class="ui container">

            <h2 class="ui repository header">
                <i class="mega-octicon octicon-repo"></i>
                <div class="content">
                    <a href="https://github.com/@owner">@owner</a>
                    /<a href="https://github.com/@owner/@repositoryName">@repositoryName</a>
                </div>
            </h2>

            <div class="ui middle aligned grid">
                <div class="divided row">
                    <div class="thirteen wide column">
                        <div id="scoreChart"></div>
                    </div>
                    <div class="three wide center aligned column">
                        <div class="ui statistic">
                            <div class="value">
                                @repo.score/5
                            </div>
                            <div class="label">
                                Score
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <div class="ui comments feedback">
                <h3 class="ui dividing header">
                    <i class="bullhorn icon"></i>
                    <div class="content">
                        Feedback
                    </div>
                    @if(permission){
                        <a href="@routes.ApplicationController.giveFeedbackPage(owner, repositoryName)" class="ui primary button"><i class="plus icon"></i>
                        Add</a>
                    }
                </h3>
                @for(f <- feedback) {
                    <div class="comment">
                        <a class="avatar">
                            <img src="@f.user.avatarURL">
                        </a>
                        <div class="content">
                            <a class="author">@f.user.fullName</a>
                            <div class="metadata">
                                <span data-content="Karma" class="popup"> @f.score.karma <i class="fire icon"></i></span>
                                <span class="date">on @f.score.timestamp.format("dd MMM yyyy") </span>
                            </div>
                            <div class="text"> @f.score.feedback </div>
                            <div class="actions">
                                <span data-content="Documentation" class="popup"> @f.score.docScore <i class="icon book"></i></span>
                                <span data-content="Maturity" class="popup"> @f.score.maturityScore <i class="icon leaf"></i></span>
                                <span data-content="Design" class="popup"> @f.score.designScore <i class="icon university"></i></span>
                                <span data-content="Support" class="popup"> @f.score.supportScore <i class="icon life ring"></i></span>
                            </div>
                        </div>
                    </div>
                }
            </div>

            @if(totalPages != 0) {
                <div class="align-center">
                    <div class="ui pagination menu">

                        <a
                        href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage - 1))"
                        class="@if(currentPage == 1) {disabled} item">
                            <
                        </a>

                        @if(currentPage != 1 && currentPage != 2) {
                            <a class="disabled item">
                                ...
                            </a>
                        }

                        @if(currentPage - 1 > 0) {
                            <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage - 1))"
                            class="item">
                            @(currentPage - 1)
                            </a>
                        }

                        <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage))"
                        class="item">
                        @currentPage
                        </a>

                        @if(currentPage + 1 < totalPages) {
                            <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage + 1))"
                            class="item">
                            @(currentPage + 1)
                            </a>
                        }

                        @if(currentPage != totalPages && currentPage != totalPages - 1) {
                            <a class="disabled item">
                                ...
                            </a>
                        }

                        <a href="@routes.ApplicationController.gitHubRepository(owner, repositoryName, Some(currentPage + 1))"
                        class="@if(currentPage == totalPages) {disabled} item">
                            >
                        </a>
                    </div>
                </div>
            }
        </div>
    }


    <script src="@routes.Assets.at("lib/d3js/d3.min.js")" type="text/javascript"></script>
    <script src="@routes.Assets.at("javascripts/repository.js")" type="text/javascript"></script>
}
{'fraction_non_alphanumeric': 0.11981636185745466, 'fraction_numerical': 0.003462030556182735, 'mean_word_length': 1.0528348524640816, 'pattern_counts': {'":': 0, '<': 235, '<?xml version=': 0, '>': 233, 'https://': 4, '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': '221434', 'n_tokens_mistral': 3219, 'n_tokens_neox': 2963, 'n_words': 633}