index.html 16.4 KB
Newer Older
Steve Strassmann committed
1 2
<%! from django.utils.translation import ugettext as _ %>

3
<%inherit file="base.html" />
4

Steve Strassmann committed
5
<%block name="title">${_("My Courses")}</%block>
6
<%block name="bodyclass">is-signedin index view-dashboard</%block>
7

8 9
<%block name="jsextra">
<script type="text/javascript">
cahrens committed
10
require(["domReady!", "jquery", "jquery.form", "js/index"], function(doc, $) {
11 12 13 14 15
    // showing/hiding creation rights UI
    $('.show-creationrights').click(function(e){
        (e).preventDefault();
        $(this).closest('.wrapper-creationrights').toggleClass('is-shown').find('.ui-toggle-control').toggleClass('current');
    });
16

17 18 19
    var reloadPage = function () {
        location.reload();
    };
cahrens committed
20

21 22 23 24
    var showError = function ()  {
        $('#request-coursecreator-submit').toggleClass('has-error').find('.label').text('Sorry, there was error with your request');
        $('#request-coursecreator-submit').find('.icon-cog').toggleClass('icon-spin');
    };
cahrens committed
25

26
    $('#request-coursecreator').ajaxForm({error: showError, success: reloadPage});
27

28 29
    $('#request-coursecreator-submit').click(function(e){
      $(this).toggleClass('is-disabled is-submitting').find('.label').text('Submitting Your Request');
30
    });
31
});
32 33 34
</script>
</%block>

Chris Dodge committed
35
<%block name="content">
36 37 38
<div class="wrapper-mast wrapper">
  <header class="mast has-actions">
    <h1 class="page-header">${_("My Courses")}</h1>
39

40 41 42 43 44
    % if user.is_active:
    <nav class="nav-actions">
      <h3 class="sr">${_("Page Actions")}</h3>
      <ul>
        <li class="nav-item">
45 46 47
          % if course_creator_status=='granted':
          <a href="#" class="button new-button new-course-button"><i class="icon-plus icon-inline"></i>
              ${_("New Course")}</a>
48 49
          % elif course_creator_status=='disallowed_for_this_site' and settings.FEATURES.get('STUDIO_REQUEST_EMAIL',''):
          <a href="mailto:${settings.FEATURES.get('STUDIO_REQUEST_EMAIL','')}">${_("Email staff to create course")}</a>
50 51 52 53 54 55 56 57 58
          % endif
        </li>
      </ul>
    </nav>
    % endif
  </header>
</div>

<div class="wrapper-content wrapper">
59
  % if user.is_active:
60 61
  <section class="content">
    <article class="content-primary" role="main">
62

63
      <div class="introduction">
David Baumgold committed
64
        <h2 class="title">${_("Welcome, {0}!").format(user.username)}</h2>
65

66
        %if len(courses) > 0:
67 68 69
        <div class="copy">
          <p>${_("Here are all of the courses you currently have access to in Studio:")}</p>
        </div>
70 71 72 73 74 75

        %else:
        <div class="copy">
          <p>${_("You currently aren't associated with any Studio Courses.")}</p>
        </div>
        %endif
76
      </div>
77

78
      % if course_creator_status=='granted':
79
      <div class="wrapper-create-element wrapper-create-course">
80 81 82 83 84 85 86 87 88 89 90 91 92 93
        <form class="create-course course-info" id="create-course-form" name="create-course-form">
          <div class="wrap-error">
            <div id="course_creation_error" name="course_creation_error" class="message message-status message-status error" role="alert">
            <p>${_("Please correct the highlighted fields below.")}</p>
            </div>
          </div>

          <div class="wrapper-form">
            <h3 class="title">${_("Create a New Course")}</h3>

            <fieldset>
              <legend class="sr">${_("Required Information to Create a New Course")}</legend>

              <ol class="list-input">
94
                <li class="field text required" id="field-course-name">
95 96
                  <label for="new-course-name">${_("Course Name")}</label>
                  <input class="new-course-name" id="new-course-name" type="text" name="new-course-name" aria-required="true" placeholder="${_('e.g. Introduction to Computer Science')}" />
