abstracted 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 513a8bc84b158cd7bb649f5285a1dc0fe78355ac
4
- data.tar.gz: 0b83926221a0c3ffd888981cd91e3ad7f889ecd7
3
+ metadata.gz: d37fdc45795f03804da74023540c393d8c32ba21
4
+ data.tar.gz: 9012ecedbe89d88d7d2781e0a40aede77812a61e
5
5
  SHA512:
6
- metadata.gz: 577b3ae9339f08e18654b069c3fe58de050bac967b4f2fdbd6fdbc77df5215d96ed6a8609141dcaa5135554ee792f6294a9ceee983ae4c4563c1afbd72f79ef6
7
- data.tar.gz: 236c8bd7c3592f877a011e3a382dc3ba1fc1c9477fdc4d80bbbc3cb866bd34ffb362565a0c6ffcd3b86e68c6c949fd28928527dc80ee440e6b8ec1cd9903a469
6
+ metadata.gz: dddd1bd9e1c72f6678403b1215c87899793c1883cb4c90ca167ef3e376fab018179a59e1d31ebe05ac61910b1808cdc9e5f8f9d0f9c9991e95c3fe586d04dff2
7
+ data.tar.gz: 68dc19fe35faef2c45e616e01c45aee3d528cee4f6964a9c1f382f99f1d8b4758d928f6ef76dfd78b81ebccdc17fd7a41aaee5412bb1851c45e6590cb4ec4cd3
@@ -8,19 +8,20 @@ pageUrl = ''
8
8
  contxt = null
9
9
  scrollTimeout = false
10
10
 
11
- @evalPageNumber = (url) ->
12
- try
13
- pn = url
14
- .split('?')[1]
15
- .split('&')
16
- .filter (el,i,array) ->
17
- if el.match /^page/
18
- return el
19
- .join('')
20
- .split('=')[1]
21
- parseInt(pn)
22
- catch error
23
- pn = 0
11
+ @evalPageNumber = (elem) ->
12
+ if elem
13
+ try
14
+ pn = elem[0].href
15
+ .split('?')[1]
16
+ .split('&')
17
+ .filter (el,i,array) ->
18
+ if el.match /^page/
19
+ return el
20
+ .join('')
21
+ .split('=')[1]
22
+ parseInt(pn)
23
+ catch error
24
+ pn = 0
24
25
 
25
26
  #
26
27
  # setVariables prepares for a great scrolling experience
@@ -29,8 +30,8 @@ scrollTimeout = false
29
30
  navPaginator = $('nav.pagination')
30
31
  try
31
32
  pageUrl = navPaginator.find('a[rel=next]')[0].href.replace( '?', '.js?scrolling=true&')
32
- lastPage = evalPageNumber navPaginator.find('span.last a')[0].href
33
- nextPage = evalPageNumber navPaginator.find('a[rel=next]')[0].href
33
+ lastPage = evalPageNumber navPaginator.find('span.last a')
34
+ nextPage = evalPageNumber navPaginator.find('a[rel=next]')
34
35
  contxt = $(elem)
35
36
  if nextPage > 1
36
37
  nextPage = 1
@@ -241,7 +241,7 @@ class AbstractResourcesController < ApplicationController
241
241
  def resource
242
242
  @resource ||= (_id.nil? ? new_resource : resource_class.find(_id) )
243
243
  return @resource if @resource.nil?
244
- @resource.current_user = current_user || nil if @resource.respond_to? :current_user
244
+ @resource.current_user = (current_user || nil) if @resource.respond_to? :current_user
245
245
  @resource
246
246
  rescue Exception => e
247
247
  scoop_from_error e
@@ -128,6 +128,10 @@ module AbstractResourcesHelper
128
128
  opt[:controller] ||= resource_class.table_name
129
129
  opt[:action] ||= :index
130
130
  url_for opt
131
+ rescue
132
+ #
133
+ # return the root_url if no route was found!
134
+ root_url
131
135
  end
132
136
 
133
137
  #
@@ -508,7 +512,8 @@ module AbstractResourcesHelper
508
512
  # does a resource_class and action based translation of title on a page
509
513
  #
510
514
  def show_page_title
511
- t '%s.%s.title' % [ resource_class.table_name, params[:action] ]
515
+ # t '%s.%s.title' % [ resource_class.table_name, params[:action] ]
516
+ t '%s.%s.title' % [ params[:controller], params[:action] ]
512
517
  end
513
518
 
514
519
  #
@@ -1,6 +1,7 @@
1
- .row
2
- .col.s12
3
- %h3= render partial: 'title'
1
+ = render partial: 'title'
2
+ -# .row
3
+ -# .col.s12
4
+ -# %h3= yield :title
4
5
 
5
6
  .row
6
7
  .col.s12
@@ -1,8 +1,9 @@
1
+ / fisk
1
2
  %nav.top-nav
2
3
  .container
3
4
  .nav-wrapper
4
- = link_to root_url, id: "logo-container", class: "page-title right" do
5
- = yield :title
5
+ = link_to resources_url, id: "logo-container", class: "page-title right" do
6
+ = content_for?(:title) ? yield(:title) : 'wheelstore.space'
6
7
  /
7
8
  / perhaps incorporate https://github.com/mblode/burger
8
9
  /
@@ -1,3 +1,3 @@
1
1
  module Abstracted
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstracted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Walther H Diechmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-27 00:00:00.000000000 Z
11
+ date: 2016-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails