fly_admin 0.0.2 → 0.0.3

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: fe790ccb88c3b854aaa5eb9ed37b9cb767615443
4
- data.tar.gz: 6087c084c181e4fb08e862b4c26a874dc3a38078
3
+ metadata.gz: 04a96b71887cfc1d39a76501710f129f0d13ccef
4
+ data.tar.gz: 1d43ec3a9d1ad992fdcd36af89edb6daa07dd568
5
5
  SHA512:
6
- metadata.gz: d925a5ed3de9b1ef130a2b88a32e270d8b221a609c94109d3f264e8eefb08186346432119364784d2902939b4c1ca7d0dd383b771e4765fb2d1739c976080129
7
- data.tar.gz: 2fe7947394dfd4af2b481988559d9db6cb405ad6930333ffaaed392e717cf918ad384216342bdffa0d2d7c5d1976c1da1f7db65bd8ce84a6c2bf8092e1a61306
6
+ metadata.gz: c9a69f55da46dcd568f96dbea5e4969c7d596d830c2bd95f56c8cf66fd88954442f0f32b84dbada2fa7f73c889686197e7f5b6f8e2ad20206ccdfb7ed282f7d0
7
+ data.tar.gz: a8884e6b81f41b983251cc52aee2e1c0398e475846eac2fc603d6f0a4dffe02c5481bb282617ca3317076e9f9bb8265c78e4701f3f58954df92eca0b20f54988
@@ -63,8 +63,8 @@ module FlyAdmin
63
63
  end
64
64
 
65
65
  def clear_footer_cache
66
- paysite = @footer.paysite
67
- country = @footer.country
66
+ paysite = @footer.paysite.name
67
+ country = @footer.country.name
68
68
  SiteCache.clear_element("content_#{paysite}_#{country}")
69
69
  end
70
70
  end
@@ -1,7 +1,9 @@
1
1
  module FlyAdmin
2
2
  module FootersHelper
3
3
  def cut_footer(str)
4
- str.length > 30 ? str[0..30] + '...' : str
4
+ if str
5
+ str.length > 30 ? str[0..30] + '...' : str
6
+ end
5
7
  end
6
8
  end
7
9
  end
@@ -13,7 +13,7 @@
13
13
  = nested_form_for(category, :html => {:class => 'smart-form', :multipart => true}) do |f|
14
14
  - if category.errors.any?
15
15
  - category.errors.full_messages.each do |msg|
16
- = render 'layouts/error_flash_message', msg: msg
16
+ = render 'layouts/fly_admin/error_flash_message', msg: msg
17
17
  %section
18
18
  .row
19
19
  - if category.poster
@@ -54,7 +54,7 @@
54
54
  = f.text_field :genre, placeholder: 'Жанр', class: 'margin-10 form-control input-sm'
55
55
  %br
56
56
  .widget-body.no-padding
57
- %header Инфа о сезонах
57
+ %header Общая информация
58
58
  %table.table.table-bordered.margin-10.table-serials{style: 'width: 500px;'}
59
59
  %thead
60
60
  %tr
@@ -112,4 +112,4 @@
112
112
  = link_to season_form.object.poster_url do
113
113
  = image_tag season_form.object.poster_url, size: '100x100', class: 'margin-left-10'
114
114
  %footer
115
- = f.submit 'Сохранить', class: 'btn btn-primary'
115
+ = f.submit 'Сохранить', class: 'btn btn-primary'
@@ -0,0 +1,7 @@
1
+ .alert.alert-danger.fade.in
2
+ %button.close{"data-dismiss" => "alert"}
3
+ ×
4
+ %i.fa-fw.fa.fa-info
5
+ %strong К сведению:
6
+ = msg
7
+
@@ -13,13 +13,12 @@
13
13
  ×
14
14
  %i.fa-fw.fa.fa-info
15
15
  %strong К сведению:
16
- = msg
17
16
  - when "error"
18
- = render 'layouts/error_flash_message', msg: msg
17
+ = render 'layouts/fly_admin/error_flash_message', msg: msg
19
18
  - else
20
19
  .alert.alert-info.fade.in
21
20
  %button.close{"data-dismiss" => "alert"}
22
21
  ×
23
22
  %i.fa-fw.fa.fa-info
24
23
  %strong К сведению:
25
- = msg
24
+ = msg
@@ -20,12 +20,8 @@ module FlyAdmin
20
20
  def self.get_customer_params(params, request)
