Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- if count(movies) > 0 -->
- <!-- render "item", movies --> # TODO: Render array as `partial :collection` in rails
- <!-- else -->
- No movies given
- <!-- end -->
- <!-- for movie in movies --> # TODO: for loop
- <!-- render "item", movie -->
- <!-- else --> # TODO: else block for a loop
- No movies given
- <!-- end -->
- <!-- template "item", item --> # TODO: template defined with argument
- <li itemscope itemtype="/movies" itemprop="movie" itemid="{id}"> # TODO: attribute interpolation
- <h2 itemprop="title"></h2> # binding via microdata
- <dl>
- <!-- if present(filename) --> # widget itemscope creates local variable scope
- <dt>Filename:</dt>
- <dd itemprop="filename"></dd>
- <!-- end -->
- <!-- if present(item.length_in_seconds) --> # full variable path may be used too
- <dt>Length:</dt>
- <dd itemprop="length_in_seconds">
- {pluralize(item.length_in_seconds, "second")} # binding via interpolation
- </dd>
- <!-- end -->
- <dt>Media pools:</dt>
- <!-- if present(media_pools) -->
- <dd>
- <ul class="tags">
- <!-- for pool in media_pools -->
- <li itemprop="media_pools">
- <a href="/media_pools/{id}"> # id points to the nearest model in the chain, so it's pool.id
- {pool.title}
- </a>
- </li>
- <!-- end -->
- </ul>
- </dd>
- <!-- else -->
- <dd class="visible">
- <span class="empty">Not on air</span>
- <a class="icon add" href="/movies/{id}/edit" transport="xhr" target="& ! item :replace()">
- Assign pool
- </a>
- </dd>
- <!-- end -->
- </dl>
- <!-- end -->
Add Comment
Please, Sign In to add comment