Skip to content

Commit

Permalink
date options using bootstraps inline buttons refs #1535
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Jun 10, 2018
1 parent db09f95 commit 8d7e8f9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
5 changes: 2 additions & 3 deletions opal/static/css/opal.css
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,6 @@ hr.bold{
overflow-y: auto;
}

.btn.btn-opal-xs{
font-size: 12px;
padding: 2px 5px;
.input-group .btn{
padding: 8.5px 12px;
}
52 changes: 26 additions & 26 deletions opal/templates/_helpers/datepicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
class="col-sm-8"
{% endifequal %}
>
<input type="text" class="form-control"
uib-datepicker-popup="dd/MM/yyyy"
ng-model="{{ model }}"
is-open="{{ formname }}[{{ element_name }} + '_open']"
min-date="{{ mindate}}"
max-date="maxDate"
show-button-bar="false"
show-weeks="false"
name="[[ {{ element_name}} ]]"
datepicker-options="{startingDay: 1}"
ng-focus="{{ formname }}[{{ element_name }} + '_open']=true"
close-text="Close"
{% if change %}
ng-change="{{ change }}"
{% endif %}
/>
{% if options %}
<div class="input-group">
{% endif %}
<input type="text" class="form-control"
uib-datepicker-popup="dd/MM/yyyy"
ng-model="{{ model }}"
is-open="{{ formname }}[{{ element_name }} + '_open']"
min-date="{{ mindate}}"
max-date="maxDate"
show-button-bar="false"
show-weeks="false"
name="[[ {{ element_name}} ]]"
datepicker-options="{startingDay: 1}"
ng-focus="{{ formname }}[{{ element_name }} + '_open']=true"
close-text="Close"
{% if change %}
ng-change="{{ change }}"
{% endif %}
/>
{% if options %}
<span class="input-group-btn">
<button type="button" ng-class="{active: ({{ model }}|sameDate: now)}" class="btn btn-default" ng-click="{{ model }} = now" href="">Today</a>
<button type="button" ng-class="{active: ({{ model }}|sameDate: yesterday)}" class="btn btn-default" ng-click="{{ model }} = yesterday" href="">Yesterday</a>
</span>
</div>
{% endif %}
</div>
{% if options %}
<div class="row">
<div class="col-sm-12 content-offset-5">
<div class="col-sm-8 col-sm-push-3">
<a ng-class="{active: ({{ model }}|sameDate: now)}" class="btn btn-primary btn-opal-xs" ng-click="{{ model }} = now" href="">Today</a>
<a ng-class="{active: ({{ model }}|sameDate: yesterday)}" class="btn btn-primary btn-opal-xs" ng-click="{{ model }} = yesterday" href="">Yesterday</a>
</div>
</div>
</div>
{% endif %}
</div>

0 comments on commit 8d7e8f9

Please sign in to comment.