-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP wiki support for microsite templates #10623
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
{% block headextra %}{% endblock %} | ||
{% render_block "css" %} | ||
|
||
{% optional_include "head-extra.html" %} | ||
{% optional_include "head-extra.html"|microsite_template_path %} | ||
|
||
<meta name="path_prefix" content="{{EDX_ROOT_URL}}"> | ||
</head> | ||
|
@@ -28,14 +28,14 @@ | |
<div class="window-wrap" dir="${static.dir_rtl()}"> | ||
<a class="nav-skip" href="{% block nav_skip %}#content{% endblock %}">{% trans "Skip to main content" %}</a> | ||
{% with course=request.course %} | ||
{% include "header.html" %} | ||
{% include "header.html"|microsite_template_path %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattdrayer @chrisndodge I investigated it on my side after pulling down this branch. It seems me, wiki page is based on Django templates rather than mako and after running the lms on this branch , It seems me header from microsite is not loading in wiki. You can see that templates/header.html is based on mako in microsite and main_django.html in wiki page is trying to load this microsite header file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @felipemontoya if you can address this issue today, that would be great. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure I understood what you mean, but the renderer is actually capable of including Mako templates from within a django_template. That is what the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then It means, our microsite templates should have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, although not every single template needs it. It is only used when loading mako templates from inside django_templates. Some examples that do need it are header.html and footer.html. Once the templates is mako, it can include other mako templates without needing the ## mako line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, so I guess I'm not clear on what needs to happen next for this PR -- @asadiqbal08, do we need to update additional microsite templates in our repo with the mako tag prior to merging in order to avoid breakages? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattdrayer make tag @mattdrayer @felipemontoya It seems me that microsite css is not rendering in wiki. we need to override the microsite css. I just tested it after adding the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @asadiqbal08 -- okay, let's go ahead and make the necessary changes in the edx-microsites repository. Please log a WL ticket to track the job and add it to the current sprint. |
||
{% endwith %} | ||
<div class="content-wrapper" id="content"> | ||
{% block body %}{% endblock %} | ||
{% block bodyextra %}{% endblock %} | ||
</div> | ||
{% with course=request.course %} | ||
{% include "footer.html" %} | ||
{% include "footer.html"|microsite_template_path %} | ||
{% endwith %} | ||
|
||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any risk if template_name is None? That probably wouldn't happen in practice, but it seems like we might want a quick exit at the top of the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is very little chances of that happening since it is used as a filter on a static string. But since the consequences of that would be annoying (500 error) we might as well prevent it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now there are only 2 known use cases of this tag: "navigation.html" and "footer.html", but eventually it could be used on variables as well and the risk would rise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, just checking back into this PR, are you going to be able to put in those None guards? Thanks. In the meantime, I'm going to pull this down and try locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. I loaded up this branch on its devstack and tried to pass None in the template name. With or without the None guards it will throw an error, the difference would be if is either TemplateDoesNotExist: No exception supplied, or IndexError: string index out of range. I think it does not make a big difference, but if you think they are still required, just ping me here, and I will add them and push them right away.