asset_index.html 6.68 KB
Newer Older
1
<%page expression_filter="h"/>
2
<%inherit file="base.html" />
Mark Hoeber committed
3
<%def name="online_help_token()"><% return "files" %></%def>
4 5 6
<%!
  from django.core.urlresolvers import reverse
  from django.utils.translation import ugettext as _
7
  from openedx.core.djangolib.markup import HTML, Text
8
  from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
9
%>
10
<%block name="title">${_("Files & Uploads")}</%block>
11
<%block name="bodyclass">is-signedin course uploads view-uploads</%block>
12

13 14
<%namespace name='static' file='static_content.html'/>

15
<%block name="header_extras">
16 17 18 19 20
    % for template_name in ["asset"]:
    <script type="text/template" id="${template_name}-tpl">
        <%static:include path="js/${template_name}.underscore" />
    </script>
    % endfor
21 22
</%block>

23
% if not waffle_flag_enabled:
24 25
<%block name="requirejs">
    require(["js/factories/asset_index"], function (AssetIndexFactory) {
Jim committed
26
        AssetIndexFactory({
27 28 29 30
          assetCallbackUrl: "${asset_callback_url|n, js_escaped_string}",
          uploadChunkSizeInMBs: ${chunk_size_in_mbs|n, dump_js_escaped_json},
          maxFileSizeInMBs: ${max_file_size_in_mbs|n, dump_js_escaped_json},
          maxFileSizeRedirectUrl: "${max_file_size_redirect_url|n, js_escaped_string}"
Jim committed
31
        });
32
    });
33
</%block>
34
% endif
35

36
<%block name="content">
Brian Talbot committed
37

38
<div class="wrapper-mast wrapper">
39
    <header class="mast has-actions has-subtitle">
40
        <h3 class="page-header">
41
            <small class="subtitle">${_("Content")}</small>
42 43
            <span class="sr">- </span>${_("Files & Uploads")}
        </h3>
44

45
        <div class="nav-actions">
46 47
            <ul>
                <li class="nav-item">
48
                    <a href="#" class="button upload-button new-button"><span class="icon fa fa-plus" aria-hidden="true"></span> ${_("Upload New File")}</a>
49 50
                </li>
            </ul>
51
        </div>
52 53
    </header>
</div>
54

55
<div class="wrapper-content wrapper">
56 57
    <div class="content">
        <div class="content-primary">
58
            % if waffle_flag_enabled:
59 60 61 62 63 64 65 66 67 68 69
                <%static:studiofrontend page="AssetsPage" lang="fr">
                    {
                        "id": "${context_course.id | n, js_escaped_string}",
                        "name": "${context_course.display_name_with_default | n, js_escaped_string}",
                        "url_name": "${context_course.location.name | n, js_escaped_string}",
                        "org": "${context_course.location.org | n, js_escaped_string}",
                        "num": "${context_course.location.course | n, js_escaped_string}",
                        "display_course_number": "${context_course.display_coursenumber | n, js_escaped_string}",
                        "revision": "${context_course.location.revision | n, js_escaped_string}"
                    }
                </%static:studiofrontend>
70 71 72
            % else:
                <div class="wrapper-assets"></div>
            % endif
73
            <div class="ui-loading">
74
                <p><span class="spin"><span class="icon fa fa-refresh" aria-hidden="true"></span></span> <span class="copy">${_("Loading")}</span></p>
75
            </div>
76
        </div>
77

78
        <aside class="content-supplementary" role="complementary" aria-label="${_("Help adding Files and Uploads")}">
79
            <div class="bit">
80 81
                <h3 class="title-3">${_("Adding Files for Your Course")}</h3>

82
                <p>${Text(_("To add files to use in your course, click {em_start}Upload New File{em_end}. Then follow the prompts to upload a file from your computer.")).format(em_start=HTML("<strong>"), em_end=HTML("</strong>"))}</p>
83

84
                <p>${Text(_("{em_start}Caution{em_end}: {platform_name} recommends that you limit the file size to {em_start}10 MB{em_end}. In addition, do not upload video or audio files. You should use a third party service to host multimedia files.")).format(em_start=HTML("<strong>"), em_end=HTML("</strong>"), platform_name=settings.PLATFORM_NAME)}</p>
85 86

            	<p>${_("The course image, textbook chapters, and files that appear on your Course Handouts sidebar also appear in this list.")}</p>
87 88
            </div>
            <div class="bit">
89
                <h3 class="title-3">${_("Using File URLs")}</h3>
90

91
                <p>${Text(_("Use the {em_start}{studio_name} URL{em_end} value to link to the file or image from a component, a course update, or a course handout.")).format(studio_name=settings.STUDIO_SHORT_NAME, em_start=HTML("<strong>"), em_end=HTML("</strong>"))}</p>
92

93
                <p>${Text(_("Use the {em_start}Web URL{em_end} value to reference the file or image only from outside of your course. {em_start}Note:{em_end} If you lock a file, the Web URL no longer works for external access to a file.")).format(em_start=HTML("<strong>"), em_end=HTML("</strong>"))}</p>
94 95

                <p>${_("To copy a URL, double click the value in the URL column, then copy the selected text.")}</p>
96
            </div>
97 98
            <div class="bit external-help">
                <a href="${get_online_help_info(online_help_token())['doc_url']}" target="_blank" class="button external-help-button">${_("Learn more about managing files")}</a>
99
            </div>
100

101
        </aside>
102
    </div>
103 104 105
</div>

<div class="upload-modal modal">
106
    <a href="#" class="close-button"><span class="icon fa fa-times-circle" aria-hidden="true"></span> <span class="sr">${_('close')}</span></a>
107
    <div class="modal-body">
108 109
        <h2 class="title">${_("Upload New File")}</h2>
        <p>${_("Max per-file size: {max_filesize}MB").format(max_filesize=max_file_size_in_mbs)}</p>
110
        <p class="file-name">
Julian Arni committed
111
        <div class="progress-bar">
112 113 114
            <div class="progress-fill"></div>
        </div>
        <div class="embeddable">
115
            <label>${_('URL:')}</label>
116
            <input type="text" class="embeddable-xml-input" value='' readonly>
Julian Arni committed
117
        </div>
cahrens committed
118
        <form class="file-chooser" action="${asset_callback_url}"
119 120 121
              method="post" enctype="multipart/form-data">
            <a href="#" class="choose-file-button">${_("Choose File")}</a>
            <input type="file" class="file-input" name="file" multiple>
Julian Arni committed
122
        </form>
123
    </div>
124
</div>
125

Lyla Fischer committed
126

127
</%block>
128 129 130 131

<%block name="view_alerts">
<!-- alert: save confirmed with close -->
<div class="wrapper wrapper-alert wrapper-alert-confirmation" role="status">
132
    <div class="alert confirmation">
133
        <span class="icon fa fa-check" aria-hidden="true"></span>
134

135 136 137
        <div class="copy">
            <h2 class="title title-3">${_('Your file has been deleted.')}</h2>
        </div>
138

139
        <a href="" rel="view" class="action action-alert-close">
140
            <span class="icon fa fa-times-circle" aria-hidden="true"></span>
141 142 143
            <span class="label">${_('close alert')}</span>
        </a>
    </div>
144 145
</div>
</%block>