Getting started with AlpineJS

Updating article status classes in the homepage

Want more?

This lesson for enrolled students only. Join the course to unlock it!

You can see the code changes implemented in this lecture below.

If you have purchased the course in a different platform, you still have access to the code changes per lecture here on Teclado. The lecture video and lecture notes remain locked.
Join course for $15

Modified files

templates/app/home.html
--- 
+++ 
@@ -28,7 +28,7 @@
           class="text-2xl flex items-center"
           href="{% url 'update_article' article.id %}">
           {{ article.title }}
-          <span class="ml-2 px-4 py-0.5 text-xs rounded-sm uppercase">{{ article.status }}</span>
+          <span class="ml-2 px-4 py-0.5 text-xs rounded-sm uppercase article-status-{{article.status}}">{{ article.status }}</span>
         </a>
         <p class="text-sm">{{ article.word_count }} word{{ article.word_count | pluralize }}</p>
       </li>