<style>
</style>


<script type="x-tmpl-mustache" id="paginationItemTemplate">
    <div class="paginationItem">
        {{#paginationItemIndexIsOne}}
            <div class="recommender_paginationPageNumber recommender_previousPageIcon" style="visibility: hidden;" aria-hidden="true"></div>
        {{/paginationItemIndexIsOne}}
        {{^paginationItemIndexIsOne}}
            <div class="recommender_paginationPageNumber recommender_previousPageIcon" role="button" aria-label="previous page" tabindex="0"></div>
        {{/paginationItemIndexIsOne}}
        {{#noMorePreviousPageIcon}}
            <div class="recommender_paginationPageNumber morePageIcon morePreviousPageIcon" style="visibility: hidden; cursor: default;" aria-hidden="true">...</div>
        {{/noMorePreviousPageIcon}}
        {{^noMorePreviousPageIcon}}
            <div class="recommender_paginationPageNumber morePageIcon morePreviousPageIcon" style="cursor: default;">...</div>
        {{/noMorePreviousPageIcon}}

        {{#pageNumberIndexes}}
            {{#pageNumberIndexIsActive}}
                <div class="recommender_paginationPageNumber recommender_highlightActivePageNumber" role="button" aria-label="current page: page {{pageNumberIndex}}" tabindex="0">{{pageNumberIndex}}</div>
            {{/pageNumberIndexIsActive}}
            {{^pageNumberIndexIsActive}}
                {{#pageNumberIndexOutOfRange}}
                    <div class="recommender_paginationPageNumber" style="visibility: hidden;" aria-hidden="true">{{pageNumberIndex}}</div>
                {{/pageNumberIndexOutOfRange}}
                {{^pageNumberIndexOutOfRange}}
                    <div class="recommender_paginationPageNumber" role="button" aria-label="page {{pageNumberIndex}}" tabindex="0">{{pageNumberIndex}}</div>
                {{/pageNumberIndexOutOfRange}}
            {{/pageNumberIndexIsActive}}
        {{/pageNumberIndexes}}

        {{#noMoreNextPageIcon}}
            <div class="recommender_paginationPageNumber morePageIcon moreNextPageIcon" style="visibility: hidden; cursor: default;" aria-hidden="true">...</div>
        {{/noMoreNextPageIcon}}
        {{^noMoreNextPageIcon}}
            <div class="recommender_paginationPageNumber morePageIcon moreNextPageIcon" style="cursor: default;">...</div>
        {{/noMoreNextPageIcon}}
        {{#paginationItemIndexIsLast}}
            <div class="recommender_paginationPageNumber recommender_nextPageIcon" style="visibility: hidden;" aria-hidden="true"></div>
        {{/paginationItemIndexIsLast}}
        {{^paginationItemIndexIsLast}}
            <div class="recommender_paginationPageNumber recommender_nextPageIcon" role="button" aria-label="next page" tabindex="0"></div>
        {{/paginationItemIndexIsLast}}
    </div>
</script>
<script type="x-tmpl-mustache" id="recommenderResourceTemplate">
    <div class="recommenderResource" role="region" aria-label="Resource: {{resourceTitle}}" tabindex="0">
        <div class="recommenderVoteBox">
            <div class="recommenderVoteArrowUp" role="button" aria-label="upvote" tabindex="0"></div>
            <div class="recommenderVoteScore" aria-label="{{resourceVotes}} votes" tabindex="0">{{resourceVotes}}</div>
            <div class="recommenderVoteArrowDown" role="button" aria-label="downvote" tabindex="0"></div>
        </div>
        <div class="recommenderBlurb">
            <div class="recommenderTitle"><a href="{{resourceUrl}}" target="_blank" tabindex="0" aria-label="{{resourceText}}">{{resourceTitle}}</a></div>
            <div class="recommenderDescriptionText" aria-hidden="true">{{resourceText}}</div>
            <div class="recommenderDescriptionImg" aria-hidden="true">{{resourceImg}}</div>
            <div class="recommenderEntryId" aria-hidden="true">{{resourceId}}</div>
            <div class="recommenderProblematicReason" aria-hidden="true"></div>
            <div class="recommenderEndorseReason" aria-hidden="true"></div>
        </div>
        <div class="recommenderEndorse">
            <div class="recommender_endorse"></div>
        </div>
        <div class="recommenderEdit"> 
            <span class="ui-icon ui-icon-pencil recommender_resourceEditButton" role="button" aria-label="edit resource" tabindex="0"></span>
            <span class="ui-icon ui-icon-flag recommender_flagResource" role="button" aria-label="flag resource" tabindex="0"></span>
        </div>
    </div>
</script>
<script type="x-tmpl-mustache" id="hideShowTemplate">
    <div class="recommender_expanded" aria-hidden="true"><div class="recommender_upArrow"></div></div>
    <div class="recommender_notExpanded" aria-hidden="true"><div class="recommender_downArrow"></div></div>
</script>
<div class="recommenderBlock">
    <div class="recommenderRecommendations">
        <div class="recommenderContent">
            <div class="recommender_hideShow" role='button' tabindex='0' data-step="1" aria-expanded='false' data-intro="This is a list of recommended resources. If you're stuck, curious, or want to learn more, please look around. If you find a useful resources, help your fellow classmates by adding it!">
                Show related resources
                <div class="recommender_expanded" aria-hidden="true"><div class="recommender_upArrow"></div></div>
                <div class="recommender_notExpanded" aria-hidden="true"><div class="recommender_downArrow"></div></div>
            </div>
            <div class='recommenderRowInner' style='display: none;' aria-hidden="true">
                <div class="recommenderRow">
                    <div class="noResourceIntro" style='display: none;' tabindex='0' aria-hidden="true">    
                        This will be a list of resources your fellow students
                        thought might be helpful, but it is empty currently.
                        If you find useful resources, either on edx.org or 
                        elsewhere, please add it.
                    </div>
                    % for elem in resources:
                        <%
                            if elem['id'] in endorsed_recommendation_ids:
                                endorse_mode = 'recommender_endorsed'
                                endorsed_index = endorsed_recommendation_ids.index(elem['id'])
                                endorsed_reason = endorsed_recommendation_reasons[endorsed_index]
                            else:
                                endorse_mode = ''
                                endorsed_reason = ''

                            if elem['id'] in downvoted_ids:
                                vote_mode = "recommender_downvoting"
                            elif elem['id'] in upvoted_ids:
                                vote_mode = 'recommender_upvoting'
                            else:
                                vote_mode = ''

                            if elem['id'] in flagged_ids:
                                flag_mode = 'recommender_problematic'
                                reason = flagged_reasons[flagged_ids.index(elem['id'])]
                            else:
                                flag_mode = ''
                                reason = ''
                        %>
                        <%include file="resourcebox.html" args="id=elem['id'],title=elem['title'],votes=elem['votes'],url=elem['url'],description=elem['description'],descriptionText=elem['descriptionText'],isProblematic=flag_mode,problematicReason=reason,voteMode=vote_mode,endorseMode=endorse_mode,endorsedReason=endorsed_reason" />
                    % endfor
                </div>
                <div class="recommender_resourceAddButton" role="button" tabindex="0">Add new resource &gt;&gt;</div>
                <div class="recommender_resourceExportButton" role="button" tabindex="0">Download resources</div>
                <div class="recommender_resourceImportButton" role="button" style='display: none;' tabindex="0" aria-hidden="true">Upload resources</div>
                <div class="recommender_clearFix"></div>
                <div class="recommender_resourceRankingForRemovalButton" style='display: none;' aria-hidden="true">mode</div>
                <div class="recommender_clearFix"></div>
                <div class="recommender_pagination"></div>
                <div class="recommenderDescription">
                    <div class="recommender_descriptionImg">
                        <div class='recommender_showEndorsedReasons' style='display: none;' aria-hidden="true"></div>
                        <div class="recommender_clearFix"></div>
                        <div class='recommender_showProblematicReasons' style='display: none;' aria-hidden="true"></div>
                        <div class="recommender_clearFix"></div>
                        <div class='recommender_descriptionText'> This is a list of resources your fellow students
                            thought might be helpful. If you find another useful
                            resource, either on edx.org or elsewhere, please add
                            it. If you can improve the description or preview of a
                            resource, please do so as well. If you find a resource
                            helpful, upvote it. If it&rsquo;s not so helpful, downvote
                            it. If it has issues (illegal material, incorrect, etc.),
                            please flag it and let us know the reason. </div>
                        <img class="recommender_previewingImg" style='display: none;' src="" aria-hidden="true"/>
                    </div>
                </div>
            </div>
        </div>
        <div class='recommenderModify' style='display: none;' tabindex="0" role='region' aria-hidden="true">
            <div class='recommenderModifyTitleContainer'>
                <div class='recommender_backToViewButton' role='button' tabindex="0" aria-label='cancel and go back to resource list'>&lt; Related resources</div>
                <div class='recommenderModifyTitle'></div>
            </div>
            <div class="recommender_importResourcePage" style='display: none;' aria-hidden="true">
                <div class="recommender_modifyPageTitle"></div>
                <form method="post" class="importResourceForm">
                    Resources (in JSON format): <input type="file" name="file" aria-label='Provide a file of resource list in JSON format' class='importResourceFile'/><br/>
                    <input type="button" value="Upload resources" class="recommender_importResourceSubmit" disabled/>
                </form>
            </div>
            <div class="recommender_removePage" style='display: none;' aria-hidden="true">
                <div class="recommender_modifyPageTitle"></div>
                <label>Reason&nbsp;
                    <input type="text"
                        class="recommender_removeReason" 
                        name="removeRationale"
                        placeholder="Reason for why this resource should be removed"/>
                </label>
                <input type="button" value="Remove resource" class="recommender_removeResource"/>
            </div>
            <div class="recommender_endorsePage" style='display: none;' aria-hidden="true">
                <div class="recommender_modifyPageTitle"></div>
                <label>Reason&nbsp;
                    <input type="text"
                        class="recommender_endorseReason" 
                        name="endorseRationale"
                        placeholder="Reason for why this resource should be endorsed"/>
                </label>
                <input type="button" value="Endorse resource" class="recommender_endorseResource"/>
            </div>
            <div class="recommender_flagResourcePage" style='display: none;' aria-hidden="true">
                <div class="recommender_modifyPageTitle"></div>
                <label>Reason&nbsp;
                    <input type="text"
                        class="recommender_flagReason" 
                        name="flagRationale"
                        placeholder="Reason for why this resource should be flagged"/>
                </label>
                <input type="button" value="Flag resource" class="recommender_flagReasonSubmit"/>
            </div>
            <div class="recommender_editResourcePage" style='display: none;' aria-hidden="true">
                <div class="recommender_modifyPageTitle"></div>
                <label>Title&nbsp;<span class='recommender_redTxt' aria-hidden="true"></span>
                    <textarea
                        aria-label='Provide a resource title, required'
                        class="recommender_editTitle"
                        placeholder="Provide a meaningful title so other students know whether this is useful to them"></textarea>
                </label>
                <label>Location&nbsp;<span class='recommender_redTxt' aria-hidden="true"></span>
                    <input type="text"
                        aria-label='Provide a resource location in url, required'
                        class="recommender_editUrl"
                        placeholder="http://en.wikipedia.org/wiki/Edx"/>
                </label>
                <label>Description&nbsp;
                    <textarea
                        aria-label='Provide a resource description'
                        class="recommender_editDescriptionText"
                        placeholder="Provide a meaningful description so other students know whether this is useful to them"></textarea>
                </label>
                <form method="post" class="editResourceForm">
                    Preview screenshot: <input type="file" name="file" aria-label='Provide a resource screenshot' class='editResourceScreenshot'/><br/>
                    <input type="button" value="Save change" class="recommender_editSubmit" disabled/>
                </form>
            </div>
            <div class="recommender_addResourcePage" style='display: none;' aria-hidden="true">
                <div class="recommender_modifyPageTitle"></div>
                <label>Title&nbsp;<span class='recommender_redTxt' aria-hidden="true"></span>
                    <textarea
                        aria-label='Provide a resource title, required'
                        class="recommender_inTitle" 
                        placeholder="Provide a meaningful title so other students know whether this is useful to them"></textarea>
                </label>
                <label>Location&nbsp;<span class='recommender_redTxt' aria-hidden="true"></span>
                    <input type="text"
                        aria-label='Provide a resource location in url, required'
                        class="recommender_inUrl"
                        placeholder="http://en.wikipedia.org/wiki/Edx"/>
                </label>
                <label>Description&nbsp;
                    <textarea
                        aria-label='Provide a resource description'
                        class="recommender_inDescriptionText" 
                        placeholder="Provide a meaningful description so other students know whether this is useful to them"></textarea>
                </label>
                <form method="post" class="addResourceForm">
                    Preview screenshot: <input type="file" name="file" aria-label='Provide a file of resource screenshot' class='addResourceScreenshot'/><br/>
                    <input type="button" value="Add resource" class="recommender_addSubmit" disabled/>
                </form>
            </div>
        </div>
    </div>
</div>
