Skip to content

Commit

Permalink
Merge pull request #63 from tungleduyxyz/issue_389
Browse files Browse the repository at this point in the history
Remove BROKEN from datepicker
  • Loading branch information
pierre authored Jan 3, 2024
2 parents 26de87e + 7705352 commit e63a6e6
Showing 1 changed file with 57 additions and 48 deletions.
105 changes: 57 additions & 48 deletions app/views/kanaui/dashboard/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,50 @@
<!-- MENU -->
<div class="reports-options flex-inner-left-panel">
<div class="row">
<div class="col-md-12 col-sm-8">
<div class="calendar-container">
<span class="calendar-icon"><i class="fa fa-calendar"></i><i class="fa fa-caret-down"></i></span>
<% if params[:name] %>
<div class="info-wrapper">
<div class="tag-bar tag-bar-breathe">
<div class="tag-select" onclick="void(0);">
<span><i class="fa fa-calendar"></i><i class="fa fa-caret-down"></i></span>

<div class="tag-select-box">
<%= form_tag kanaui_engine.dashboard_index_path, :class => 'form-horizontal', :method => :get do %>
<input name="name" type="hidden" value="<%= @raw_name %>">
<input name="smooth" type="hidden" value="<%= params[:smooth] %>">
<input name="sql_only" type="hidden" value="<%= params[:sql_only] %>">
<input name="format" type="hidden" value="<%= params[:format] %>">
<input name="delta_days" type="hidden" value="<%= (@end_date.to_date - @start_date.to_date).to_i %>">

<div class="form-group">
<div class="col-md-7">
<% # TODO datepicker breaks :hover %>
From:<input class="form-control" name="start_date" type="text" data-provide="datepicker-BROKEN" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value="<%= @start_date %>">
</div>
</div>
<div class="form-group">
<div class="col-md-7">
<% # TODO datepicker breaks :hover %>
To:<input class="form-control" name="end_date" type="text" data-provide="datepicker-BROKEN" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value="<%= @end_date %>">
</div>
</div>
<% ((@report['variables'] || {})['fields'] || []).each do |definition| %>
<div class="form-group">
<div class="col-md-7">
<%= definition['name'].titleize %>:
<% # TODO Not fully implemented server side %>
<% if definition['dataType'] == 'date' %>
<% # TODO datepicker breaks :hover %>
<input class="form-control" name="variable_<%= definition['name'] %>" type="text" data-provide="datepicker-BROKEN" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value=""/>
<% else %>
<input class="form-control" name="variable_<%= definition['name'] %>" type="text" value=""/>
<% end %>
</div>
</div>
<div class="form-container">
<%= form_tag kanaui_engine.dashboard_index_path, :class => 'form-horizontal', :method => :get do %>
<input name="name" type="hidden" value="<%= @raw_name %>">
<input name="smooth" type="hidden" value="<%= params[:smooth] %>">
<input name="sql_only" type="hidden" value="<%= params[:sql_only] %>">
<input name="format" type="hidden" value="<%= params[:format] %>">
<input name="delta_days" type="hidden" value="<%= (@end_date.to_date - @start_date.to_date).to_i %>">
<div class="form-group">
<div id="dp1" class="col-md-7">
From:<input class="form-control datepicker" name="start_date" type="text" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value="<%= @start_date %>">
</div>
</div>
<div class="form-group">
<div class="col-md-7">
To:<input class="form-control" name="end_date" type="text" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value="<%= @end_date %>">
</div>
</div>
<% ((@report['variables'] || {})['fields'] || []).each do |definition| %>
<div class="form-group">
<div class="col-md-7">
<%= definition['name'].titleize %>:
<% # TODO Not fully implemented server side %>
<% if definition['dataType'] == 'date' %>
<% # TODO datepicker breaks :hover %>
<input class="form-control" name="variable_<%= definition['name'] %>" type="text" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value=""/>
<% else %>
<input class="form-control" name="variable_<%= definition['name'] %>" type="text" value=""/>
<% end %>
<div class="form-group">
<div class="col-sm-12">
<%= submit_tag 'Refresh', :class => 'btn btn-default' %>
</div>
</div>
<% end %>
</div><!-- /.tag-select-box -->
</div><!-- /.tag-select -->
</div><!-- /.tag-bar -->
</div><!-- /.info-wrapper -->
</div>
</div>
<% end %>
<div class="form-group">
<div class="col-sm-12">
<%= submit_tag 'Refresh', :class => 'btn btn-default' %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
<div class="col-md-12 col-sm-8">
<h4><%= link_to 'Available Reports', kanaui_engine.url_for(:controller => :reports) %></h4>
<ul class="nav nav-tabs nav-stacked">
Expand All @@ -72,6 +65,7 @@
<% end %>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-8">
Expand Down Expand Up @@ -182,3 +176,18 @@
</div>
</div>
</div>
<%= javascript_tag do %>
$(document).ready(function() {
$('.calendar-icon').click(function() {
$('.form-container').toggle();
});
});
<% end %>

<style type="text/css">
.form-container {
display: none;
}
</style>

0 comments on commit e63a6e6

Please sign in to comment.