forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes publiclab#11198: Added date picker modal
- Loading branch information
1 parent
833f7b1
commit 60b3c80
Showing
1 changed file
with
59 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,59 @@ | ||
<div class="dropdown pull-right"> | ||
<button class="btn btn-outline-secondary dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="margin-left:14px;"><%=translation('tag.index.sort_by')%></button> | ||
<div class="dropdown-menu dropdown-menu-right mt-1" aria-labelledby="dropdownMenuButton"> | ||
<% if params[:action] == "show" %> | ||
<a class="dropdown-item <% if params[:order] == 'last_updated' %> active<% end %>" href="/tag/<%= params[:id] %>"> | ||
<% if @node_type == 'wiki' %> | ||
<i class="fa fa-clock-o"></i> <span class="d-lg-inline">by created date</span> | ||
<% else %> | ||
<i class="fa fa-clock-o"></i> <span class="d-lg-inline">by last updated</span> | ||
<% end %> | ||
</a> | ||
<a class="dropdown-item <% if params[:order] == 'views' %> active<% end %>" href="?order=views"> | ||
<i class="fa fa-eye"></i> <span class="d-lg-inline">by views</span> | ||
</a> | ||
<a class="dropdown-item <% if params[:order] == 'likes' %> active<% end %>" href="?order=likes"> | ||
<i class="fa fa-star"></i> <span class="d-lg-inline">by likes</span> | ||
</a> | ||
<div class="dropdown-divider"></div> | ||
<h6 class="dropdown-header">View date range</h6> | ||
<a class="dropdown-item" href="?start=<%= (@start || Time.now - 1.month).to_formatted_s(:long) %>&end=<%= (@end || Time.now).to_formatted_s(:long) %>" >past month</a> | ||
<a class="dropdown-item" href="?start=<%= (@start || Time.now - 1.year).to_formatted_s(:long) %>&end=<%= (@end || Time.now).to_formatted_s(:long) %>" >past year</a> | ||
<% end %> | ||
</div> | ||
</div> | ||
<div class="dropdown pull-right"> | ||
<button class="btn btn-outline-secondary dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="margin-left:14px;"><%=translation('tag.index.sort_by')%></button> | ||
<div class="dropdown-menu dropdown-menu-right mt-1" aria-labelledby="dropdownMenuButton"> | ||
<% if params[:action] == "show" %> | ||
<a class="dropdown-item <% if params[:order] == 'last_updated' %> active<% end %>" href="/tag/<%= params[:id] %>"> | ||
<% if @node_type == 'wiki' %> | ||
<i class="fa fa-clock-o"></i> <span class="d-lg-inline">by created date</span> | ||
<% else %> | ||
<i class="fa fa-clock-o"></i> <span class="d-lg-inline">by last updated</span> | ||
<% end %> | ||
</a> | ||
<a class="dropdown-item <% if params[:order] == 'views' %> active<% end %>" href="?order=views"> | ||
<i class="fa fa-eye"></i> <span class="d-lg-inline">by views</span> | ||
</a> | ||
<a class="dropdown-item <% if params[:order] == 'likes' %> active<% end %>" href="?order=likes"> | ||
<i class="fa fa-star"></i> <span class="d-lg-inline">by likes</span> | ||
</a> | ||
<div class="dropdown-divider"></div> | ||
<h6 class="dropdown-header">View date range</h6> | ||
<a class="dropdown-item" href="?start=<%= (@start || Time.now - 1.month).to_formatted_s(:long) %>&end=<%= (@end || Time.now).to_formatted_s(:long) %>" >past month</a> | ||
<a class="dropdown-item" href="?start=<%= (@start || Time.now - 1.year).to_formatted_s(:long) %>&end=<%= (@end || Time.now).to_formatted_s(:long) %>" >past year</a> | ||
<a class="dropdown-item" data-toggle="modal" data-target="#dateModal" >custom</a> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<div class="modal" id="dateModal"> | ||
<div class="modal-dialog modal-dialog-centered"> | ||
<div class="modal-content"> | ||
|
||
<!-- Modal Header --> | ||
<div class="modal-header"> | ||
<h4 class="modal-title">Select Custom Range</h4> | ||
<button type="button" class="close" data-dismiss="modal">×</button> | ||
</div> | ||
|
||
<!-- Modal body --> | ||
<div class="modal-body"> | ||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<label>From</label><br> | ||
<input type="date" id="from"> | ||
</div> | ||
<div class="col-sm-6"> | ||
<label>To</label><br> | ||
<input type="date" id="to"> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- Modal footer --> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> | ||
<button type="button" class="btn btn-primary" data-dismiss="modal">Save changes</button> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> |