godmin 0.12.4 → 1.0.0

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: 23cb0a9e87abfb6bc2aac4b0185a5951ac29d558
4
- data.tar.gz: 015627e42d6d719cf8d8c1e38d8d0ddd47aef510
3
+ metadata.gz: d8d8456ed97a4b0447080f6faecfcb647dec74de
4
+ data.tar.gz: 80c9d86243368a78a4f40d9b684a3aabb90c396a
5
5
  SHA512:
6
- metadata.gz: 5dbf6f79d8127cd2cf3d6434050be4c1270c0500912e92a23bde6fb98417335c9c91228def598cd9f14b03233908b4ab2b8db9832503c83df3c1513c0591a441
7
- data.tar.gz: 1026fb15383f4b75be2bfa98160dad0340864c92510ec389c4725c464d9bc422fe1e68dbb0a8043f3742cfa46057d7f06987854652a215014ac27777f43a0421
6
+ metadata.gz: 33c8e7b29d921d19f61057f023ffb15987fe9bee65c4544a2ec77b834d9a7c8775765d56c5ec3e91ae8601b11ad94c532c1664676d6e7e7b6b4c84ea30acd076
7
+ data.tar.gz: 8dcccc5c59e0b6b7890694ca06d9075779387aebc1a13f21122be7f4af97f491da77e4fd6c13b33ccfbd1fd7a7e78073afd33ec83d04e89079046a037a900e0a
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.0 - 2015-11-13
4
+ Release of 1.0.0 :tada:
5
+
3
6
  ### 0.12.4 - 2015-10-21
4
7
  Bug fixes
5
8
  - Fixes a bug which made it impossible to override the datetimepicker locale (https://github.com/varvet/godmin/issues/132)
@@ -0,0 +1,50 @@
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 info@varvet.se. 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
+
45
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
46
+ version 1.3.0, available at
47
+ [http://contributor-covenant.org/version/1/3/0/][version]
48
+
49
+ [homepage]: http://contributor-covenant.org
50
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Code Climate](https://img.shields.io/codeclimate/github/varvet/godmin.svg)](https://codeclimate.com/github/varvet/godmin)
6
6
  [![Test Coverage](https://codeclimate.com/github/varvet/godmin/badges/coverage.svg)](https://codeclimate.com/github/varvet/godmin/coverage)
7
7
 
8
- Godmin is an admin framework for Rails 4+. Use it to build dedicated admin sections for your apps, or stand alone admin apps such as internal tools. It has support for common features such as scoping, filtering and performing batch actions on your models.
8
+ Godmin is an admin framework for Rails 4+. Use it to build dedicated admin sections for your apps, or stand alone admin apps such as internal tools. It has support for common features such as scoping, filtering and performing batch actions on your models. [Try the demo](http://godmin-sandbox.herokuapp.com).
9
9
 
10
10
  Godmin differs from tools like [ActiveAdmin](http://activeadmin.info/) and [RailsAdmin](https://github.com/sferik/rails_admin) in how admin sections are created. Rather than being DSL-based, Godmin is a set of opt-in modules and helpers that can be applied to regular Rails apps and engines. An admin section built with Godmin is just that, a regular Rails app or Rails engine, with regular routes, controllers and views. That means there is less to learn, because you already know most of it, and fewer constraints on what you can do. After all, administrators are users too, and what better way to provide them with a tailor made experience than building them a Rails app?
11
11
 
@@ -1,3 +1,3 @@
1
1
  module Godmin
2
- VERSION = "0.12.4"
2
+ VERSION = "1.0.0"
3
3
  end
Binary file
@@ -48,13 +48,29 @@ def install_engine
48
48
  end
49
49
 
50
50
  def generate_model
51
- generate(:model, "article title:string body:text published:boolean published_at:datetime")
51
+ generate(:model, "article title:string body:text author:string published:boolean published_at:datetime")
52
52
 
53
53
  append_to_file "db/seeds.rb" do
54
54
  <<-END.strip_heredoc
55
- Article.create! title: "The first article", published: false
56
- Article.create! title: "The second article", published: false
57
- Article.create! title: "The third article", published: true, published_at: Time.zone.now
55
+ def title
56
+ 5.times.map { lorem.sample }.join(" ").capitalize
57
+ end
58
+
59
+ def lorem
60
+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.".gsub(/[.,]/, "").downcase.split(" ")
61
+ end
62
+
63
+ def author
64
+ ["Lorem Ipsum", "Magna Aliqua", "Commodo Consequat"].sample
65
+ end
66
+
67
+ def published
68
+ [true, true, false].sample
69
+ end
70
+
71
+ 35.times do |i|
72
+ Article.create! title: title, author: author, published: published
73
+ end
58
74
  END
59
75
  end
60
76
  end
@@ -91,13 +107,13 @@ def modify_service(namespace = nil)
91
107
  "app/services/article_service.rb"
92
108
  end
93
109
 
94
- gsub_file article_service, "attrs_for_index", "attrs_for_index :title, :published_at"
95
- gsub_file article_service, "attrs_for_show", "attrs_for_show :title, :body, :published, :published_at"
96
- gsub_file article_service, "attrs_for_form", "attrs_for_form :title, :body, :published, :published_at"
110
+ gsub_file article_service, "attrs_for_index", "attrs_for_index :title, :author, :published_at"
111
+ gsub_file article_service, "attrs_for_show", "attrs_for_show :title, :body, :author, :published, :published_at"
112
+ gsub_file article_service, "attrs_for_form", "attrs_for_form :title, :body, :author, :published, :published_at"
97
113
 
98
- inject_into_file article_service, after: "attrs_for_form :title, :body, :published, :published_at \n" do
114
+ inject_into_file article_service, after: "attrs_for_form :title, :body, :author, :published, :published_at \n" do
99
115
  <<-END.strip_heredoc.indent(namespace ? 4 : 2)
100
- attrs_for_export :id, :title, :published, :published_at
116
+ attrs_for_export :id, :title, :author, :published, :published_at
101
117
 
102
118
  scope :unpublished
103
119
  scope :published
@@ -111,11 +127,16 @@ def modify_service(namespace = nil)
111
127
  end
112
128
 
113
129
  filter :title
130
+ filter :author
114
131
 
115
132
  def filter_title(articles, value)
116
133
  articles.where(title: value)
117
134
  end
118
135
 
136
+ def filter_author(articles, value)
137
+ articles.where(author: value)
138
+ end
139
+
119
140
  batch_action :unpublish, except: [:unpublished]
120
141
  batch_action :publish, except: [:published]
121
142
  batch_action :destroy, confirm: true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: godmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Ljungblad
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-21 00:00:00.000000000 Z
13
+ date: 2015-11-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bcrypt
@@ -254,6 +254,7 @@ files:
254
254
  - ".rubocop.yml"
255
255
  - ".travis.yml"
256
256
  - CHANGELOG.md
257
+ - CODE_OF_CONDUCT.md
257
258
  - Gemfile
258
259
  - MIT-LICENSE
259
260
  - README.md