21
21
  if ENV["RAILS_ENV"] == 'test' || ENV['TEST'].present? || Rails.env.eql?('test')
22
22
  { key: 'fun_key', alias: 'imbs_domain.com', action_type: 'wap', 'status' => 'ok', country: 'az'}
23
- else
23
+ else
24
24
  url = SiteConfig['wap_click_addr'] + '/api/handle_customer'
25
- # if Rails.env.eql? 'development'
26
- # url = 'http://0.0.0.0:3000' + '/api/handle_customer'
27
- # request.env['REMOTE_ADDR'] = '83.149.34.187'
28
- # end
29
25
  request_params = self.make_customer_request_params(request, params)
30
26
  if ENV['TEST']
31
27
  request_params[:remote_addr] = '83.149.9.19'
@@ -37,12 +33,11 @@ module FlyAdmin
37
33
  API_LOG.info "RESPONSE FROM IMBS: #{response.inspect}"
38
34
  out_hash = JSON.parse(response)
39
35
  out_hash.with_indifferent_access
40
- rescue Exception => e
36
+ rescue
41
37
  API_LOG.error "response: #{response.inspect}"
42
38
  {status: 'error'}
43
39
  end
44
- end
45
- # end
40
+ end
46
41
  end
47
42
 
48
43
  def self.make_customer_request_params(request, params)
@@ -34,8 +34,11 @@ module FlyAdmin
34
34
  text
35
35
  end
36
36
 
37
+ # After saving footer, clear cache and check if from imbs source(now - from db)
37
38
  def clear_element(elem)
38
39
  @rails_cache.delete_matched(elem)
40
+ new_text = check_footer(elem)
41
+ write_with_date(elem, new_text)
39
42
  end
40
43
 
41
44
  def write_with_date(elem, text)
@@ -1,3 +1,3 @@
1
1
  module FlyAdmin
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/fly_admin.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "fly_admin/engine"
2
2
  require "fly_admin/page_cache"
3
3
  require "fly_admin/connection_api"
4
- require "awesome_print"
4
+ # require "awesome_print"
5
5
  module FlyAdmin
6
6
  # See fly_admin_initializer.rb for more description
7
7
  mattr_accessor :api_type
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fly_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Korolev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -955,6 +955,7 @@ files:
955
955
  - app/views/fly_admin/videos/index.html.haml
956
956
  - app/views/fly_admin/videos/new.html.erb
957
957
  - app/views/fly_admin/videos/show.html.erb
958
+ - app/views/layouts/fly_admin/_error_flash_message.html.haml
958
959
  - app/views/layouts/fly_admin/_flash_messages.html.haml
959
960
  - app/views/layouts/fly_admin/_header.html.haml
960
961
  - app/views/layouts/fly_admin/_left_panel.html.haml
@@ -1008,9 +1009,7 @@ files:
1008
1009
  - test/dummy/config/locales/en.yml
1009
1010
  - test/dummy/config/routes.rb
1010
1011
  - test/dummy/config/secrets.yml
1011
- - test/dummy/db/development.sqlite3
1012
1012
  - test/dummy/db/schema.rb
1013
- - test/dummy/log/development.log
1014
1013
  - test/dummy/public/404.html
1015
1014
  - test/dummy/public/422.html
1016
1015
  - test/dummy/public/500.html
@@ -1088,9 +1087,7 @@ test_files:
1088
1087
  - test/dummy/config/routes.rb
1089
1088
  - test/dummy/config/secrets.yml
1090
1089
  - test/dummy/config.ru
1091
- - test/dummy/db/development.sqlite3
1092
1090
  - test/dummy/db/schema.rb
1093
- - test/dummy/log/development.log
1094
1091
  - test/dummy/public/404.html
1095
1092
  - test/dummy/public/422.html
1096
1093
  - test/dummy/public/500.html
Binary file
@@ -1,10 +0,0 @@
1
-  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
-  (0.1ms) select sqlite_version(*)
3
-  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
- Migrating to CreateFlyAdminFooters (20150417075759)
6
-  (0.1ms) begin transaction
7
-  (20.3ms) CREATE TABLE "fly_admin_footers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" text, "unsubscription" text, "offer" text, "paysite_id" integer, "country_id" integer, "terms" text DEFAULT '', "created_at" datetime, "updated_at" datetime)
8
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150417075759"]]
9
-  (2.2ms) commit transaction
10
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"