c80_swiper 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c509f5922d1f5f8670aae97f2dd3fe8f7019ac92
4
+ data.tar.gz: 84577765904ada8908482c4d1d12adeb36773a3f
5
+ SHA512:
6
+ metadata.gz: 4de75ab939c5d3194e8d95a83132f9b633fb0fc0a785a4356f691af737e4702c1a6715f6451d5d6dfbf27b92ab37b61143184b7c11e7c62aa30c80de317b5d4f
7
+ data.tar.gz: 278622e5ec8b6f9957ed3224f588e548f5c0d55d177e1635e2e6830306302fa45443c4926b92b96dde59ae799c647318902042807e6e653865cf4e154715e4f4
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.idea/
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+ *.gem
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at c080609a@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in c80_swiper.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 C80609A
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # C80Swiper
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/c80_swiper`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'c80_swiper'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install c80_swiper
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/c80_swiper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,77 @@
1
+ ActiveAdmin.register C80Swiper::Swslider, as: 'Swslider' do
2
+
3
+ config.per_page = 100
4
+
5
+ menu :label => 'Слайдеры', # TODO_MY:: название пункта меню перенесести в параметры в базу
6
+ priority: 4,
7
+ parent: 'Swipers' # TODO_MY:: название пункта меню перенесести в параметры в базу
8
+
9
+ permit_params :title,
10
+ :sframes_attributes => [
11
+ :id,
12
+ :_destroy,
13
+ :title,
14
+ :link_url,
15
+ :image,
16
+ :swslider_id,
17
+ :ord,
18
+ :enabled,
19
+ :fcaptions_attributes => [
20
+ :id,
21
+ :_destroy,
22
+ :sframe_id,
23
+ :ord,
24
+ :value
25
+ ]
26
+ ]
27
+
28
+ batch_action :destroy, false
29
+
30
+ config.sort_order = 'id_desc'
31
+
32
+ # before_filter :skip_sidebar!, :only => :index
33
+
34
+ index do
35
+ selectable_column
36
+ column :title
37
+ column :sframes do |csample|
38
+ s = ''
39
+ # link_to image_tag(csample.csphoto.thumb_md, style: 'width:150px;'), csample.csphoto.url, target: '_blank'
40
+ # s = csample.sframes.def_order
41
+ # .map{ |sframe| "<li>#{sframe.offer.title} (#{sframe.offer.price})</li>"}
42
+ # .join('')
43
+ # s += "<li>Итого: #{ csample.summ_price }</li>"
44
+ "<ul>#{s}</ul>".html_safe
45
+ end
46
+ actions
47
+ end
48
+
49
+ form(:html => {:multipart => true}) do |f|
50
+
51
+ f.inputs 'Свойства' do
52
+
53
+ f.input :title
54
+
55
+ f.inputs 'Фреймы' do
56
+ f.has_many :sframes, allow_destroy: true do |ff|
57
+ ff.input :title
58
+ ff.input :link_url
59
+ ff.input :enabled,
60
+ :input_html => {
61
+ :checked => ff.object.new_record? ? 'checked':nil
62
+ }
63
+ ff.input :image,
64
+ :as => :file,
65
+ :hint => image_tag(ff.object.image.thumb_md)
66
+ ff.has_many :fcaptions, allow_destroy: true do |fff|
67
+ fff.input :value
68
+ end
69
+ end
70
+ end
71
+
72
+ end
73
+
74
+ f.actions
75
+ end
76
+
77
+ end