@using OurUmbraco.Our.Models
@using Skybrud.Social.Meetup.Models.Events
@inherits OurUmbracoTemplatePage
@{
    var homeNotificationText = Model.Content.GetPropertyValue<string>("homeOnlyBanner");
    var showHomeNotification = string.IsNullOrWhiteSpace(homeNotificationText) == false;
    var globalNotificationText = Model.Content.GetPropertyValue<string>("mainNotification");
    var showGlobalNotification = string.IsNullOrWhiteSpace(globalNotificationText) == false;
}
<!-- Search start -->
<section id="search-all" class="search-all">

    <div class="search-all-form">
        <div class="search-fieldset">
            <input class="search-input" type="search" placeholder="Search..">
            <input class="search-submit" type="submit" value="&#xe085;">
        </div>
        <span class="search-all-close"></span>
    </div>

    <div class="search-all-results equalizer">
        <ul></ul>
    </div>

    @if (MemberData == null)
    {
        <div class="search-text">
            <div class="container">
                <div class="row">
                    <div class="col-md-6 col-md-offset-3">
                        <strong>The friendliest CMS community on the planet</strong>
                        <p>our.umbraco.org is the central hub for the friendly umbraco community. Search for documentation, get help and guidance from seasoned experts, download and collaborate on plugins and extensions.</p>
                    </div>
                </div>
            </div>
        </div>
    }

</section>
<!-- Search end -->

<style>
    .bannertext p {
        line-height: 1.4rem;
    }
</style>

@if (showGlobalNotification)
{
    <div class="alertbar__yellow">
        @Html.Raw(globalNotificationText)
    </div>
}

@if (showHomeNotification)
{
    @Html.Raw(homeNotificationText)
}

@if (Members.IsLoggedIn())
{
    @ForumActivity()
    @Meetups()
    @GitHubContributors()
    @TwitterSearch()
    @Html.Partial("home/documentation")
}
else
{
    @Html.Partial("home/documentation")
    @ForumActivity()
    @Meetups()
    @GitHubContributors()  
    @TwitterSearch()
}

@helper ForumActivity()
{
    <section class="forum">
        <div class="container">
            <div class="row">

                <div class="col-md-12">
                    <h1 class="text-center">Forum Activity</h1>
                    <p>
                        Recent activity in the forums, where people are helping each other with current problems.
                    </p>
                </div>
                <div class="col-md-12">
                    <small>Recent posts</small>
                </div>

                <div class="col-md-12 flex" id="forum-activity">
                    <h2>Loading latest forum activity...</h2>
                </div>

                <div class="col-md-12 goto-forum">
                    <a class="button green" href="/forum">Go to Forum &rarr;</a>
                </div>

            </div>
        </div>
    </section>
}

@helper TwitterSearch()
{
    <section class="forum">
        <div class="container">
            <div class="row">

                <div class="col-md-12">
                    <h1 class="text-center">Twitter Activity</h1>
                    <p>
                        Recent activity on twitter, where people are talking about Umbraco.
                    </p>
                </div>
                <div class="col-md-12">
                    <small>Recent tweets</small>
                </div>

                <div class="col-md-12 flex" id="twitter-search">
                    <h2>Loading twitter search results...</h2>
                </div>

                <div class="col-md-12 goto-forum">
                    <a class="button green" href="https://twitter.com/search?f=tweets&vertical=default&q=umbraco&src=typd">Join the conversation on Twitter &rarr;</a>
                </div>

            </div>
        </div>
    </section>
}

@helper  GitHubContributors()
{
    <section class="github-contributors forum">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h1 class="text-center">GitHub Contributions</h1>
                    <p>
                        <small class="link-list">
                            Contributions to default branches for
                            <a href="https://github.com/umbraco/Umbraco-CMS" target="_blank" title="Umbraco-CMS">Umbraco-CMS</a>,
                            <a href="https://github.com/umbraco/UmbracoDocs" target="_blank" title="UmbracoDocs">UmbracoDocs</a>,
                            <a href="https://github.com/umbraco/OurUmbraco" target="_blank" title="OurUmbraco">OurUmbraco</a>,
                            <a href="https://github.com/umbraco/Umbraco.Deploy.Contrib" target="_blank" title="Umbraco.Deploy.Contrib">Umbraco.Deploy.Contrib</a>,
                            <a href="https://github.com/umbraco/Umbraco.Courier.Contrib" target="_blank" title="Umbraco.Courier.Contrib">Umbraco.Courier.Contrib</a> and
                            <a href="https://github.com/umbraco/Umbraco.Deploy.ValueConnectors" target="_blank" title="Umbraco.Deploy.ValueConnectors">Umbraco.Deploy.ValueConnectors</a> repos
                        </small>
                    </p>
                </div>
                <div class="col-md-12">
                    <small>Contributions the last 12 months (number indicating accepted commits)</small>
                </div>

                <div class="col-md-12 flex forum-thread" id="github-contributors">
                    <h2>Loading GitHub contributors...</h2>
                </div>

                <div class="col-md-12 goto-forum">
                    <a class="button green" href="https://our.umbraco.org/contribute">Contribute to Umbraco &rarr;</a>
                </div>

            </div>
        </div>
    </section>
}

@helper Meetups() {   
    <section class="forum">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h1 class="text-center">Meetups</h1>
                    <p>
                        Upcoming meetups organized by the Umbraco community.
                    </p>
                </div>
                <div class="col-md-12">
                    <small>Upcoming meetups</small>
                </div>
                <div class="col-md-12 flex" id="meetups">
                    <h2>Loading meetups...</h2>
                </div>
            </div>
        </div>
    </section>
}