homesteading_helpers 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50bb4466d03dff5b0a8de0c9e83679f549281a0b
|
|
4
|
+
data.tar.gz: d83e8453ed7f37ef98afc96d682cc2bf96171e63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5227fcc29f5b354c664cc74dd91991061b4d9a58059125a7120d18392e0226484b975025a142744ae3f2a4e8981771f4882e48cf0cd39df23def80d751d12a04
|
|
7
|
+
data.tar.gz: 0558a7e6b5a498512ee524337caad6fb76738a46b9cb088396f09ab54e7b92eb8f90329b3b49102bdb957d028df89796c6a4897645bd9686d3fd8bc6b1695232
|
|
@@ -207,5 +207,40 @@ module HomesteadingHelpers
|
|
|
207
207
|
def tag_url(tag)
|
|
208
208
|
site_url + "/tags/" + tag.gsub(/ /, "+")
|
|
209
209
|
end
|
|
210
|
+
|
|
211
|
+
def license_text
|
|
212
|
+
output = []
|
|
213
|
+
|
|
214
|
+
# license
|
|
215
|
+
license = License.find(setting(:license))
|
|
216
|
+
|
|
217
|
+
if license.name == "All Rights Reserved"
|
|
218
|
+
# Default
|
|
219
|
+
output << "#{license.name} #{license.short_code}"
|
|
220
|
+
else
|
|
221
|
+
# Creative Commons and Public Domain (CC0)
|
|
222
|
+
output << link_to("#{license.name} (#{license.short_code})", license.url, rel: "license")
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
# range of years
|
|
227
|
+
years_range = Time.now.year
|
|
228
|
+
|
|
229
|
+
first_post = Object.const_get(setting(:post_type).classify).last
|
|
230
|
+
first_post_year = first_post.nil? ? years_range : first_post.published_at.year
|
|
231
|
+
|
|
232
|
+
if first_post_year == years_range
|
|
233
|
+
output << years_range
|
|
234
|
+
else
|
|
235
|
+
output << "#{first_post_year}–#{years_range}"
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
# author's name
|
|
240
|
+
output << setting(:author_name)
|
|
241
|
+
|
|
242
|
+
output.join(" ").html_safe
|
|
243
|
+
end
|
|
244
|
+
|
|
210
245
|
end
|
|
211
246
|
end
|