Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {snippet miniCalendar} {$h} <table id="mini-calendar-table" class="universal table-bordered table-condensed table-striped" style="width:250px;height:250px;">
- <thead>
- <tr><td style="cursor:pointer;"><i class="icon-arrow-left"></i></td><td colspan="5" align="center">{$months[$month]} {$year}</td><td style="cursor:pointer;"><i class="icon-arrow-right" style="float:right;"></i></td></tr>
- <tr class="calendar-row" style="height:37,5px;">
- <th n:foreach="$headings as $value" style="width:37,5px;">
- {$value}
- </th>
- </tr>
- </thead>
- <tbody>
- <tr class="calendar-row" style="height:37,5px;">
- <td n:for="$x = 0; $x < $running_day; $x++, $days_in_this_week++" class="calendar-day-np"style="width:37,5px;"></td>
- {for $list_day = 1; $list_day <= $days_in_month; $list_day++}
- {var $l = ($list_day < 10) ? "0".$list_day : $list_day}
- {var $date = $year."-".(($month < 10)?"0".$month:$month)."-".$l}
- <td class="calendar-day" {ifset $pizza[$date]}rel="#d{$date}"{/ifset}style="width:37,5px;{if isset($pizza[$date]) and count($pizza[$date])}background:#C6DBFF;{/if}">
- <div {if isset($pizza[$date]) and count($pizza[$date])}style="cursor:pointer;" class="hover"{/if} data-date-formatted="{$list_day}.{$month}.{$year}" data-date="{$date}">
- <div class="day-number">{$list_day}</div>
- <div class="cleaner"></div>
- </div>
- </td>
- {if $running_day == 6}
- </tr>
- {if ($day_counter + 1) != $days_in_month}
- <tr class="calendar-row"style="height:37,5px;">
- {/if}
- {var $running_day = -1}
- {var $days_in_this_week = 0}
- {/if}
- {?$running_day++}
- {?$day_counter++}
- {?$days_in_this_week++}
- {/for}
- {if $days_in_this_week < 8 and $days_in_this_week != 1}
- <td n:for="$x = 1; $x <= (8 - $days_in_this_week); $x++" class="calendar-day-np"style="width:37,5px;"></td>
- {/if}
- </tr>
- </tbody>
- </table>
- <script>
- $('i.icon-arrow-left').click(function() {
- $.get({link back!});
- });
- $('i.icon-arrow-right').click(function() {
- $.get({link next!});
- });
- </script>
- {/snippet}
- <div id="actionsModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="actionsModalLabel" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="actionsModalLabel"></h3>
- </div>
- <div class="modal-body">
- {snippet dialog}
- <div class="dialog-inner">
- {foreach $showActions as $action}
- <div class="dialog-inner-action">
- <h3>{$action->title}</h3>
- <span>{$action->getFrom()|date:"%#d.%#m.%Y, %#H:%M"}</span> - <span>{$action->getTo()|date:"%#d.%#m.%Y, %#H:%M"}</span>
- <div class="dialog-action-text">
- {!$action->getText()}
- </div>
- </div>
- {/foreach}
- </div>
- {/snippet}
- </div>
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">{$translatedText[0]}</button>
- </div>
- </div>
- <script>
- $('document').ready(function() {
- $('#actionsModal').on('shown', function() {
- $('#actionsModal .modal-body').scrollTop(0);
- });
- $('div.hover').click(function() {
- var link = {link actions!} + '&dtt=' + $(this).data('date');
- $.get(link, function(payload) {
- jQuery.nette.success(payload);
- $('#actionsModal').modal();
- });
- var el = $('h3#actionsModalLabel');
- el.text({$translatedText[1]} + $(this).data('date-formatted'));
- });
- });
- </script>
- <style>
- .modal, .modal.fade.in {
- top: 50%;
- margin-top: -250px;
- }
- .modal {
- height: 500px;
- }
- .modal-body {
- height: 370px;
- }
- </style>
Advertisement
Add Comment
Please, Sign In to add comment