-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from pateljannat/sketch-card
fix: sketch card
- Loading branch information
Showing
4 changed files
with
87 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
<div class='container'> | ||
<div class="row"> | ||
{% for sketch in sketches %} | ||
<div class="col-md-3"> | ||
<div class="sketch-teaser"> | ||
<div class="sketch-image"> | ||
<a href="/sketches/{{sketch.sketch_id}}"> | ||
<img src="{{sketch.get_image_url()}}"> | ||
</a> | ||
</div> | ||
<div class="sketch-footer"> | ||
<div class="sketch-title"> | ||
<a href="sketches/{{sketch.sketch_id}}">{{sketch.title}}</a> | ||
</div> | ||
<div class="sketch-author"> | ||
{% set owner = sketch.get_owner() %} | ||
by <a href="/{{owner.username}}">{{owner.full_name}}</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% from "www/macros/sketch_card.html" import sketch_card %} | ||
<div class="sketch-list"> | ||
{% for sketch in sketches %} | ||
{{ sketch_card(sketch, False, widgets) }} | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% macro sketch_card(sketch, show_likes, widgets) %} | ||
<div class="common-card-style sketch-teaser"> | ||
<div class="sketch-image"> | ||
<a href="/sketches/{{sketch.sketch_id}}"> | ||
<img src="{{sketch.get_image_url()}}" /> | ||
</a> | ||
</div> | ||
<div class="sketch-footer"> | ||
<div class="sketch-title"> | ||
{{sketch.title}} | ||
</div> | ||
<div class="card-divider"></div> | ||
{% set owner = sketch.get_owner() %} | ||
<div> | ||
<span class=""> | ||
{{ widgets.Avatar(member=owner, avatar_class="avatar-small") }} | ||
<a class="button-links" href="/{{owner.username}}"> | ||
<span class="course-instructor"> | ||
{{ owner.full_name }} | ||
</span> | ||
</a> | ||
</span> | ||
<!-- below html would require changes based on if the user has liked the sketch or not --> | ||
{% if show_likes %} | ||
<span class="course-student-count"> | ||
<span> | ||
<img class="icon-background" src="/assets/community/icons/like.svg" /> | ||
{{ likes }} | ||
</span> | ||
</span> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<a class="stretched-link" href="sketches/{{sketch.sketch_id}}"></a> | ||
</div> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,27 @@ | ||
{% extends "templates/base.html" %} | ||
{% from "www/macros/livecode.html" import LiveCodeEditor, LiveCodeEditorJS %} | ||
{% from "www/macros/sketch_card.html" import sketch_card %} | ||
|
||
{% block title %}Sketches{% endblock %} | ||
{% block head_include %} | ||
<meta name="description" content="Sketches" /> | ||
<meta name="keywords" content="sketches" /> | ||
<link rel="stylesheet" href="/assets/css/lms.css"> | ||
<meta name="description" content="Sketches" /> | ||
<meta name="keywords" content="sketches" /> | ||
<link rel="stylesheet" href="/assets/css/lms.css"> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<section class="top-section" style="padding: 1rem 0rem;"> | ||
<div class='container pb-5'> | ||
<h1>Recent Sketches</h1> | ||
|
||
<a href="/sketches/new" class="btn btn-primary">Create a New Sketch</a> | ||
</div> | ||
<div class='container'> | ||
<div class="row"> | ||
<div class="common-page-style"> | ||
<div class='container'> | ||
<div class="sketch-page-header"> | ||
<span class="course-home-headings">Sketches</span> | ||
<a href="/sketches/new" class="btn btn-primary pull-right">Submit a Sketch</a> | ||
</div> | ||
<div class="card-divider-dark"></div> | ||
<div class="sketch-list"> | ||
{% for sketch in sketches %} | ||
<div class="col-md-3"> | ||
<div class="sketch-teaser"> | ||
<div class="sketch-image"> | ||
<a href="/sketches/{{sketch.sketch_id}}"> | ||
<img src="{{sketch.get_image_url()}}" /> | ||
</a> | ||
</div> | ||
<div class="sketch-footer"> | ||
<div class="sketch-title"> | ||
<a href="/sketches/{{sketch.sketch_id}}">{{sketch.title}}</a> | ||
</div> | ||
<div class="sketch-author"> | ||
{% set owner = sketch.get_owner() %} | ||
by <a href="/{{owner.username}}">{{owner.full_name}}</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{ sketch_card(sketch, False, widgets) }} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
{% endblock %} |