Commit 793d0aa4 authored by Sacred Seven's avatar Sacred Seven

Jalali tooltips

parent 0bc4836c
...@@ -8,6 +8,9 @@ def linux_only(require_as) ...@@ -8,6 +8,9 @@ def linux_only(require_as)
RUBY_PLATFORM.include?('linux') && require_as RUBY_PLATFORM.include?('linux') && require_as
end end
# Jalali Date
gem 'jalalidate', "~> 0.3.3"
gem "rails", "~> 4.1.0" gem "rails", "~> 4.1.0"
# Make links from text # Make links from text
......
...@@ -253,6 +253,7 @@ GEM ...@@ -253,6 +253,7 @@ GEM
httpauth (0.2.1) httpauth (0.2.1)
i18n (0.6.11) i18n (0.6.11)
ice_nine (0.10.0) ice_nine (0.10.0)
jalalidate (0.3.3)
jasmine (2.0.2) jasmine (2.0.2)
jasmine-core (~> 2.0.0) jasmine-core (~> 2.0.0)
phantomjs phantomjs
...@@ -638,6 +639,7 @@ DEPENDENCIES ...@@ -638,6 +639,7 @@ DEPENDENCIES
hipchat (~> 0.14.0) hipchat (~> 0.14.0)
html-pipeline-gitlab (~> 0.1.0) html-pipeline-gitlab (~> 0.1.0)
httparty httparty
jalalidate (~> 0.3.3)
jasmine (= 2.0.2) jasmine (= 2.0.2)
jquery-atwho-rails (~> 0.3.3) jquery-atwho-rails (~> 0.3.3)
jquery-rails jquery-rails
......
...@@ -202,7 +202,7 @@ module ApplicationHelper ...@@ -202,7 +202,7 @@ module ApplicationHelper
def time_ago_with_tooltip(date, placement = 'top', html_class = 'time_ago') def time_ago_with_tooltip(date, placement = 'top', html_class = 'time_ago')
capture_haml do capture_haml do
haml_tag :time, date.to_s, haml_tag :time, date.to_s,
class: html_class, datetime: date.getutc.iso8601, title: date.stamp("Aug 21, 2011 9:23pm"), class: html_class, datetime: date.getutc.iso8601, title: JalaliDate.new(date).strftime("%A %d %b %Y %H:%M"),
data: { toggle: 'tooltip', placement: placement } data: { toggle: 'tooltip', placement: placement }
haml_tag :script, "$('." + html_class + "').timeago().tooltip()" haml_tag :script, "$('." + html_class + "').timeago().tooltip()"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment