diff options
| author | Marc Florisson | 2014-01-22 17:41:04 +0100 | 
|---|---|---|
| committer | Marc Florisson | 2014-01-22 17:41:04 +0100 | 
| commit | c9437fc2e96f415e38c1e72fa10337769381f289 (patch) | |
| tree | 199b39a7c8c5cc2cfef539f73f73c1b5fbea8a72 /app/helpers/history_helper.rb | |
| parent | 4e71abdc01f9f04ce6eec1989fa756ffc823fd65 (diff) | |
| download | chouette-core-c9437fc2e96f415e38c1e72fa10337769381f289.tar.bz2 | |
merge branch validation
Diffstat (limited to 'app/helpers/history_helper.rb')
| -rw-r--r-- | app/helpers/history_helper.rb | 43 | 
1 files changed, 43 insertions, 0 deletions
diff --git a/app/helpers/history_helper.rb b/app/helpers/history_helper.rb new file mode 100644 index 000000000..a4f2df05c --- /dev/null +++ b/app/helpers/history_helper.rb @@ -0,0 +1,43 @@ +module HistoryHelper + +  def creation_tag(object) +    field_set_tag t("layouts.creation_tag.title") do +      content_tag :ul do +        [(content_tag :li do +          if object.has_attribute?(:creation_time)   +            object.human_attribute_name('creation_time') + ' : ' + l(object.creation_time, :format => :short) +          else             +            object.class.human_attribute_name('created_at') + ' : ' + l(object.created_at, :format => :short) +          end +        end),  +        (content_tag :li do +           if object.has_attribute?(:creator_id) +             object.human_attribute_name('creator_id') + ' : ' + object.creator_id if  object.creator_id +           end +        end)].join.html_safe +      end +    end +  end +   +  def history_tag(object) +    field_set_tag t("layouts.history_tag.title") do +      content_tag :ul do +        [(content_tag :li do +          if object.has_attribute?(:created_at)     +            t('layouts.history_tag.created_at') + ' : ' + l(object.created_at, :format => :short) +          end +        end), +        (content_tag :li do +          if object.has_attribute?(:updated_at)     +            t('layouts.history_tag.updated_at') + ' : ' + l(object.updated_at, :format => :short) +          end +        end),   +        (content_tag :li do +           if object.has_attribute?(:user_name) +             t('layouts.history_tag.user_name') + ' : ' + object.user_name if  object.user_name +           end +        end)].join.html_safe +      end +    end +  end +end  | 
