Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove BROKEN from datepicker #63

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>