97
                  <span class="tip">${_("The public display name for your course.")}</span>
98
                  <span class="tip tip-error is-hiding"></span>
99
                </li>
100
                <li class="field text required" id="field-organization">
101
                  <label for="new-course-org">${_("Organization")}</label>
102 103
                  <input class="new-course-org" id="new-course-org" type="text" name="new-course-org" aria-required="true" placeholder="${_('e.g. UniversityX or OrganizationX')}" />
                  <span class="tip">${_("The name of the organization sponsoring the course.")}  <strong>${_("Note: This is part of your course URL, so no spaces or special characters are allowed.")}</strong> ${_("This cannot be changed, but you can set a different display name in Advanced Settings later.")}</span>
104
                  <span class="tip tip-error is-hiding"></span>
105 106
                </li>

107
                <li class="field text required" id="field-course-number">
108 109
                  <label for="new-course-number">${_("Course Number")}</label>
                  <input class="new-course-number" id="new-course-number" type="text" name="new-course-number" aria-required="true" placeholder="${_('e.g. CS101')}" />
110
                  <span class="tip">${_("The unique number that identifies your course within your organization.")} <strong>${_("Note: This is part of your course URL, so no spaces or special characters are allowed and it cannot be changed.")}</strong></span>
111
                  <span class="tip tip-error is-hiding"></span>
112 113
                </li>

114
                <li class="field text required" id="field-course-run">
115
                  <label for="new-course-run">${_("Course Run")}</label>
116 117
                  <input class="new-course-run" id="new-course-run" type="text" name="new-course-run" aria-required="true"placeholder="${_('e.g. 2014_T1')}" />
                  <span class="tip">${_("The term in which your course will run.")} <strong>${_("Note: This is part of your course URL, so no spaces or special characters are allowed and it cannot be changed.")}</strong></span>
118
                  <span class="tip tip-error is-hiding"></span>
119 120 121 122 123 124 125
                </li>
              </ol>

            </fieldset>
          </div>

          <div class="actions">
126
            <input type="submit" value="${_('Create')}" class="action action-primary new-course-save" />
127 128 129 130
            <input type="button" value="${_('Cancel')}" class="action action-secondary action-cancel new-course-cancel" />
          </div>
        </form>
      </div>
131
      % endif
132

133
      %if len(courses) > 0:
134 135
      <div class="courses">
        <ul class="list-courses">
136
          %for course, url, lms_link, org, num, run in sorted(courses, key=lambda s: s[0].lower() if s[0] is not None else ''):
137
          <li class="course-item">
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
            <a class="course-link" href="${url}">
              <h3 class="course-title">${course}</h3>

              <div class="course-metadata">
                <span class="course-org metadata-item">
                  <span class="label">${_("Organization:")}</span> <span class="value">${org}</span>
                </span>
                <span class="course-num metadata-item">
                  <span class="label">${_("Course Number:")}</span>
                  <span class="value">${num}</span>
                </span>
                <span class="course-run metadata-item">
                  <span class="label">${_("Course Run:")}</span> <span class="value">${run}</span>
                </span>
              </div>
153
            </a>
154 155 156 157 158 159

            <ul  class="item-actions course-actions">
              <li class="action">
                <a href="${lms_link}" rel="external" class="button view-button view-live-button">${_("View Live")}</a>
              </li>
            </ul>
160 161 162
          </li>
          %endfor
        </ul>
163 164
      </div>

165
      %else:
166 167 168
      <div class="courses">
      </div>

169 170 171 172 173 174 175 176 177
      <div class="notice notice-incontext notice-instruction notice-instruction-nocourses list-notices">
        <div class="notice-item">
          <div class="msg">
            <h3 class="title">${_("Are you staff on an existing Studio course?")}</h3>
            <div class="copy">
              <p>${_('You will need to be added to the course in Studio by the course creator. Please get in touch with the course creator or administrator for the specific course you are helping to author.')}</p>
            </div>
          </div>
        </div>
178

