Comments (5)
@sveetch a few elements that could help us solve the issues you raise:
- It seems that the "render_placeholder" template tag can be assigned to a variable (see https://github.com/divio/django-cms/blob/7888ab8421bb836c8f7a1127d9a2bf4d4bbdf23e/cms/templatetags/cms_tags.py#L1103). Which means that you should be able to trunk it with a templatetag when displaying the variable?
{% render_placeholder "course_syllabus" as course_syllabus %}
{{ course_syllabus|truncatechars_html:150 }}
- For the preview image, it's a bit more tricky but we could add a placeholder in the template of the course and wrap it with {% if current_page.publisher_is_draft %} so that it only appears on the draft page. You won't see it on the public page but you can still display it in your course glimpse with a {% render_placeholder %} template tag... smart leh? And what would be very nice is to display these "draft only elements" in a special materialized block on top of the draft course detail view. WDYT?
from richie.
@sampaccoud syllabus are free HTML content, mostly paragraphs and i don't think you can correctly truncate this. There is https://docs.djangoproject.com/en/2.1/ref/templates/builtins/#truncatechars-html but the example is about only one paragraph, not sure how it will work with two or more paragraphs.
For the image preview displayed only in draft, well yeah it's "smart", but as you said it also it's tricky :) I'm not very confident about, in my opinions the draft should reflect what will be showed in published version, not to include additional information that will go elsewhere.
We have to take a little more time to think about these solutions.
from richie.
So with more discussion about this, we finally choose to add image preview as a placeholder that will show only in draft mode (with conditional "if" blocks around placeholder) that have to be showed as a preview. No short resume text to add since, in fact, course glimpse card don't have to show a resume, i was wrong because it's just the organization name.
from richie.
@sveetch I have the feeling this issue is now fixed can you confirm?
from richie.
You are right, closing it
from richie.
Related Issues (20)
- Joanie Coure Run enrollment resource link
- How to run the cookie cutter with custom domain HOT 2
- ♻️ Refactor frontend test suite
- On the teacher dashboard, we display at the same time the loading AND an empty placeholder.
- Frontend - Dashboard learner - CRUD Credit Card
- "Load more" remains displayed at the bottom of the list on teacher dashboard HOT 1
- Frontend - View - Learner Dashboard - Order detail payment schedule
- Frontend - View - Administration Dashboard - Learner file
- Frontend - Sale Tunnel - New Sale Tunnel with payment schedule
- Download Certificate / Contract does not work HOT 1
- Fix `HttpError` constructor with empty statusText
- Remove Google Universal Analytics
- ✨(frontend) Exclude dummy backend from production build
- Flag as enrolled to On going products HOT 1
- Ongoing products linked to the Joanie product resource link
- Learner dashboard - Contract download - Error message shown without error
- Teacher dashboard - Protected routes
- utils onSuggestionsFetchRequested raising lot of errors
- Ecommerce integration HOT 1
- ✨(frontend) add "purchased" flag on learner dashboard course item
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from richie.