-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
254 additions
and
86 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class PaginationListLinkRenderer < WillPaginate::ActionView::LinkRenderer | ||
protected | ||
def html_container(html) | ||
tag :div, tag(:ul, html), container_attributes | ||
end | ||
|
||
def page_number(page) | ||
tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page) | ||
end | ||
|
||
def previous_or_next_page(page, text, classname) | ||
tag :li, link(text, page || '#'), :class => [classname[0..3], classname, ('disabled' unless page)].join(' ') | ||
end | ||
end |
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- show_duration = false unless defined? show_duration | ||
|
||
%table.condensed-table.zebra-striped | ||
%thead | ||
%tr | ||
%th Timestamp | ||
%th Categories | ||
%th Data | ||
- if show_duration | ||
%th Duration | ||
%tbody | ||
- list.each do |tap_log_record| | ||
%tr.tap_log_record | ||
%td.timestamp= if tap_log_record.timestamp then link_to l(tap_log_record.timestamp), tap_log_record end | ||
%td.categories | ||
= tap_log_record.category_string | ||
%td | ||
= object_labels(tap_log_record) | ||
- if tap_log_record.number | ||
.number= t('app.tap_log_record.number', :number => tap_log_record.number) | ||
- if tap_log_record.rating | ||
.rating= t('app.tap_log_record.rating', :rating => tap_log_record.rating) | ||
- unless tap_log_record.note.blank? or !can? :view_note, tap_log_record | ||
.note= simple_format tap_log_record.note | ||
- if can? :manage_account, @account | ||
- note = tap_log_record.note | ||
- if note =~ /!memory/i | ||
= link_to t('app.tap_log_record.copy_memory'), copy_to_memory_tap_log_record_path(tap_log_record, :destination => request.fullpath), :method => :post | ||
- if show_duration | ||
%td | ||
- if tap_log_record.end_timestamp | ||
= duration tap_log_record.end_timestamp - tap_log_record.timestamp | ||
|
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,44 +1,30 @@ | ||
= setup_page 'tap_logs', 'Tap Log records', 'time/nav' | ||
= setup_page 'tap_logs', nil, 'time/nav' | ||
|
||
.filters | ||
= form_tag tap_log_records_path, :method => :get do | ||
- ['catOne', 'catTwo', 'catThree'].each do |cat| | ||
.filters.collapsible.collapsed.fieldset | ||
%legend Filters [+] | ||
.details | ||
= form_tag tap_log_records_path, :method => :get do | ||
.clearfix | ||
= label_tag cat.to_sym, I18n.t("formtastic.labels.tap_log_record.#{cat}") | ||
= label_tag :start, 'Start' | ||
.input= text_field_tag :start, @start.strftime("%Y-%m-%d"), :class => 'datepicker' | ||
.clearfix | ||
= label_tag :end, 'End' | ||
.input= text_field_tag :end, @end.strftime("%Y-%m-%d"), :class => 'datepicker' | ||
- ['catOne', 'catTwo', 'catThree'].each do |cat| | ||
.clearfix | ||
= label_tag cat.to_sym, I18n.t("formtastic.labels.tap_log_record.#{cat}") | ||
.input | ||
= select_tag cat.to_sym, options_for_select([['', '']] + TapLogRecord.select("DISTINCT #{cat}").order(cat).collect { |x| [ x.send(cat), x.send(cat) ] }, params[cat.to_sym]) | ||
.clearfix | ||
= label_tag :status, "Status" | ||
.input | ||
= select_tag :status, options_for_select([['', '']] + TapLogRecord.select("DISTINCT status").order('status').collect { |x| [ x.send('status'), x.send('status') ] }, params[:status]) | ||
.clearfix | ||
= label_tag :filter, "Filter" | ||
.input | ||
= select_tag cat.to_sym, options_for_select([['', '']] + TapLogRecord.select("DISTINCT #{cat}").order(cat).collect { |x| [ x.send(cat), x.send(cat) ] }, params[cat.to_sym]) | ||
.clearfix | ||
= label_tag :status, "Status" | ||
.input | ||
= select_tag :status, options_for_select([['', '']] + TapLogRecord.select("DISTINCT status").order('status').collect { |x| [ x.send('status'), x.send('status') ] }, params[:status]) | ||
.clearfix | ||
= label_tag :filter, "Filter" | ||
.input | ||
= text_field_tag :filter_string, params[:filter_string] | ||
.actions | ||
= submit_tag t('app.general.filter'), :class => 'btn primary' | ||
= text_field_tag :filter_string, params[:filter_string] | ||
.actions | ||
= submit_tag t('app.general.filter'), :class => 'btn primary' | ||
|
||
%table.condensed-table.zebra-striped | ||
%thead | ||
%tr | ||
%th Timestamp | ||
%th Categories | ||
%th Data | ||
%tbody | ||
- @tap_log_records.each do |tap_log_record| | ||
%tr.tap_log_record | ||
%td.timestamp= if tap_log_record.timestamp then link_to l(tap_log_record.timestamp), tap_log_record end | ||
%td.categories | ||
= tap_log_record.category_string | ||
%td | ||
= object_labels(tap_log_record) | ||
- if tap_log_record.number | ||
.number= t('app.tap_log_record.number', :number => tap_log_record.number) | ||
- if tap_log_record.rating | ||
.rating= t('app.tap_log_record.rating', :rating => tap_log_record.rating) | ||
- unless tap_log_record.note.blank? or !can? :view_note, tap_log_record | ||
.note= simple_format tap_log_record.note | ||
- if can? :manage_account, @account | ||
- note = tap_log_record.note | ||
- if note =~ /!memory/i | ||
= link_to t('app.tap_log_record.copy_memory'), copy_to_memory_tap_log_record_path(tap_log_record, :destination => request.fullpath), :method => :post | ||
= render 'summary', :list => @tap_log_records, :show_duration => true | ||
= will_paginate @tap_log_records, :renderer => PaginationListLinkRenderer |
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,28 +1,57 @@ | ||
%h1 | ||
= @tap_log_record.category_string | ||
\- | ||
= l @tap_log_record.timestamp | ||
= object_labels @tap_log_record | ||
- if can? :update, @tap_log_record | ||
= link_to 'Edit', edit_tap_log_record_path(@tap_log_record) | ||
\| | ||
= link_to 'Back', tap_log_records_path | ||
%p | ||
« | ||
= link_to t('app.tap_log_record.previous_activity'), @previous_activity if @previous_activity | ||
\- | ||
= link_to t('app.tap_log_record.previous_entry'), @previous_entry if @previous_entry | ||
| | ||
- if can? :update, @tap_log_record | ||
= link_to 'Edit', edit_tap_log_record_path(@tap_log_record) | ||
\| | ||
= link_to t('app.tap_log_record.next_entry'), @next_entry if @next_entry | ||
\- | ||
= link_to t('app.tap_log_record.next_activity'), @next_activity if @next_activity | ||
» | ||
|
||
|
||
%table | ||
%tr | ||
%td= t('formtastic.labels.tap_log_record.catOne') | ||
%td= @tap_log_record.catOne | ||
%tr | ||
%td= t('formtastic.labels.tap_log_record.catTwo') | ||
%td= @tap_log_record.catTwo | ||
%tr | ||
%td= t('formtastic.labels.tap_log_record.catThree') | ||
%td= @tap_log_record.catThree | ||
%tr | ||
%td= t('formtastic.labels.tap_log_record.number') | ||
%td= @tap_log_record.number | ||
%tr | ||
%td= t('formtastic.labels.tap_log_record.rating') | ||
%td= @tap_log_record.rating | ||
- if can? :view_note, @tap_log_record | ||
%tr | ||
%td= t('formtastic.labels.tap_log_record.note') | ||
%td= @tap_log_record.note | ||
%tbody | ||
- if @tap_log_record.end_timestamp? | ||
%tr | ||
%td.h= t('formtastic.labels.tap_log_record.end_timestamp') | ||
%td= "#{l(@tap_log_record.end_timestamp)} (#{duration @tap_log_record.end_timestamp - @tap_log_record.timestamp})" | ||
- if @tap_log_record.number? | ||
%tr | ||
%td.h= t('formtastic.labels.tap_log_record.number') | ||
%td= @tap_log_record.number | ||
- if @current_activity and @current_activity != @tap_log_record | ||
%tr | ||
%td.h= t('app.tap_log_record.current_activity') | ||
%td= link_to @current_activity.category_string, @current_activity | ||
- if @tap_log_record.rating? | ||
%tr | ||
%td.h= t('formtastic.labels.tap_log_record.rating') | ||
%td= @tap_log_record.rating | ||
- if @tap_log_record.note? and can? :view_note, @tap_log_record | ||
%tr | ||
%td.h= t('formtastic.labels.tap_log_record.note') | ||
%td= @tap_log_record.note | ||
|
||
- if @during_this and @during_this.length > 0 | ||
%h2= t('app.tap_log_record.during_this_time') | ||
= render 'summary', :list => @during_this | ||
|
||
%p | ||
« | ||
= link_to t('app.tap_log_record.previous_activity'), @previous_activity if @previous_activity | ||
\- | ||
= link_to t('app.tap_log_record.previous_entry'), @previous_entry if @previous_entry | ||
| | ||
= link_to t('app.tap_log_record.next_entry'), @next_entry if @next_entry | ||
\- | ||
= link_to t('app.tap_log_record.next_activity'), @next_activity if @next_activity | ||
» |
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
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
Oops, something went wrong.