179 180 181 182 183 184 185
        %if course_creator_status == "granted":
        <div class="notice-item has-actions">
          <div class="msg">
            <h3 class="title">${_('Create Your First Course')}</h3>
            <div class="copy">
              <p>${_('Your new course is just a click away!')}</p>
            </div>
186
          </div>
187

188 189 190 191 192 193 194
          <ul class="list-actions">
            <li class="action-item">
              <a href="#" class="action-primary action-create action-create-course new-course-button"><i class="icon-plus icon-inline"></i> ${_('Create Your First Course')}</a>
            </li>
          </ul>
        </div>
        % endif
195

196 197
      </div>
      % endif
198 199


200 201 202 203 204
      %if course_creator_status == "unrequested":
      <div class="wrapper wrapper-creationrights">
        <h3 class="title">
          <a href="#instruction-creationrights" class="ui-toggle-control show-creationrights"><span class="label">${_('Becoming a Course Creator in Studio')}</span> <i class="icon-remove-sign"></i></a>
        </h3>
205

206 207 208 209
        <div class="notice notice-incontext notice-instruction notice-instruction-creationrights ui-toggle-target" id="instruction-creationrights">
          <div class="copy">
            <p>${_('edX Studio is a hosted solution for our xConsortium partners and selected guests. Courses for which you are a team member appear above for you to edit, while course creator privileges are granted by edX. Our team will evaluate your request and provide you feedback within 24 hours during the work week.')}</p>
          </div>
210

211 212
          <div class="status status-creationrights is-unrequested">
            <h4 class="title">${_('Your Course Creator Request Status:')}</h4>
213

214 215
            <form id="request-coursecreator" action="${request_course_creator_url}" method="post" enctype="multipart/form-data">
              <div class="form-actions">
216
                <button type="submit" id="request-coursecreator-submit" name="request-coursecreator-submit" class="action-primary action-request"><i class="icon-cog icon-inline icon-spin"></i> <span class="label">${_('Request the Ability to Create Courses')}</span></button>
217 218 219
              </div>
            </form>
          </div>
220 221
        </div>
      </div>
222

223 224 225 226 227
      %elif course_creator_status == "denied":
      <div class="wrapper wrapper-creationrights is-shown">
        <h3 class="title">
          <a href="#instruction-creationrights" class="ui-toggle-control current show-creationrights"><span class="label">${_('Your Course Creator Request Status')}</span> <i class="icon-remove-sign"></i></a>
        </h3>
228

229 230 231 232
        <div class="notice notice-incontext notice-instruction notice-instruction-creationrights ui-toggle-target" id="instruction-creationrights">
          <div class="copy">
            <p>${_('edX Studio is a hosted solution for our xConsortium partners and selected guests. Courses for which you are a team member appear above for you to edit, while course creator privileges are granted by edX. Our team is has completed evaluating your request.')}</p>
          </div>
233

234 235 236 237 238 239 240 241 242 243 244 245
          <div class="status status-creationrights has-status is-denied">
            <h4 class="title">${_('Your Course Creator Request Status:')}</h4>

            <dl class="status-update">
              <dt class="label">${_('Your Course Creator request is:')}</dt>
              <dd class="value">
                <span class="status-indicator"></span>
                <span class="value-formal">${_('Denied')}</span>
                <span class="value-description">${_('Your request did not meet the criteria/guidelines specified by edX Staff.')}</span>
              </dd>
            </dl>
          </div>
246 247 248
        </div>
      </div>

249 250 251 252 253
      %elif course_creator_status == "pending":
      <div class="wrapper wrapper-creationrights is-shown">
        <h3 class="title">
          <a href="#instruction-creationrights" class="ui-toggle-control current show-creationrights"><span class="label">${_('Your Course Creator Request Status')}</span> <i class="icon-remove-sign"></i></a>
        </h3>
254

255 256 257 258
        <div class="notice notice-incontext notice-instruction notice-instruction-creationrights ui-toggle-target" id="instruction-creationrights">
          <div class="copy">
            <p>${_('edX Studio is a hosted solution for our xConsortium partners and selected guests. Courses for which you are a team member appear above for you to edit, while course creator privileges are granted by edX. Our team is currently  evaluating your request.')}</p>
          </div>
