c80_social_networks 0.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/app/admin/c80_social_networks/links.rb +54 -0
- data/app/admin/c80_social_networks/types.rb +53 -0
- data/app/assets/stylesheets/c80_social_networks.scss +2 -0
- data/app/assets/stylesheets/c80_social_networks/backend/types.scss +11 -0
- data/app/assets/stylesheets/c80_social_networks/frontend/links_list.scss +27 -0
- data/app/assets/stylesheets/c80_social_networks/lib/font_awesome_important.scss +3 -0
- data/app/assets/stylesheets/c80_social_networks/lib/social_icon.scss +3 -0
- data/app/assets/stylesheets/c80_social_networks/lib/type_title.scss +6 -0
- data/app/assets/stylesheets/c80_social_networks_backend.scss +2 -0
- data/app/helpers/c80_social_networks/links_helper.rb +16 -0
- data/app/helpers/c80_social_networks/social_icons_helper.rb +14 -0
- data/app/helpers/c80_social_networks/types_helper.rb +9 -0
- data/app/models/c80_social_networks/link.rb +24 -0
- data/app/models/c80_social_networks/type.rb +9 -0
- data/app/uploaders/c80_social_networks/type_icon_uploader.rb +31 -0
- data/app/views/c80_social_networks/_links_list.html.erb +11 -0
- data/app/views/c80_social_networks/_social_icon.html.erb +1 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/c80_social_networks.gemspec +25 -0
- data/config/initializers/activeadmin.rb +4 -0
- data/db/migrate/20161003060101_c80_social_networks_create_types.rb +12 -0
- data/db/migrate/20161003104343_c80_social_networks_create_links.rb +10 -0
- data/db/migrate/20161003104949_c80_social_networks_add_join_table_links_types.rb +11 -0
- data/db/seeds/c80_social_networks_01_fill_types.rb +65 -0
- data/db/seeds/c80_social_networks_02_fill_links.rb +30 -0
- data/lib/c80_social_networks.rb +8 -0
- data/lib/c80_social_networks/engine.rb +23 -0
- data/lib/c80_social_networks/version.rb +3 -0
- metadata +120 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cac16660a2e92ab2eea0fdd7c5377f985b5c07ef
|
4
|
+
data.tar.gz: c986d7c79ac02fba6d9e5cd4f2dd0b5abd0e1fbb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f5f756f7f767cd2a753ba17acf64fc894df3bd21ed8f0bb6a0f15216f069aa394807af368496fdc0d72e9189e4855f175091dfc0ad602b85492fda4e0fcfd4a6
|
7
|
+
data.tar.gz: 05b60d891028cb4dd425776f774b76a04ce8ed9da63c6c2d04c39e00780caef711437e60bda75061fbf979fdbc412ff7abc049599dc55e2490044ddfbb8b2c93
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -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
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
|
+
# C80SocialNetworks
|
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_social_networks`. 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_social_networks'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install c80_social_networks
|
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_social_networks. 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,54 @@
|
|
1
|
+
ActiveAdmin.register C80SocialNetworks::Link, as: 'Link' do
|
2
|
+
|
3
|
+
menu :label => 'Ссылки', # TODO_MY:: название пункта меню перенесести в параметры в базу
|
4
|
+
priority: 2,
|
5
|
+
# :if => proc {current_admin_user.email == "tz007@mail.ru"},
|
6
|
+
parent: 'Социальные сети'# TODO_MY:: название пункта меню перенесести в параметры в базу
|
7
|
+
|
8
|
+
permit_params :title,
|
9
|
+
:url,
|
10
|
+
:ord,
|
11
|
+
:type_ids => []
|
12
|
+
|
13
|
+
batch_action :destroy, false
|
14
|
+
config.per_page = 100
|
15
|
+
config.sort_order = 'id_asc'
|
16
|
+
before_filter :skip_sidebar!, :only => :index
|
17
|
+
|
18
|
+
index do
|
19
|
+
selectable_column
|
20
|
+
column :title
|
21
|
+
column :ord
|
22
|
+
column :url
|
23
|
+
column :type do |link|
|
24
|
+
res = ''
|
25
|
+
link.types.map do |type|
|
26
|
+
res += type_title_html_str(type)
|
27
|
+
end
|
28
|
+
res.html_safe
|
29
|
+
end
|
30
|
+
actions
|
31
|
+
end
|
32
|
+
|
33
|
+
form(:html => {:multipart => true}) do |f|
|
34
|
+
|
35
|
+
f.inputs 'Свойства' do
|
36
|
+
|
37
|
+
f.input :title
|
38
|
+
f.input :ord
|
39
|
+
f.input :url
|
40
|
+
f.input :types,
|
41
|
+
:as => :select,
|
42
|
+
:include_blank => false,
|
43
|
+
:input_html => {
|
44
|
+
:class => 'selectpicker',
|
45
|
+
'data-size' => "10",
|
46
|
+
'data-width' => '400px',
|
47
|
+
:multiple => false
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
f.actions
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
ActiveAdmin.register C80SocialNetworks::Type, as: 'Type' do
|
2
|
+
|
3
|
+
menu :label => 'Типы соцсетей', # TODO_MY:: название пункта меню перенесести в параметры в базу
|
4
|
+
priority: 2,
|
5
|
+
# :if => proc {current_admin_user.email == "tz007@mail.ru"},
|
6
|
+
parent: 'Социальные сети'# TODO_MY:: название пункта меню перенесести в параметры в базу
|
7
|
+
|
8
|
+
permit_params :title,
|
9
|
+
:tag,
|
10
|
+
:image,
|
11
|
+
:_delete_image,
|
12
|
+
:awesome_icon_code
|
13
|
+
|
14
|
+
batch_action :destroy, false
|
15
|
+
config.per_page = 100
|
16
|
+
config.sort_order = 'id_asc'
|
17
|
+
before_filter :skip_sidebar!, :only => :index
|
18
|
+
|
19
|
+
index do
|
20
|
+
selectable_column
|
21
|
+
column :title do |type|
|
22
|
+
type_title_html_str(type).html_safe
|
23
|
+
end
|
24
|
+
column :tag
|
25
|
+
column :awesome_icon_code
|
26
|
+
column :image do |type|
|
27
|
+
if type.image.present?
|
28
|
+
link_to image_tag(type.image), image_path(type.image), target: '_blank'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
actions
|
32
|
+
end
|
33
|
+
|
34
|
+
form(:html => {:multipart => true}) do |f|
|
35
|
+
|
36
|
+
f.inputs 'Свойства' do
|
37
|
+
|
38
|
+
f.input :title
|
39
|
+
f.input :tag
|
40
|
+
f.input :awesome_icon_code
|
41
|
+
f.input :image,
|
42
|
+
:as => :file,
|
43
|
+
:hint => image_tag(f.object.image)
|
44
|
+
if f.object.image.present?
|
45
|
+
f.input :_delete_image, :as => :boolean, :required => false, :label => 'Удалить картинку'
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
f.actions
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
div.links_list {
|
2
|
+
|
3
|
+
> ul {
|
4
|
+
margin: 0;
|
5
|
+
padding: 0;
|
6
|
+
list-style: none;
|
7
|
+
|
8
|
+
> li {
|
9
|
+
float: left;
|
10
|
+
padding-right: 4px;
|
11
|
+
|
12
|
+
> a {
|
13
|
+
white-space: nowrap;
|
14
|
+
|
15
|
+
-webkit-transition: color 1s ease-out;
|
16
|
+
-moz-transition: color 1s ease-out;
|
17
|
+
-ms-transition: color 1s ease-out;
|
18
|
+
-o-transition: color 1s ease-out;
|
19
|
+
transition: color 1s ease-out;
|
20
|
+
|
21
|
+
}
|
22
|
+
|
23
|
+
}
|
24
|
+
|
25
|
+
}
|
26
|
+
|
27
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module C80SocialNetworks
|
2
|
+
module LinksHelper
|
3
|
+
|
4
|
+
def render_social_networks_links_list
|
5
|
+
|
6
|
+
links_list = Link.all.ord_asc
|
7
|
+
|
8
|
+
render :partial => 'c80_social_networks/links_list',
|
9
|
+
:locals => {
|
10
|
+
links_list: links_list
|
11
|
+
}
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module C80SocialNetworks
|
2
|
+
module SocialIconsHelper
|
3
|
+
|
4
|
+
def draw_social_icon(title='social icon',awesome_icon_code='fa-heart',width=16,height=16)
|
5
|
+
|
6
|
+
render :partial => 'c80_social_networks/social_icon',
|
7
|
+
:locals => {
|
8
|
+
title: title,
|
9
|
+
awesome_icon_code: awesome_icon_code
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module C80SocialNetworks
|
2
|
+
class Link < ActiveRecord::Base
|
3
|
+
|
4
|
+
has_and_belongs_to_many :types#, :join_table => 'c80_social_networks_links_types'
|
5
|
+
scope :ord_asc, -> {order(:ord => :asc)}
|
6
|
+
|
7
|
+
def type_title
|
8
|
+
res = ''
|
9
|
+
if self.types.count > 0
|
10
|
+
res = self.types.first.title
|
11
|
+
end
|
12
|
+
res
|
13
|
+
end
|
14
|
+
|
15
|
+
def type_awesome_icon_code
|
16
|
+
res = ''
|
17
|
+
if self.types.count > 0
|
18
|
+
res = self.types.first.awesome_icon_code
|
19
|
+
end
|
20
|
+
res
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module C80SocialNetworks
|
2
|
+
class Type < ActiveRecord::Base
|
3
|
+
|
4
|
+
before_validation { self.remove_image! if self._delete_image }
|
5
|
+
mount_uploader :image, TypeIconUploader
|
6
|
+
has_and_belongs_to_many :links#, :join_table => 'c80_social_networks_links_types'
|
7
|
+
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module C80SocialNetworks
|
2
|
+
|
3
|
+
class TypeIconUploader < CarrierWave::Uploader::Base
|
4
|
+
|
5
|
+
include CarrierWave::MiniMagick
|
6
|
+
|
7
|
+
storage :file
|
8
|
+
|
9
|
+
process :resize_to_limit => [100, 100]
|
10
|
+
|
11
|
+
def store_dir
|
12
|
+
"uploads/social_networks"
|
13
|
+
end
|
14
|
+
|
15
|
+
def filename
|
16
|
+
if original_filename
|
17
|
+
"icon_#{secure_token(4)}.#{file.extension}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
|
23
|
+
def secure_token(length=16)
|
24
|
+
var = :"@#{mounted_as}_secure_token"
|
25
|
+
model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.hex(length/2))
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="links_list clearfix">
|
2
|
+
<ul>
|
3
|
+
<% links_list.each_with_index do |link, index| %>
|
4
|
+
<li class="link_<%=index%> type_<%= link.type_title %>">
|
5
|
+
<%= link_to link.url, { target: '_blank', title: link.title } do %>
|
6
|
+
<%= draw_social_icon(link.title, link.type_awesome_icon_code) %>
|
7
|
+
<% end %>
|
8
|
+
</li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<i class="social_icon fa <%= awesome_icon_code %>" aria-hidden="true"></i>
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "c80_social_networks"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'c80_social_networks/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "c80_social_networks"
|
8
|
+
spec.version = C80SocialNetworks::VERSION
|
9
|
+
spec.authors = ["C80609A"]
|
10
|
+
spec.email = ["c080609a@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = 'Social networks gem'
|
13
|
+
spec.description = "Gem adds social networks to site"
|
14
|
+
spec.homepage = "https://github.com/c080609a/c80_social_networks"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_dependency 'activesupport', ['>= 3.0.0']
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class C80SocialNetworksCreateTypes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :c80_social_networks_types, :options => 'COLLATE=utf8_unicode_ci' do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :tag
|
6
|
+
t.string :awesome_icon_code # если не задана картинка image - будет использован стандартная иконка из font awesome
|
7
|
+
t.string :image # можно переопределить иконку font awesome
|
8
|
+
t.boolean :_delete_image # картинку можно удалить
|
9
|
+
t.timestamps null: false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class C80SocialNetworksAddJoinTableLinksTypes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :c80_social_networks_links_types, :id => false do |t|
|
4
|
+
t.integer :link_id, :null => false
|
5
|
+
t.integer :type_id, :null => false
|
6
|
+
end
|
7
|
+
|
8
|
+
add_index :c80_social_networks_links_types, [:type_id, :link_id], :unique => true, :name => 'my_index'
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# rake db:seed:c80_social_networks_01_fill_types
|
2
|
+
|
3
|
+
C80SocialNetworks::Type.delete_all
|
4
|
+
C80SocialNetworks::Type.create!([
|
5
|
+
{
|
6
|
+
id: 1,
|
7
|
+
title: 'VK',
|
8
|
+
tag: 'vk',
|
9
|
+
awesome_icon_code: 'fa-vk'
|
10
|
+
},
|
11
|
+
{
|
12
|
+
id: 2,
|
13
|
+
title: 'Facebook',
|
14
|
+
tag: 'fb',
|
15
|
+
awesome_icon_code: 'fa-facebook-official'
|
16
|
+
},
|
17
|
+
{
|
18
|
+
id: 3,
|
19
|
+
title: 'Twitter',
|
20
|
+
tag: 'twitter',
|
21
|
+
awesome_icon_code: 'fa-twitter'
|
22
|
+
},
|
23
|
+
{
|
24
|
+
id: 4,
|
25
|
+
title: 'Instagram',
|
26
|
+
tag: 'instagram',
|
27
|
+
awesome_icon_code: 'fa-instagram'
|
28
|
+
},
|
29
|
+
{
|
30
|
+
id: 5,
|
31
|
+
title: 'Одноклассники',
|
32
|
+
tag: 'ok',
|
33
|
+
awesome_icon_code: 'fa-odnoklassniki-square'
|
34
|
+
},
|
35
|
+
{
|
36
|
+
id: 6,
|
37
|
+
title: 'Youtube',
|
38
|
+
tag: 'youtube',
|
39
|
+
awesome_icon_code: 'fa-youtube'
|
40
|
+
},
|
41
|
+
{
|
42
|
+
id: 7,
|
43
|
+
title: 'Google plus',
|
44
|
+
tag: 'gp',
|
45
|
+
awesome_icon_code: 'fa-google-plus-square'
|
46
|
+
},
|
47
|
+
{
|
48
|
+
id: 8,
|
49
|
+
title: 'Whatsapp',
|
50
|
+
tag: 'whatsapp',
|
51
|
+
awesome_icon_code: 'fa-whatsapp'
|
52
|
+
},
|
53
|
+
{
|
54
|
+
id: 9,
|
55
|
+
title: 'Skype',
|
56
|
+
tag: 'skype',
|
57
|
+
awesome_icon_code: 'fa-skype'
|
58
|
+
},
|
59
|
+
{
|
60
|
+
id: 10,
|
61
|
+
title: 'LinkedIn',
|
62
|
+
tag: 'linkedin',
|
63
|
+
awesome_icon_code: 'fa-linkedin'
|
64
|
+
}
|
65
|
+
])
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# rake db:seed:c80_social_networks_02_fill_links
|
2
|
+
|
3
|
+
C80SocialNetworks::Link.delete_all
|
4
|
+
C80SocialNetworks::Link.create!([
|
5
|
+
{
|
6
|
+
id: 1,
|
7
|
+
ord: 10,
|
8
|
+
title: 'Наша группа Вконтакте',
|
9
|
+
url: 'http://vk.com'
|
10
|
+
},
|
11
|
+
{
|
12
|
+
id: 2,
|
13
|
+
ord: 20,
|
14
|
+
title: 'Мы в инстаграм',
|
15
|
+
url: 'http://instagram.com'
|
16
|
+
},
|
17
|
+
{
|
18
|
+
id: 3,
|
19
|
+
ord: 30,
|
20
|
+
title: 'Facebook',
|
21
|
+
url: 'http://facebook.com'
|
22
|
+
},
|
23
|
+
])
|
24
|
+
|
25
|
+
C80SocialNetworks::Link::HABTM_Types.delete_all
|
26
|
+
C80SocialNetworks::Link::HABTM_Types.create!([
|
27
|
+
{ link_id: 1, type_id: 1 },
|
28
|
+
{ link_id: 2, type_id: 4 },
|
29
|
+
{ link_id: 3, type_id: 2 }
|
30
|
+
])
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module C80SocialNetworks
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace C80SocialNetworks
|
4
|
+
|
5
|
+
initializer :c80_social_networks_engine do
|
6
|
+
if defined?(ActiveAdmin)
|
7
|
+
ActiveAdmin.application.load_paths += Dir["#{config.root}/app/models/**/"]
|
8
|
+
#ActiveAdmin.application.load_paths += Dir["#{config.root}/app/models/concerns/**/"]
|
9
|
+
ActiveAdmin.application.load_paths += Dir["#{config.root}/app/admin/c80_social_networks/**/"]
|
10
|
+
# ActiveAdmin.application.load_paths += Dir["#{config.root}/app/jobs/**/"]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
initializer :append_migrations do |app|
|
15
|
+
unless app.root.to_s.match root.to_s
|
16
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
17
|
+
app.config.paths["db/migrate"] << expanded_path
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: c80_social_networks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- C80609A
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-10-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.0.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.0.0
|
55
|
+
description: Gem adds social networks to site
|
56
|
+
email:
|
57
|
+
- c080609a@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- CODE_OF_CONDUCT.md
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- app/admin/c80_social_networks/links.rb
|
69
|
+
- app/admin/c80_social_networks/types.rb
|
70
|
+
- app/assets/stylesheets/c80_social_networks.scss
|
71
|
+
- app/assets/stylesheets/c80_social_networks/backend/types.scss
|
72
|
+
- app/assets/stylesheets/c80_social_networks/frontend/links_list.scss
|
73
|
+
- app/assets/stylesheets/c80_social_networks/lib/font_awesome_important.scss
|
74
|
+
- app/assets/stylesheets/c80_social_networks/lib/social_icon.scss
|
75
|
+
- app/assets/stylesheets/c80_social_networks/lib/type_title.scss
|
76
|
+
- app/assets/stylesheets/c80_social_networks_backend.scss
|
77
|
+
- app/helpers/c80_social_networks/links_helper.rb
|
78
|
+
- app/helpers/c80_social_networks/social_icons_helper.rb
|
79
|
+
- app/helpers/c80_social_networks/types_helper.rb
|
80
|
+
- app/models/c80_social_networks/link.rb
|
81
|
+
- app/models/c80_social_networks/type.rb
|
82
|
+
- app/uploaders/c80_social_networks/type_icon_uploader.rb
|
83
|
+
- app/views/c80_social_networks/_links_list.html.erb
|
84
|
+
- app/views/c80_social_networks/_social_icon.html.erb
|
85
|
+
- bin/console
|
86
|
+
- bin/setup
|
87
|
+
- c80_social_networks.gemspec
|
88
|
+
- config/initializers/activeadmin.rb
|
89
|
+
- db/migrate/20161003060101_c80_social_networks_create_types.rb
|
90
|
+
- db/migrate/20161003104343_c80_social_networks_create_links.rb
|
91
|
+
- db/migrate/20161003104949_c80_social_networks_add_join_table_links_types.rb
|
92
|
+
- db/seeds/c80_social_networks_01_fill_types.rb
|
93
|
+
- db/seeds/c80_social_networks_02_fill_links.rb
|
94
|
+
- lib/c80_social_networks.rb
|
95
|
+
- lib/c80_social_networks/engine.rb
|
96
|
+
- lib/c80_social_networks/version.rb
|
97
|
+
homepage: https://github.com/c080609a/c80_social_networks
|
98
|
+
licenses: []
|
99
|
+
metadata: {}
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 2.5.1
|
117
|
+
signing_key:
|
118
|
+
specification_version: 4
|
119
|
+
summary: Social networks gem
|
120
|
+
test_files: []
|