Skip to content

Instantly share code, notes, and snippets.

@boudhayan-dev
Created December 25, 2019 11:36
Show Gist options
  • Save boudhayan-dev/80f0c76e679649954a0c1717e2722649 to your computer and use it in GitHub Desktop.
Save boudhayan-dev/80f0c76e679649954a0c1717e2722649 to your computer and use it in GitHub Desktop.
Contents of dashboard.hbs
{{>header}}
<body>
<div class="container content-container">
<br>
<nav class="navbar navbar-light">
<h2><span class="username">{{username}}'s</span> QuickLinks</h2>
<form class="form-inline">
<a href="" role="button" class="btn mr-2 btn-outline-info btn-sm " data-toggle="modal"
data-target="#addLinkModal"><i class="fa fa-plus-circle" aria-hidden="true"> Link</i></a>
<a href="/logout" role="button" class="btn mr-2 btn-outline-danger btn-sm">
<i class="fa fa-sign-out" aria-hidden="true"> Logout</i></a>
<a href="" role="button" class="btn mr-2 btn-outline-danger btn-sm" data-toggle="modal"
data-target="#deleteProfile"><i class="fa fa-trash" aria-hidden="true"> Profile</i></a>
</form>
{{!-- <button type="button" class="btn btn-success" aria-label="Left Align">
<span class="fa fa-align-left" aria-hidden="true"> adds</span>
</button> --}}
</nav>
<hr>
<div class="row">
<div class="col-md-12 ">
<div class="card-columns">
{{#each quickLinks}}
<div class="card shadow p-3 mb-3 bg-white rounded">
{{#if this.imageB64}}
<img class="card-img-top" src="{{this.imageB64}}" alt="Card image cap">
{{/if}}
<div class="card-body">
<h4 class="card-title">{{this.name}}</h3>
<hr>
<p class="card-text">{{this.description}}</p>
<hr>
<div class="btn-wrapper text-center">
<a href="{{this.link}}" target="_blank"
class="btn btn-brand btn-outline-info btn-m" id="linkVal">
<i class="fa fa-external-link " aria-hidden="true"> Open</i>
</a>
{{!-- onclick="deleteLink(this);" --}}
<button type="button" name="{{this.link}}" class="deleteLink btn btn-brand btn-outline-danger btn-m">
<i class="fa fa-trash" aria-hidden="true"> Link</i>
</button>
</div>
</div>
</div>
{{/each}}
</div>
</div>
</div>
<div class="modal fade" id="addLinkModal" tabindex="-1" role="dialog" aria-labelledby="Add new Link"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered " role="document">
<div class="modal-content">
<form class="submitForm text-center border border-light p-5">
<h3 class="mb-4" style="font-weight: bold; color: #17a2b8;">Add new link</h3>
<input type="text" id="pageLink" name="link" class="form-control" placeholder="Link" required>
<small id="passwordHelpBlock" class="help-text form-text text-muted mb-4">
Enter the link of the website
</small>
<input type="text" id="pageName" name="name" class="form-control mb-4" placeholder="Name" required>
<small id="passwordHelpBlock" class="help-text form-text text-muted mb-4">
Enter the name of the website
</small>
<div class="form-group">
<textarea name="description" class="form-control rounded-0" id="pageDescription" rows="3"
placeholder="Description"></textarea>
<small id="passwordHelpBlock" class="help-text form-text text-muted mb-4">
Enter the description of the website (Optional)
</small>
</div>
<div class="custom-file">
<input type="file" name="imageB64" class="custom-file-input" id="pageImage"
placeholder="Choose cover image">
<label class="custom-file-label help-text" for="pageImage"></label>
<small id="passwordHelpBlock" class="help-text form-text text-muted mb-4">
Provide a cover image (Optional)
</small>
</div>
<button class="btn btn-info btn-block my-4" type="submit" >Add</button>
<small id="linkAddError" class="form-text mb-4"></small>
</form>
</div>
</div>
</div>
<div class="modal fade" id="deleteProfile" tabindex="-1" role="dialog" aria-labelledby="Delete Profile"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered " role="document">
<div class="modal-content">
<form class="text-center border border-light p-5" action="/deleteUserProfile" method="POST">
<h3 class="mb-4" style="font-weight: bold; color: #17a2b8;">Delete Profile</h3>
<div class="form-group mb-4">
<p class="mb-4" style="font-size: medium; ">This will delete your profile and along with
that the links that you have saved. This is an irreversible process. Do you want to
continue ?</p>
</div>
<button type="submit" class="btn btn-sm btn-danger mr-1">Delete</a>
<button type="button" class="btn btn-sm btn-info" data-dismiss="modal" aria-label="Close">Cancel</button>
</form>
</div>
</div>
</div>
</div>
<script src="/js/dashboard.js"></script>
</body>
{{>footer}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment