crowdai_admin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/LICENCE.txt +22 -0
  3. data/Readme.md +84 -0
  4. data/app/assets/fonts/Lato-Bold.eot +0 -0
  5. data/app/assets/fonts/Lato-Bold.ttf +0 -0
  6. data/app/assets/fonts/Lato-Bold.woff +0 -0
  7. data/app/assets/fonts/Lato-Bold.woff2 +0 -0
  8. data/app/assets/fonts/Lato-BoldItalic.eot +0 -0
  9. data/app/assets/fonts/Lato-BoldItalic.ttf +0 -0
  10. data/app/assets/fonts/Lato-BoldItalic.woff +0 -0
  11. data/app/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  12. data/app/assets/fonts/Lato-Italic.eot +0 -0
  13. data/app/assets/fonts/Lato-Italic.ttf +0 -0
  14. data/app/assets/fonts/Lato-Italic.woff +0 -0
  15. data/app/assets/fonts/Lato-Italic.woff2 +0 -0
  16. data/app/assets/fonts/Lato-Regular.eot +0 -0
  17. data/app/assets/fonts/Lato-Regular.ttf +0 -0
  18. data/app/assets/fonts/Lato-Regular.woff +0 -0
  19. data/app/assets/fonts/Lato-Regular.woff2 +0 -0
  20. data/app/assets/javascripts/crowdai_admin/base.js +79 -0
  21. data/app/assets/stylesheets/crowdai_admin/_base.scss +42 -0
  22. data/app/assets/stylesheets/crowdai_admin/_common.scss +27 -0
  23. data/app/assets/stylesheets/crowdai_admin/_grid.scss +4 -0
  24. data/app/assets/stylesheets/crowdai_admin/_reset.scss +41 -0
  25. data/app/assets/stylesheets/crowdai_admin/components/_columns.scss +4 -0
  26. data/app/assets/stylesheets/crowdai_admin/components/_comments.scss +54 -0
  27. data/app/assets/stylesheets/crowdai_admin/components/_components.scss +13 -0
  28. data/app/assets/stylesheets/crowdai_admin/components/_date_picker.scss +38 -0
  29. data/app/assets/stylesheets/crowdai_admin/components/_dialogs.scss +23 -0
  30. data/app/assets/stylesheets/crowdai_admin/components/_flash.scss +27 -0
  31. data/app/assets/stylesheets/crowdai_admin/components/_form.scss +65 -0
  32. data/app/assets/stylesheets/crowdai_admin/components/_iframes.scss +27 -0
  33. data/app/assets/stylesheets/crowdai_admin/components/_inputs.scss +109 -0
  34. data/app/assets/stylesheets/crowdai_admin/components/_pagination.scss +25 -0
  35. data/app/assets/stylesheets/crowdai_admin/components/_panel_contents.scss +14 -0
  36. data/app/assets/stylesheets/crowdai_admin/components/_status_tag.scss +17 -0
  37. data/app/assets/stylesheets/crowdai_admin/components/_tables.scss +65 -0
  38. data/app/assets/stylesheets/crowdai_admin/components/_tabs.scss +33 -0
  39. data/app/assets/stylesheets/crowdai_admin/layouts/_filter.scss +64 -0
  40. data/app/assets/stylesheets/crowdai_admin/layouts/_footer.scss +4 -0
  41. data/app/assets/stylesheets/crowdai_admin/layouts/_header.scss +237 -0
  42. data/app/assets/stylesheets/crowdai_admin/layouts/_main_content.scss +44 -0
  43. data/app/assets/stylesheets/crowdai_admin/layouts/_sidebar.scss +104 -0
  44. data/app/assets/stylesheets/crowdai_admin/layouts/_wrapper.scss +8 -0
  45. data/app/assets/stylesheets/crowdai_admin/mixins/_buttons_mixins.scss +120 -0
  46. data/app/assets/stylesheets/crowdai_admin/mixins/_mixins.scss +3 -0
  47. data/app/assets/stylesheets/crowdai_admin/mixins/_prefix_mixins.scss +63 -0
  48. data/app/assets/stylesheets/crowdai_admin/mixins/_sidebar_mixins.scss +24 -0
  49. data/app/assets/stylesheets/crowdai_admin/pages/_form.scss +116 -0
  50. data/app/assets/stylesheets/crowdai_admin/pages/_index.scss +116 -0
  51. data/app/assets/stylesheets/crowdai_admin/pages/_login.scss +65 -0
  52. data/app/assets/stylesheets/crowdai_admin/pages/_show.scss +3 -0
  53. data/app/assets/stylesheets/crowdai_admin/variables/_colors.scss +49 -0
  54. data/app/assets/stylesheets/crowdai_admin/variables/_media_queries.scss +10 -0
  55. data/app/assets/stylesheets/crowdai_admin/variables/_size.scss +9 -0
  56. data/app/assets/stylesheets/crowdai_admin/variables/_variables.scss +5 -0
  57. data/lib/crowdai_admin/custom_builder.rb +65 -0
  58. data/lib/crowdai_admin/toggle_booleans.rb +41 -0
  59. data/lib/crowdai_admin/version.rb +3 -0
  60. data/lib/crowdai_admin.rb +11 -0
  61. metadata +178 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 67aa59bb426d321d0de025ba6f9c5603a56719f524ed6204166aba6ebca096b9
