Skip to content

Commit

Permalink
table fixes, homepage fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
codecalm committed Nov 2, 2020
1 parent 6409a25 commit 7402edc
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 275 deletions.
4 changes: 2 additions & 2 deletions src/pages/_includes/cards/invoices.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ <h3 class="card-title">Invoices</h3>
<td>{{ invoice.price }}</td>

<td class="text-right">
<span class="dropdown ml-1">
<button class="btn btn-sm dropdown-toggle align-text-top" data-boundary="viewport" data-toggle="dropdown">Actions</button>
<span class="dropdown">
<button class="btn dropdown-toggle align-text-top" data-boundary="viewport" data-toggle="dropdown">Actions</button>
{% include ui/dropdown-menu.html right=true %}
</span>
</td>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/_includes/layout/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ <h3 class="card-title">Traffic summary</h3>
<div class="col-md-6 col-lg-8">
{% include cards/tasks.html %}
</div>

<div class="col-12">
{% include cards/invoices.html %}
</div>
</div>
128 changes: 67 additions & 61 deletions src/pages/_includes/ui/table.html
Original file line number Diff line number Diff line change
@@ -1,82 +1,88 @@
{% assign roles = 'User,Admin,Owner' | split: ',' %}
<div class="table-responsive">
<table class="table table-vcenter{% if include.mobile %} table-mobile-md{% endif %}{% if include.card %} card-table{% endif %}{% if include.stripped %} table-striped{% endif %}{% if include.nowrap %} table-nowrap{% endif %}">
<table
class="table table-vcenter{% if include.mobile %} table-mobile-md{% endif %}{% if include.card %} card-table{% endif %}{% if include.stripped %} table-striped{% endif %}{% if include.nowrap %} table-nowrap{% endif %}">
<thead>
<tr>
<th>Name</th>
<th>Title</th>
<tr>
<th>Name</th>
<th>Title</th>

{% unless include.avatars %}
<th>Email</th>
{% endunless %}
{% unless include.avatars %}
<th>Email</th>
{% endunless %}

<th>Role</th>

<th>Role</th>
{% if include.nowrap %}
<th></th>
{% endif %}

{% if include.nowrap %}
<th></th>
{% endif %}

<th class="w-1"></th>
</tr>
<th class="w-1"></th>
</tr>
</thead>
<tbody>
{% for person in site.data.people limit: 5 offset: include.offset %}
<tr>
{% if include.avatars %}
<td {% if include.mobile %}data-label="Name"{% endif %}>
<div class="d-flex py-1 align-items-center">
{% include ui/avatar.html person-id=person.id class="mr-2" %}
<div class="flex-fill">
<div class="font-weight-medium">{{ person.full_name }}</div>
<div class="text-muted text-h5"><a href="#" class="text-reset">{{ person.email }}</a></div>
</div>
<tr>
{% if include.avatars %}
<td {% if include.mobile %}data-label="Name" {% endif %}>
<div class="d-flex py-1 align-items-center">
{% include ui/avatar.html person-id=person.id class="mr-2" %}
<div class="flex-fill">
<div class="font-weight-medium">{{ person.full_name }}</div>
<div class="text-muted"><a href="#" class="text-reset">{{ person.email }}</a></div>
</div>
</td>
{% else %}
<td {% if include.mobile %}data-label="Name"{% endif %}>{{ person.full_name }}</td>
{% endif %}
</div>
</td>
{% else %}
<td {% if include.mobile %}data-label="Name" {% endif %}>{{ person.full_name }}</td>
{% endif %}


{% if include.avatars %}
<td {% if include.mobile %}data-label="Title"{% endif %}>
<div>{{ person.job_title }}</div>
<div class="text-muted text-h5">{{ person.department }}</div>
</td>
{% else %}
<td class="text-muted" {% if include.mobile %}data-label="Title"{% endif %}>
{{ person.job_title }}, {{ person.department }}
</td>
{% endif %}
{% if include.avatars %}
<td {% if include.mobile %}data-label="Title" {% endif %}>
<div>{{ person.job_title }}</div>
<div class="text-muted">{{ person.department }}</div>
</td>
{% else %}
<td class="text-muted" {% if include.mobile %}data-label="Title" {% endif %}>
{{ person.job_title }}, {{ person.department }}
</td>
{% endif %}

{% unless include.avatars %}
<td class="text-muted"{% if include.mobile %}data-label="Email"{% endif %}><a href="#" class="text-reset">{{ person.email }}</a></td>
{% endunless %}
{% unless include.avatars %}
<td class="text-muted" {% if include.mobile %}data-label="Email" {% endif %}><a href="#" class="text-reset">{{
person.email }}</a></td>
{% endunless %}


<td class="text-muted" {% if include.mobile %}data-label="Role"{% endif %}>
{% assign role-id = forloop.index | random_number: 0, 2 %}
{{ roles[role-id] }}
</td>
<td class="text-muted" {% if include.mobile %}data-label="Role" {% endif %}>
{% assign role-id = forloop.index | random_number: 0, 2 %}
{{ roles[role-id] }}
</td>

{% if include.nowrap %}
<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi, commodi cupiditate debitis deserunt expedita hic incidunt iste modi molestiae nesciunt non nostrum perferendis perspiciatis placeat praesentium quaerat quo repellendus, voluptates.</td>
{% endif %}
{% if include.nowrap %}
<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi, commodi cupiditate debitis deserunt
expedita hic incidunt iste modi molestiae nesciunt non nostrum perferendis perspiciatis placeat praesentium
quaerat quo repellendus, voluptates.
</td>
{% endif %}

<td>
{% if include.buttons %}
<div class="btn-list flex-nowrap">
{% include ui/button.html text="Edit" %}
<div class="dropdown">
<button class="btn dropdown-toggle align-text-top" data-boundary="viewport" data-toggle="dropdown">Actions</button>
{% include ui/dropdown-menu.html right=true %}
</div>
</div>
{% else %}
<a href="#">Edit</a>
{% endif %}
</td>
</tr>
<td>
{% if include.buttons %}
<div class="btn-list flex-nowrap">
{% include ui/button.html text="Edit" %}
<div class="dropdown">
<button class="btn dropdown-toggle align-text-top" data-boundary="viewport" data-toggle="dropdown">
Actions
</button>
{% include ui/dropdown-menu.html right=true %}
</div>
</div>
{% else %}
<a href="#">Edit</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
Expand Down
38 changes: 21 additions & 17 deletions src/pages/tables.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,32 @@
menu: base.tables
---

<div class="box">
<div class="card">
{% include ui/table.html card=true %}
<div class="row row-cards">
<div class="col-12">
<div class="card">
{% include ui/table.html card=true %}
</div>
</div>
</div>

<div class="box">
<div class="card">
{% include ui/table.html card=true stripped=true offset=5 %}
<div class="col-12">
<div class="card">
{% include ui/table.html card=true stripped=true offset=5 %}
</div>
</div>
</div>

<div class="box">
<div class="card">
{% include ui/table.html card=true avatars=true offset=10 %}
<div class="col-12">
<div class="card">
{% include ui/table.html card=true avatars=true offset=10 %}
</div>
</div>
</div>

<div class="box">
<div class="card">
{% include ui/table.html card=true mobile=true avatars=true offset=15 buttons=true %}
<div class="col-12">
<div class="card">
{% include ui/table.html card=true mobile=true avatars=true offset=15 buttons=true %}
</div>
</div>
</div>

{% include cards/invoices.html %}
<div class="col-12">
{% include cards/invoices.html %}
</div>
</div>

0 comments on commit 7402edc

Please sign in to comment.