259

260 261 262 263 264 265 266 267 268 269 270 271
          <div class="status status-creationrights has-status is-pending">
            <h4 class="title">${_('Your Course Creator Request Status:')}</h4>

            <dl class="status-update">
              <dt class="label">${_('Your Course Creator request is:')}</dt>
              <dd class="value">
                <span class="status-indicator"></span>
                <span class="value-formal">${_('Pending')}</span>
                <span class="value-description">${_('Your request is currently being reviewed by edX staff and should be updated shortly.')}</span>
              </dd>
            </dl>
          </div>
272 273
        </div>
      </div>
274
      % endif
275

276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
    </article>

    <aside class="content-supplementary" role="complimentary">
      <div class="bit">
        <h3 class="title title-3">${_('Need help?')}</h3>
        <p>${_('If you are new to Studio and having trouble getting started, there are a few things that may be of help:')}</p>

        <ol class="list-actions">
          <li class="action-item">
            <a href="http://files.edx.org/Getting_Started_with_Studio.pdf" title="This is a PDF Document">${_('Get started by reading Studio\'s Documentation')}</a>
          </li>
          <li class="action-item">
            <a href="http://help.edge.edx.org/discussion/new" class="show-tender" title="Use our feedback tool, Tender, to request help">${_('Request help with Studio')}</a>
          </li>
        </ol>
      </div>

293
      % if course_creator_status=='disallowed_for_this_site' and settings.FEATURES.get('STUDIO_REQUEST_EMAIL',''):
294 295
      <div class="bit">
        <h3 class="title title-3">${_('Can I create courses in Studio?')}</h3>
296
        <p>${_('In order to create courses in Studio, you must')} <a href="mailto:${settings.FEATURES.get('STUDIO_REQUEST_EMAIL','')}">${_("contact edX staff to help you create a course")}</a></p>
297 298 299
      </div>
      % endif

300
      % if course_creator_status == "unrequested":
301 302
      <div class="bit">
        <h3 class="title title-3">${_('Can I create courses in Studio?')}</h3>
303
        <p>${_('In order to create courses in Studio, you must have course creator privileges to create your own course.')}</p>
304 305
      </div>

306
      % elif course_creator_status == "denied":
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
      <div class="bit">
        <h3 class="title title-3">${_('Can I create courses in Studio?')}</h3>
        <p>${_('Your request to author courses in studio has been denied. Please')} <a href="http://help.edge.edx.org/discussion/new" class="show-tender">${_('contact edX Staff with further questions')}</a></p>
      </div>

      % endif
    </aside>
  </section>


  % else:
  <section class="content">
    <article class="content-primary" role="main">
      <div class="introduction">
        <h2 class="title">${_("Thanks for signing up, %(name)s!") % dict(name= user.username)}</h2>
      </div>

      <div class="notice notice-incontext notice-instruction notice-instruction-verification">
        <div class="msg">
          <h3 class="title">${_('We need to verify your email address')}</h3>
          <div class="copy">
cahrens committed
328
            <p>${_('Almost there! In order to complete your sign up we need you to verify your email address (%(email)s). An activation message and next steps should be waiting for you there.') % dict(email=user.email)}</p>
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
          </div>
        </div>
      </div>
    </article>

    <aside class="content-supplementary" role="complimentary">
      <div class="bit">
        <h3 class="title title-3">${_('Need help?')}</h3>
        <p>${_('Please check your Junk or Spam folders in case our email isn\'t in your INBOX. Still can\'t find the verification email? Request help via the link below.')}</p>

        <ol class='list-actions'>
          <li class="action-item">
            <a href="http://help.edge.edx.org/discussion/new" class="show-tender" title="Use our feedback tool, Tender, to request help">Request help with your Studio account</a>
          </li>
        </ol>
      </div>
    </aside>
  </section>

  %endif
</div>
Steve Strassmann committed
350
</%block>