4
+ data.tar.gz: 8b182ff5ad88b2c870a428673be0803c302ab64e062f4261184ed39a05e59b02
5
+ SHA512:
6
+ metadata.gz: d0b906acc23f78b7b3e8d6d134ab9615b83f55184077e57ff583491796d72b837920a70515618da9bf56266e9d4c47c48eaed10eb9e5557bf931f80d84f38c55
7
+ data.tar.gz: cc7bee6ecfbbe6f24a3a13e0b258c7b1943e27c4fe40e213368c4514cfd03eca0293e1c9b180ed5da4cc1e62882c0d7e9ec6c3c1e2df515e0c34b5c3c2c9ac69
data/LICENCE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2018 crowdAI
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Readme.md ADDED
@@ -0,0 +1,84 @@
1
+ # crowdAI Admin
2
+ [![Gem Version](https://img.shields.io/gem/v/crowdai_admin.svg)](https://rubygems.org/gems/crowdai_admin)
3
+ [![Gem Downloads](https://img.shields.io/gem/dt/crowdai_admin.svg)](https://rubygems.org/gems/crowdai_admin)
4
+ [![Dependency Status](https://gemnasium.com/badges/github.com/cle61/crowdai_admin.svg)](https://gemnasium.com/github.com/cle61/crowdai_admin)
5
+
6
+ ### Credits
7
+
8
+ Simple theme for ActiveAdmin for [crowdAI](https://www.crowdai.org), developed by [Sean F. Carroll](https://github.com/seanfcarroll).
9
+
10
+ Inspiration and code was taken from the following projects
11
+
12
+ * [ArcticAdmin](https://github.com/cle61/crowdai_admin)
13
+ * [ActiveAdmin Addons](https://github.com/platanus/activeadmin_addons)
14
+ * [ActiveAdmin SimpleForm](https://github.com/blocknotes/activeadmin_simple_form)
15
+
16
+ ### Features
17
+
18
+ #### General
19
+
20
+ * Updated styling based on [crowdAI](https://www.crowdai.org/) and easily themed
21
+
22
+
23
+ #### Gems
24
+
25
+ * [activeadmin_simple_form](https://github.com/blocknotes/activeadmin_simple_form)
26
+ * [activeadmin_select_many](https://github.com/blocknotes/activeadmin_select_many)
27
+
28
+
29
+ ![Dashboard](doc/dashboard.png)
30
+ ![Index](doc/articles.png)
31
+
32
+
33
+ ## Installation
34
+
35
+ - Add this to your Gemfile:
36
+
37
+ ```ruby
38
+ gem 'crowdai_admin'
39
+ ```
40
+
41
+ - Run `bundle install`.
42
+
43
+ - Add this line to the file `config/initializers/active_admin.rb`
44
+
45
+ ```ruby
46
+ meta_tags_options = { viewport: 'width=device-width, initial-scale=1' }
47
+ config.meta_tags = meta_tags_options
48
+ config.meta_tags_for_logged_out_pages = meta_tags_options
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ ### CSS
54
+
55
+ Remove the `active_admin.css`, and instead add this to your `application.scss`
56
+
57
+ In your `active_admin.css`, include the css file:
58
+
59
+ ```css
60
+ @import "crowdai_admin/base";
61
+ ```
62
+
63
+ **Remove the line `*= require active_admin/base`**
64
+
65
+ Then restart your webserver if it was previously running.s
66
+
67
+ ### JS
68
+
69
+ In your `active_admin.js`, include the js file:
70
+
71
+ ```js
72
+ //= require crowdai_admin/base
73
+ ```
74
+
75
+ **Remove the line `//= require active_admin/base`**
76
+
77
+
78
+ ## Contributing
79
+
80
+ 1. Fork it ( https://github.com/crowdAI/crowdai_admin/fork )
81
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
82
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
83
+ 4. Push to the branch (`git push origin my-new-feature`)
84
+ 5. Create new Pull Request
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,79 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+ //= require active_admin/base
4
+
5
+ $(function() {
6
+ $(document).on('click', '#sidebar', function(e) {
7
+ var position = $(this).position();
8
+ var width = $(this).width();
9
+ if (e.pageX < position.left) {
10
+ if ($(this).css('right') == '0px') {
11
+ $(this).css('position', 'fixed');
12
+ $(this).animate({
13
+ right: "-="+width
14
+ }, 600, function() {
15
+ $(this).removeAttr('style');
16
+ animationFilterDone = true;
17
+ });
18
+ } else {
19
+ $(this).animate({
20
+ right: "+="+width
21
+ }, 600, function() {
22
+ $(this).css('position', 'absolute');
23
+ animationFilterDone = true;
24
+ });
25
+ }
26
+ }
27
+ });
28
+
29
+ var animationDone = true;
30
+ $(document).on('click', '#utility_nav', function(e) {
31
+ var position = $(this).position();
32
+ var tabs = $('#tabs');
33
+ var width = Math.round(tabs[0].getBoundingClientRect().width);
34
+
35
+ if (e.pageX < (position.left + 40)) {
36
+ if(animationDone == true) {
37
+ animationDone = false;
38
+ if (tabs.css('left') == '0px') {
39
+ tabs.animate({
40
+ left: "-="+width
41
+ }, 400, function() {
42
+ animationDone = true;
43
+ });
44
+ } else {
45
+ tabs.animate({
46
+ left: "+="+width
47
+ }, 400, function() {
48
+ animationDone = true;
49
+ });
50
+ }
51
+ }
52
+ }
53
+ });
54
+
55
+ $(document).on('click', 'body', function(e) {
56
+ var tabs = $('#tabs');
57
+ var width = Math.round(tabs[0].getBoundingClientRect().width);
58
+ if (tabs.css('left') == '0px') {
59
+ if (e.pageX > width && e.pageY > 60) {
60
+ if(animationDone == true) {
61
+ animationDone = false;
62
+ tabs.animate({
63
+ left: "-="+width
64
+ }, 400, function() {
65
+ animationDone = true;
66
+ });
67
+ }
68
+ }
69
+ }
70
+ });
71
+
72
+ $(document).on('click', '#tabs .has_nested', function(e) {
73
+ if ($(this).hasClass('open') == true) {
74
+ $(this).removeClass('open');
75
+ } else {
76
+ $(this).addClass('open');
77
+ }
78
+ });
79
+ });
@@ -0,0 +1,42 @@
1
+ @import "font-awesome";
2
+
3
+ @import "reset";
4
+ @import "variables/variables";
5
+
6
+ @import "mixins/mixins";
7
+
8
+ @import "common";
9
+ @import "grid";
10
+
11
+ @import "components/components";
12
+
13
+ @import "layouts/wrapper";
14
+ @import "layouts/header";
15
+ @import "layouts/sidebar";
16
+ @import "layouts/main_content";
17
+ @import "layouts/filter";
18
+ @import "layouts/footer";
19
+
20
+ @import "pages/login";
21
+ @import "pages/index";
22
+ @import "pages/show";
23
+ @import "pages/form";
24
+
25
+ body {
26
+ background: $body-background;
27
+ min-height: 100%;
28
+ position: relative;
29
+ color: rgba(0,0,0,0.87);
30
+ font-family: 'Roboto', sans-serif;
31
+ font-size: 15px;
32
+ font-weight: 400;
33
+ -moz-osx-font-smoothing: grayscale;
34
+ -webkit-font-smoothing: antialiased !important;
35
+ -moz-font-smoothing: antialiased !important;
36
+ text-rendering: optimizelegibility !important;
37
+ }
38
+
39
+ a {
40
+ color: $primary-color;
41
+ text-decoration: none;
42
+ }
@@ -0,0 +1,27 @@
1
+ .button {
2
+ @include primary-button($primary-color, #fff);
3
+ padding: 5px 8px;
4
+ font-size: 16px;
5
+
6
+ &.small {
7
+ padding: 2px 9px;
8
+ font-size: 12px;
9
+ }
10
+
11
+ &.large {
12
+ padding: 10px;
13
+ font-size: 18px;
14
+ }
15
+
16
+ &.action {
17
+ margin-right: 4px;
18
+ }
19
+ }
20
+
21
+ code {
22
+ display: block;
23
+ background-color: #272822;
24
+ padding: 5px;
25
+ margin: 10px 0;
26
+ color: white;
27
+ }
@@ -0,0 +1,4 @@
1
+ .columns {
2
+ display: flex;
3
+ flex-wrap:wrap;
4
+ }
@@ -0,0 +1,41 @@
1
+ *, *:after, *:before {
2
+ -webkit-box-sizing: border-box;
3
+ -moz-box-sizing: border-box;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ html {
8
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
9
+ }
10
+
11
+ html, body {
12
+ padding: 0;
13
+ margin: 0;
14
+ min-height: 100vh;
15
+ }
16
+
17
+ fieldset {
18
+ border: none;
19
+ margin: 0;
20
+ padding: 0;
21
+ }
22
+
23
+ legend {
24
+ padding: 0;
25
+ }
26
+
27
+ ol, ul {
28
+ margin: 0;
29
+ padding: 0;
30
+ list-style: none;
31
+ }
32
+
33
+ th {
34
+ font-weight: normal;
35
+ }
36
+
37
+ abbr[title] {
38
+ border-bottom: none;
39
+ cursor: inherit;
40
+ text-decoration: none;
41
+ }
@@ -0,0 +1,4 @@
1
+ .columns {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ }
@@ -0,0 +1,54 @@
1
+ .comments {
2
+ background-color: $sidebar-background;
3
+ padding: 10px 15px 15px 15px;
4
+ border-radius: $border-radius;
5
+ margin-top: 20px;
6
+ @include clear-fix();
7
+
8
+ h3 {
9
+ margin: 0 0 5px 0;
10
+ }
11
+
12
+ .active_admin_comment {
13
+ margin: 10px 0 0 0;
14
+ padding: 5px 0 0 0;
15
+ position: relative;
16
+
17
+ .active_admin_comment_meta {
18
+ .active_admin_comment_author {
19
+ margin: 0;
20
+ display: inline-block;
21
+ }
22
+
23
+ span { // date
24
+ float: right;
25
+ font-size: 14px;
26
+ font-style: italic;
27
+ margin-right: 30px;
28
+ line-height: 21px;
29
+ }
30
+
31
+ a[data-method="delete"] {
32
+ position: absolute;
33
+ top: 0;
34
+ right: 0;
35
+ visibility: hidden;
36
+
37
+ &:after {
38
+ @include icon("\f1f8");
39
+ visibility: visible;
40
+ color: #5a5a5a;
41
+ font-size: 16px;
42
+ padding: 6px;
43
+ display: inline-block;
44
+ }
45
+ }
46
+ }
47
+
48
+ .active_admin_comment_body {
49
+ p {
50
+ margin: 5px 0 0;
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,13 @@
1
+ @import "inputs";
2
+ @import "flash";
3
+ @import "tables";
4
+ @import "date_picker";
5
+ @import "status_tag";
6
+ @import "panel_contents";
7
+ @import "form";
8
+ @import "pagination";
9
+ @import "dialogs";
10
+ @import "comments";
11
+ @import "tabs";
12
+ @import "columns";
13
+ @import "iframes";
@@ -0,0 +1,38 @@
1
+ #ui-datepicker-div {
2
+ background-color: #fff;
3
+ padding: 5px;
4
+ border-radius: $border-radius;
5
+ @include box-shadow(0 0 4px 0 rgba(0,0,0,.1));
6
+ z-index: 3!important;
7
+ padding: 8px 10px;
8
+
9
+ .ui-datepicker-header {
10
+ @include clear-fix();
11
+ margin-bottom: 10px;
12
+
13
+ .ui-datepicker-prev, .ui-datepicker-next {
14
+ @include primary-button($primary-color, #fff);
15
+ padding: 2px 5px;
16
+ font-size: 14px;
17
+ }
18
+
19
+ .ui-datepicker-prev {
20
+ float: left;
21
+ }
22
+
23
+ .ui-datepicker-next {
24
+ float: right;
25
+ }
26
+
27
+ .ui-datepicker-title {
28
+ text-align: center;
29
+ }
30
+ }
31
+
32
+ .ui-datepicker-calendar {
33
+ td {
34
+ border: none;
35
+ text-align: center;
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,23 @@
1
+ .ui-dialog {
2
+ background-color: #fff;
3
+ @include box-shadow($box-shadow);
4
+ border-radius: $border-radius;
5
+ padding: 15px 10px;
6
+ z-index: 1;
7
+
8
+ &:focus, &:active {
9
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
10
+ outline: 0;
11
+ }
12
+
13
+ .ui-button {
14
+ @include primary-button($primary-color, #fff);
15
+ border: 0;
16
+ margin-right: 5px;
17
+ padding: 5px 10px;
18
+ }
19
+
20
+ .ui-dialog-titlebar-close {
21
+ display: none;
22
+ }
23
+ }
@@ -0,0 +1,27 @@
1
+ .flash {
2
+ width: 100%;
3
+ padding: 10px;
4
+ text-align: center;
5
+ background-color: $flash-background-color;
6
+ color: $flash-text-color;
7
+ }
8
+
9
+ .flash_alert, .flash_error {
10
+ background-color: $error;
11
+ color: $flash-text-color;
12
+ }
13
+
14
+ .flash_warning {
15
+ background-color: $warning;
16
+ color: $flash-text-color;
17
+ }
18
+
19
+ .flash_notice {
20
+ background-color: $success;
21
+ color: $flash-text-color;
22
+ }
23
+
24
+ .flash_info {
25
+ background-color: $info;
26
+ color: $flash-text-color;
27
+ }
@@ -0,0 +1,65 @@
1
+ .label {
2
+ display: inline-block;
3
+ margin-bottom: 5px;
4
+ }
5
+
6
+ .input {
7
+ margin-bottom: 20px;
8
+ }
9
+
10
+ #active_admin_content {
11
+ .formtastic {
12
+ li {
13
+ list-style: none;
14
+ }
15
+
16
+ legend:not(.label) {
17
+ margin-bottom: 28px;
18
+ font-size: 18px;
19
+ display: block;
20
+ width: 100%;
21
+ padding-bottom: 12px;
22
+ border-bottom: 1px solid $body-background;
23
+ }
24
+
25
+ .error {
26
+ input, select {
27
+ border-color: $error;
28
+ }
29
+ }
30
+
31
+ input, select {
32
+ &.error {
33
+ border-color: $error;
34
+ }
35
+ }
36
+
37
+ .inline-errors, label.error {
38
+ color: $error;
39
+ margin-top: 5px;
40
+ margin-bottom: 20px;
41
+ font-size: 14px;
42
+ }
43
+
44
+ label.error {
45
+ display: block;
46
+ margin-left: 25%;
47
+ }
48
+
49
+ .actions {
50
+
51
+ .action {
52
+ display: inline-block;
53
+ margin-right: 10px;
54
+
55
+ input[type="submit"] {
56
+ line-height: 43px;
57
+ }
58
+ }
59
+
60
+ .cancel {
61
+ display: inline-block;
62
+ }
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,27 @@
1
+
2
+ // iframes
3
+ // https://benmarshall.me/responsive-iframes/
4
+
5
+ .intrinsic-container {
6
+ position: relative;
7
+ height: 0;
8
+ overflow: hidden;
9
+ }
10
+
11
+ /* 16x9 Aspect Ratio */
12
+ .intrinsic-container-16x9 {
13
+ padding-bottom: 56.25%;
14
+ }
15
+
16
+ /* 4x3 Aspect Ratio */
17
+ .intrinsic-container-4x3 {
18
+ padding-bottom: 75%;
19
+ }
20
+
21
+ .intrinsic-container iframe {
22
+ position: absolute;
23
+ top:0;
24
+ left: 0;
25
+ width: 100%;
26
+ height: 100%;
27
+ }