redde 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.travis.yml +10 -0
  4. data/Gemfile +3 -3
  5. data/LICIENSE.md +21 -0
  6. data/README.md +53 -14
  7. data/lib/generators/redde/layout/layout_generator.rb +7 -4
  8. data/lib/generators/redde/layout/templates/assets/images/admin/error-label-triangle.png +0 -0
  9. data/lib/generators/redde/layout/templates/assets/images/admin/favicon.png +0 -0
  10. data/lib/generators/redde/layout/templates/assets/javascripts/admin.js +9 -76
  11. data/lib/generators/redde/layout/templates/assets/redactor/images/.keep +0 -0
  12. data/lib/generators/redde/layout/templates/assets/redactor/images/redactor/icons.png +0 -0
  13. data/lib/generators/redde/layout/templates/assets/redactor/javascripts/jquery-migrate-1.2.1.js +521 -0
  14. data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/redactor.js.erb +9 -21
  15. data/lib/generators/redde/layout/templates/assets/{images/admin/redactor/css/redactor.css → redactor/stylesheets/redactor/redactor.css.scss} +1 -1
  16. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/error-msg.sass +47 -0
  17. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/paginate.sass +28 -0
  18. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/pagination.scss +28 -0
  19. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/phead-tabs.sass +27 -0
  20. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/default.scss +0 -0
  21. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/input.sass +35 -0
  22. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/header.sass +50 -0
  23. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/launchbar.sass +23 -0
  24. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/main.sass +39 -0
  25. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/page-header.sass +19 -0
  26. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/page-sidebar.sass +22 -0
  27. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/sidebar.sass +30 -0
  28. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/reset.sass +33 -0
  29. data/lib/generators/redde/layout/templates/assets/stylesheets/admin.scss +9 -9
  30. data/lib/generators/redde/layout/templates/base/_header.html.haml +12 -0
  31. data/lib/generators/redde/layout/templates/base/_launchbar.html.haml +11 -0
  32. data/lib/generators/redde/layout/templates/base/_sidebar.html.haml +15 -0
  33. data/lib/generators/redde/layout/templates/base/_validate.haml +8 -0
  34. data/lib/generators/redde/layout/templates/base/welcome.haml +2 -0
  35. data/lib/generators/redde/layout/templates/controllers/base_controller.rb +5 -0
  36. data/lib/generators/redde/layout/templates/layouts/admin.html.haml +14 -15
  37. data/lib/generators/redde/scaffold/scaffold_generator.rb +8 -0
  38. data/lib/generators/redde/scaffold/templates/edit.html.haml +2 -6
  39. data/lib/generators/redde/scaffold/templates/index.html.haml +1 -1
  40. data/lib/redde/version.rb +1 -1
  41. data/lib/redde.rb +3 -0
  42. data/redde.gemspec +11 -10
  43. data/spec/dummy/.rspec +1 -0
  44. data/spec/dummy/README.rdoc +28 -0
  45. data/spec/dummy/Rakefile +6 -0
  46. data/spec/dummy/app/assets/images/.keep +0 -0
  47. data/spec/dummy/app/assets/javascripts/application.js +14 -0
  48. data/spec/dummy/app/assets/stylesheets/application.css.scss +0 -0
  49. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  50. data/spec/dummy/app/controllers/articles_controller.rb +12 -0
  51. data/spec/dummy/app/models/.keep +0 -0
  52. data/spec/dummy/app/models/article.rb +3 -0
  53. data/spec/dummy/app/models/article_category.rb +2 -0
  54. data/spec/dummy/app/views/articles/show.html.haml +2 -0
  55. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  56. data/spec/dummy/bin/bundle +3 -0
  57. data/spec/dummy/bin/rails +4 -0
  58. data/spec/dummy/bin/rake +4 -0
  59. data/spec/dummy/config/application.rb +33 -0
  60. data/spec/dummy/config/boot.rb +5 -0
  61. data/spec/dummy/config/database.yml +25 -0
  62. data/spec/dummy/config/environment.rb +5 -0
  63. data/spec/dummy/config/environments/development.rb +29 -0
  64. data/spec/dummy/config/environments/production.rb +80 -0
  65. data/spec/dummy/config/environments/test.rb +36 -0
  66. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  67. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  68. data/spec/dummy/config/initializers/inflections.rb +16 -0
  69. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  70. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  71. data/spec/dummy/config/initializers/session_store.rb +3 -0
  72. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  73. data/spec/dummy/config/locales/en.yml +36 -0
  74. data/spec/dummy/config/routes.rb +3 -0
  75. data/spec/dummy/config.ru +4 -0
  76. data/spec/dummy/db/development.sqlite3 +0 -0
  77. data/spec/dummy/db/migrate/20130908123351_create_articles.rb +9 -0
  78. data/spec/dummy/db/migrate/20140128152208_create_article_categories.rb +11 -0
  79. data/spec/dummy/db/schema.rb +29 -0
  80. data/spec/dummy/db/test.sqlite3 +0 -0
  81. data/spec/dummy/lib/assets/.keep +0 -0
  82. data/spec/dummy/log/.keep +0 -0
  83. data/spec/dummy/log/development.log +26606 -0
  84. data/spec/dummy/log/test.log +53411 -0
  85. data/spec/dummy/public/404.html +58 -0
  86. data/spec/dummy/public/422.html +58 -0
  87. data/spec/dummy/public/500.html +57 -0
  88. data/spec/dummy/public/favicon.ico +0 -0
  89. data/spec/{deploy_generator_spec.rb → generators/deploy_generator_spec.rb} +1 -1
  90. data/spec/{layout_generator_spec.rb → generators/layout_generator_spec.rb} +5 -5
  91. data/spec/generators/scaffold_generator_spec.rb +59 -0
  92. data/spec/spec_helper.rb +53 -4
  93. metadata +187 -155
  94. data/LICENSE +0 -22
  95. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/docstyle.css +0 -123
  96. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/css/style.css +0 -119
  97. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/img/icons.png +0 -0
  98. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/by.js +0 -72
  99. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/de.js +0 -75
  100. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/es.js +0 -76
  101. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/fr.js +0 -74
  102. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/hu.js +0 -76
  103. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/it.js +0 -76
  104. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ja.js +0 -76
  105. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/lv.js +0 -74
  106. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/nl.js +0 -76
  107. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pl.js +0 -75
  108. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/pt_br.js +0 -81
  109. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/sq.js +0 -76
  110. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/tr.js +0 -76
  111. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/ua.js +0 -75
  112. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/langs/zh_cn.js +0 -77
  113. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/redactor.min.js +0 -1
  114. data/lib/generators/redde/layout/templates/assets/images/admin/redactor/toolbars/mini.js +0 -103
  115. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/_jquery.reddebox.js.erb +0 -214
  116. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/close.png +0 -0
  117. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.js.erb +0 -246
  118. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/jquery.reddebox.scss +0 -31
  119. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/next.png +0 -0
  120. data/lib/generators/redde/layout/templates/assets/images/admin/reddebox/prev.png +0 -0
  121. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/change-log.txt +0 -19
  122. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/check-exists.php +0 -15
  123. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/index.php +0 -50
  124. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.js +0 -888
  125. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/jquery.uploadifive.min.js +0 -6
  126. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/license-standard.txt +0 -71
  127. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-cancel.png +0 -0
  128. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive-image-only.php +0 -66
  129. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.css +0 -100
  130. data/lib/generators/redde/layout/templates/assets/images/admin/uploadifive/uploadifive.php +0 -33
  131. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/#swfobject.js +0 -4
  132. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/cancel.png +0 -0
  133. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/jquery.uploadify.min.js +0 -315
  134. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify-cancel.png +0 -0
  135. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.css +0 -66
  136. data/lib/generators/redde/layout/templates/assets/images/admin/uploadify/uploadify.swf +0 -0
  137. data/lib/generators/redde/layout/templates/assets/javascripts/admin/swfobject.js +0 -4
  138. data/lib/generators/redde/layout/templates/assets/javascripts/admin/zen_textarea.min.js +0 -17
  139. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/_reset.scss +0 -32
  140. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/_input.scss +0 -43
  141. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_header.scss +0 -57
  142. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_launchbar.scss +0 -35
  143. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_main.scss +0 -59
  144. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/_sidebar.scss +0 -35
  145. data/lib/generators/redde/layout/templates/shared/_header.html.haml +0 -13
  146. data/lib/generators/redde/layout/templates/shared/_launchbar.html.haml +0 -9
  147. data/lib/generators/redde/layout/templates/shared/_sidebar.html.haml +0 -9
  148. data/spec/scaffold_generator_spec.rb +0 -25
  149. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/file.html +0 -0
  150. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/image.html +0 -0
  151. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/image_edit.html +0 -0
  152. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/link.html +0 -0
  153. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/table.html +0 -0
  154. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/images}/redactor/plugins/video.html +0 -0
  155. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/langs/en.js +0 -0
  156. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/langs/ru.js +0 -0
  157. /data/lib/generators/redde/layout/templates/assets/{images/admin → redactor/javascripts}/redactor/toolbars/default.js +0 -0
  158. /data/lib/generators/redde/layout/templates/assets/{images/admin/redactor/css → redactor/stylesheets/redactor}/wym.css +0 -0
  159. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_list.scss → list.scss} +0 -0
  160. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_notice.scss → notice.scss} +0 -0
  161. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_orders.scss → orders.scss} +0 -0
  162. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_partners.scss → partners.scss} +0 -0
  163. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_photos.scss → photos.scss} +0 -0
  164. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/{_sortable.scss → sortable.scss} +0 -0
  165. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/{_table.scss → table.scss} +0 -0
  166. /data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/{_login.scss → login.scss} +0 -0
@@ -0,0 +1,28 @@
1
+ .pagination {
2
+ margin: 20px 0 0;
3
+ .page, .last, .next, .prev, .first {
4
+ &.current, a {
5
+ display: inline-block;
6
+ text-align: center;
7
+ color: #005782;
8
+ color: #666;
9
+ min-width: 14px;
10
+ padding: 0 5px;
11
+ line-height: 24px;
12
+ background:linear-gradient(to bottom, #fff, #dedede);
13
+ border: 1px solid #bbb;
14
+ box-shadow: 0 1px 2px #ccc;
15
+ border-radius: 4px;
16
+ font-weight: bold;
17
+ text-decoration: none;
18
+ }
19
+ a:active {
20
+ box-shadow: inset 0 1px 2px #333;
21
+ background:linear-gradient(to top, #fff, #dedede);
22
+ }
23
+ &.current {
24
+ color: #fff;
25
+ background:linear-gradient(to bottom, #A9DCF5, #257DA8);
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,27 @@
1
+ .phead-tabs
2
+ display: block
3
+ clear: both
4
+ font-size: 12px
5
+ padding-top: 15px
6
+ margin-bottom: -16px
7
+
8
+ .phead-tabs__link
9
+ padding: 0.5em (5em/6)
10
+ display: inline-block
11
+ border: 1px solid transparent
12
+ border-radius: 3px 3px 0 0
13
+ margin-left: -1px
14
+ &:link
15
+ text-decoration: underline // по дефолту прописано a:hover, в дальнейшем убрать
16
+ &:first-child
17
+ margin-left: -(5em/6)
18
+ &:hover
19
+ background: #ddd
20
+ background-clip: padding-box
21
+ &._active
22
+ text-decoration: none
23
+ color: #000
24
+ font-weight: bold
25
+ background: #fff
26
+ border-color: #ddd
27
+ border-bottom-color: #fff
@@ -0,0 +1,35 @@
1
+ input[type=submit]
2
+ cursor: pointer
3
+ padding: 3px 17px
4
+ font-family: Helvetica, Arial, sans-serif
5
+ font-weight: bold
6
+ color: #444
7
+ background: image-url("admin/submit.png") repeat-x 0 50%
8
+ background: linear-gradient(to bottom, #f2f2f2 0%, #ebebeb 50%, #dddddd 51%, #cfcfcf 100%)
9
+ border: 1px solid #707070
10
+ border-radius: 2px
11
+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.85)
12
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 1px 1px 0 #fff inset, -1px -1px 0 #fff inset
13
+
14
+ &[value=Сохранить],
15
+ &[value=Применить]
16
+ padding-left: 37px
17
+ &[value=Сохранить]
18
+ background: image-url("admin/arrow_enter.png") 4px -102px no-repeat, linear-gradient(to bottom, #f2f2f2 0%, #ebebeb 50%, #dddddd 51%, #cfcfcf 100%) 0 0
19
+ &:hover
20
+ background: image-url("admin/arrow_enter.png") 4px -1px no-repeat, linear-gradient(to bottom, #eaf6fd 0%, #d9f0fc 50%, #bee6fd 51%, #a7d9f5 100%) 0 0
21
+ &[value=Применить]
22
+ background: image-url("admin/arrow_down.png") 4px -102px no-repeat, linear-gradient(to bottom, #f2f2f2 0%, #ebebeb 50%, #dddddd 51%, #cfcfcf 100%) 0 0
23
+ &:hover
24
+ background: image-url("admin/arrow_down.png") 4px -1px no-repeat, linear-gradient(to bottom, #eaf6fd 0%, #d9f0fc 50%, #bee6fd 51%, #a7d9f5 100%) 0 0
25
+ &[value=Далее]
26
+ padding-right: 37px
27
+ background: image-url("admin/arrow_right.png") right -100px no-repeat, linear-gradient(to bottom, #f2f2f2 0%, #ebebeb 50%, #dddddd 51%, #cfcfcf 100%) 0 0
28
+ &:hover
29
+ background: image-url("admin/arrow_right.png") right 2px no-repeat, linear-gradient(to bottom, #eaf6fd 0%, #d9f0fc 50%, #bee6fd 51%, #a7d9f5 100%) 0 0
30
+ &:hover
31
+ background-image:image-url("admin/submit_hover.png")
32
+ background: linear-gradient(to bottom, #eaf6fd 0%, #d9f0fc 50%, #bee6fd 51%, #a7d9f5 100%)
33
+ border-color: #3c7fb1
34
+ box-shadow: 0 1px 6px rgb(44, 146, 193)
35
+ color: #025984
@@ -0,0 +1,50 @@
1
+ .header
2
+ padding: 0 30px
3
+ color: #fff
4
+ line-height: 23px
5
+ text-decoration: none
6
+ margin-bottom: 20px
7
+ box-shadow: #666 0 0 3px
8
+ background-color: #005782
9
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#1A719C', endColorstr='#005782')
10
+ background: linear-gradient(to bottom, #1A719C 0%, #005782 100%)
11
+
12
+ .header__init
13
+ box-sizing: border-box
14
+ max-width: 1200px
15
+ min-width: 580px
16
+ padding: 6px 0 6px (185px + 31px)
17
+ margin: 0 auto
18
+ overflow: hidden
19
+ position: relative
20
+
21
+ .header__logo
22
+ position: absolute
23
+ width: 123px
24
+ height: 31px
25
+ left: 0
26
+ top: 0
27
+ bottom: 0
28
+ margin: auto
29
+ overflow: hidden
30
+ background: image-url('admin/logo.png') no-repeat 0 0
31
+ text-indent: -9999px
32
+ display: block
33
+
34
+ .header__center
35
+ overflow: hidden
36
+ float: left
37
+ font-size: (14em/12)
38
+ a
39
+ color: #fff
40
+
41
+ .header__links
42
+ float: right
43
+ margin-right: 1px
44
+ a
45
+ margin-left: (8em/12)
46
+ color: #fff
47
+ font-size: (10em/12)
48
+ text-decoration: none
49
+ line-height: 46px
50
+
@@ -0,0 +1,23 @@
1
+ .launchbar
2
+ background: #000
3
+ overflow: hidden
4
+ font-size: (14em/12)
5
+
6
+ .launchbar__menu
7
+ padding: 0 25px
8
+
9
+ .launchbar__link
10
+ float: left
11
+ margin-right: 4px
12
+ padding: 5px 7px 6px 4px
13
+ color: #999
14
+ border-right: 1px solid #222
15
+ text-decoration: none
16
+ &._active
17
+ color: #ddd
18
+ font-weight: bold
19
+
20
+ .launchbar__time
21
+ float: right
22
+ color: #fff
23
+ padding: 5px 4px 6px
@@ -0,0 +1,39 @@
1
+ .main
2
+ box-shadow: 0 0 3px #ccc
3
+ border-radius: 6px
4
+ border: 1px solid #D7D7D7
5
+ min-height: 500px
6
+ background-color: #fff
7
+ padding: 0
8
+ border-bottom: 1px solid #DADEE5
9
+ margin: 0
10
+
11
+ .wrapper
12
+ box-sizing: border-box
13
+ padding: 0 30px 30px 215px
14
+ max-width: 1260px
15
+ min-width: 800px
16
+ margin: 0 auto
17
+ &:after
18
+ content: ''
19
+ display: table
20
+ clear: both
21
+
22
+ .sidebar
23
+ margin-left: -215px
24
+
25
+ .main
26
+ margin-left: -185px
27
+ .sidebar + &
28
+ float: left
29
+ width: 100%
30
+ margin-left: 0
31
+
32
+ .content
33
+ padding: 30px
34
+
35
+ // .sidebar .content
36
+ // margin-right: 305px
37
+
38
+ // .sidebar .page-sidebar
39
+ // float: right
@@ -0,0 +1,19 @@
1
+ .page-header
2
+ overflow: hidden
3
+ background: #F1F5F9
4
+ border-bottom: 1px solid #DADEE5
5
+ padding: 15px 30px
6
+ margin: 0
7
+ border-top-right-radius: 5px
8
+ border-top-left-radius: 5px
9
+ h1
10
+ font-size: 16px
11
+ float: left
12
+ font-weight: normal
13
+ p
14
+ margin: 0
15
+ font-size: 11px
16
+ float: right
17
+ line-height: 1.8em
18
+ a
19
+ color: #0047B3
@@ -0,0 +1,22 @@
1
+ .page-sidebar
2
+ float: right
3
+ margin: 0 30px 0 0
4
+ padding: 30px 0 0 30px
5
+ width: 245px
6
+ border-left: 1px solid #efefef
7
+ ul.photos
8
+ list-style-type: none
9
+ li
10
+ display: inline
11
+
12
+ h5
13
+ line-height: 1.0em
14
+ padding: 0 0 3px 0
15
+ font-size: 12px
16
+ text-transform: none
17
+ border-bottom: 1px solid #efefef
18
+ color: #222
19
+ font-weight: bold
20
+
21
+ p
22
+ font-size: 12px
@@ -0,0 +1,30 @@
1
+ .sidebar
2
+ width: 215px
3
+ float: left
4
+ margin-top: 12px
5
+
6
+ .sidebar__badge
7
+ font-size: 10px
8
+ color: #999
9
+ &:before
10
+ content: '('
11
+ color: #000
12
+ &:after
13
+ content: ')'
14
+ color: #000
15
+
16
+ .sidebar__link
17
+ display: block
18
+ overflow: hidden
19
+ padding: 6px 6px 6px 36px
20
+ margin-left: -6px
21
+ text-decoration: none
22
+ font-size: 13px
23
+ line-height: (16em/13)
24
+ color: #555
25
+ text-shadow: 0px 1px 1px #fff
26
+ &._active
27
+ font-weight: bold
28
+ color: #000
29
+ background-color: #e5e3de
30
+ border-radius: 4px 0 0 4px
@@ -0,0 +1,33 @@
1
+ *
2
+ margin: 0
3
+ padding: 0
4
+
5
+ th
6
+ text-align: left
7
+
8
+ a
9
+ color: #0047B3
10
+ &:hover
11
+ text-decoration:none
12
+
13
+ html,
14
+ body
15
+ width: 100%
16
+ height: 100%
17
+
18
+ body
19
+ min-width: 1000px
20
+ overflow-y: scroll
21
+ background-color: #F3F1EC
22
+ text-align: left
23
+ font: 12px "Lucida Grande", "Lucida Sans Unicode", helvetica, arial, verdana, sans-serif
24
+
25
+ label
26
+ font-size: 14px
27
+ font-weight: bold
28
+ textarea
29
+ width: 100%
30
+ min-width: 275px
31
+ font-size: 12px
32
+ input
33
+ font-size: 18px
@@ -1,12 +1,12 @@
1
+ //= require_self
2
+ //= require admin/reset
3
+ //= require admin/default
4
+ //= require_tree ./admin/defaults/
5
+ //= require_tree ./admin/layouts/
6
+ //= require_tree ./admin/blocks/
7
+ //= require redactor/redactor
8
+
1
9
  @charset "UTF-8";
2
10
 
3
- @import
4
- "compass",
5
- "admin/reset",
6
- "admin/default",
7
- "admin/layouts/*",
8
- "admin/blocks/*",
9
- "admin/redactor/css/redactor",
10
- "admin/uploadify/uploadify",
11
- "admin/uploadifive/uploadifive",
11
+ @import
12
12
  "admin/lightbox/css/jquery.lightbox-0.5";
@@ -0,0 +1,12 @@
1
+ %header.header
2
+ .header__init
3
+ = link_to admin_root_path || "/admin", class: 'header__logo' do
4
+ ReddeCMS
5
+ %br
6
+ %span custom system
7
+ .header__links
8
+ - if current_manager
9
+ = mail_to current_manager.email
10
+ = link_to "Выход", destroy_manager_session_path, :method => :delete
11
+ .header__center
12
+ = link_to "AppName", root_path, :target => :_blank
@@ -0,0 +1,11 @@
1
+ - case controller_name
2
+ - when 'products' then @active = :shop
3
+ - when 'articles' then @active = :materials
4
+ - when 'users' then @active = :system
5
+
6
+ .launchbar
7
+ %nav.launchbar__menu
8
+ = link_to "Материалы", nil, class: ['launchbar__link', ('_active' if @active == :shop)]
9
+ = link_to "Обратная связь", nil, class: ['launchbar__link', ('_active' if @active == :materials)]
10
+ = link_to "Система", nil, class: ['launchbar__link', ('_active' if @active == :system)]
11
+ %span.launchbar__time= Russian.strftime(Time.now,"%d %b, %Y %H:%M ")
@@ -0,0 +1,15 @@
1
+ -# add this condition to remove empty sidebar
2
+ -# if @active
3
+ %nav.sidebar
4
+ - case @active
5
+ - when :shop then
6
+ = link_to "Товары", admin_products_path, class: 'sidebar__link'
7
+ - when :materials then
8
+ = link_to "Статьи", [:admin, :articles], class: 'sidebar__link'
9
+ - when :system
10
+ = link_to "Пользователи", admin_users_path, class: 'sidebar__link'
11
+ - else
12
+ = link_to 'Демо active', nil, class: ['sidebar__link', '_active']
13
+ = link_to nil, class: ['sidebar__link'] do
14
+ Демо
15
+ %span.sidebar__badge 2
@@ -0,0 +1,8 @@
1
+ - if f.object.errors.any?
2
+ .error-msg
3
+ .error-msg__badge Ошибок #{f.object.errors.count}
4
+ %ul.error-msg__list
5
+ - f.object.errors.each do |attribute, msg|
6
+ %li
7
+ %strong= f.object.class.human_attribute_name(attribute)
8
+ = msg
@@ -0,0 +1,2 @@
1
+ = content_for :page_header do
2
+ %h1 Welcome
@@ -3,4 +3,9 @@
3
3
  class Admin::BaseController < ActionController::Base
4
4
  layout 'admin'
5
5
  before_filter :authenticate_manager!
6
+ include AdminHelper
7
+
8
+ def welcome
9
+ end
10
+
6
11
  end
@@ -1,30 +1,29 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- %html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en"}
1
+ !!!
2
+ %html{:lang => "en"}
3
3
  %head
4
- %title= @page_title || "Без Заголовка"
4
+ %meta{:charset => "UTF-8"}/
5
+ %title= @page_title || "ReddeCMS"
6
+ = favicon_link_tag 'admin/favicon.png'
5
7
  = stylesheet_link_tag "admin"
6
8
  = javascript_include_tag "admin"
7
- =# include_imperavi_stylesheet
8
- =# include_imperavi_javascript
9
9
  = yield :js
10
10
  = csrf_meta_tag
11
11
  %body
12
- =render "admin/shared/launchbar"
13
- =render "admin/shared/header"
14
- #wrapper
15
- #sidebar
16
- =render "admin/shared/sidebar"
17
- #main
18
- #page-header
12
+ = render "launchbar"
13
+ = render "header"
14
+ .wrapper
15
+ = render "sidebar"
16
+ .main
17
+ .page-header
19
18
  = yield(:page_header)
20
19
  - if notice
21
20
  .notice= notice
22
21
  - if alert
23
22
  .alert= alert
24
- #page{:class => "#{yield(:page_sidebar).empty? ? 'full' : 'sidebar'}"}
23
+ .page{:class => "#{yield(:page_sidebar).empty? ? 'full' : 'sidebar'}"}
25
24
  #filter
26
25
  = yield(:filter)
27
- #page_sidebar
26
+ .page-sidebar
28
27
  = yield(:page_sidebar)
29
- #content
28
+ .content
30
29
  = yield
@@ -50,6 +50,14 @@ module Redde
50
50
  resource_name.pluralize
51
51
  end
52
52
 
53
+ def capital_resource_name
54
+ resource_name.capitalize
55
+ end
56
+
57
+ def index_header
58
+ model_name.constantize.model_name.human(:count => 'other')
59
+ end
60
+
53
61
  def sort_priority(column_name)
54
62
  case column_name
55
63
  when "position" then 1
@@ -4,14 +4,10 @@
4
4
  Добавить #{taccusative(:<%= resource_name %>)}
5
5
  - else
6
6
  Редактировать #{taccusative(:<%= resource_name %>)}
7
+ %p= link_to "Назад", [:admin, :<%= plural_resource_name %>]
7
8
 
8
9
  = form_for [:admin, @<%= resource_name %>] do |f|
9
- - if @<%= resource_name %>.errors.any?
10
- #error_explanation
11
- %h2= "Ошибки при сохранении: #{@<%= resource_name %>.errors.count}"
12
- %ul
13
- - @<%= resource_name %>.errors.full_messages.each do |msg|
14
- %li= msg
10
+ = render 'validate', {f: f}
15
11
  %table
16
12
  <%- columns.each do |column| -%>
17
13
  <%- if column.field_type.to_s == "text_area" -%>
@@ -1,5 +1,5 @@
1
1
  - content_for(:page_header) do
2
- %h1= tplural(<%= resource_name.capitalize %>)
2
+ %h1= index_header
3
3
  %p= link_to "Добавить #{taccusative('<%= resource_name %>')}", [:new, :admin, :<%= resource_name %>]
4
4
 
5
5
  - unless @<%= plural_resource_name %>.empty?
data/lib/redde/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redde
2
- VERSION = "0.0.8"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/redde.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  require "redde/version"
2
2
  module Redde
3
+ require 'generators/redde/layout/layout_generator'
4
+ require 'generators/redde/scaffold/scaffold_generator'
5
+ require 'generators/redde/deploy/deploy_generator'
3
6
  # Your code goes here...
4
7
  end
data/redde.gemspec CHANGED
@@ -1,12 +1,12 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
2
 
3
3
  require File.expand_path('../lib/redde/version', __FILE__)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.authors = ["Oleg Bovykin"]
7
- gem.email = ["oleg.bovykin@gmail.com"]
8
- gem.description = %q{Simple admin scaffold generator}
9
- gem.summary = %q{Admin scaffold generator for redde shop engine}
6
+ gem.authors = ["Oleg Bovykin", "Konstantin Gorozhankin"]
7
+ gem.email = ["oleg.bovykin@gmail.com", "konstantin.gorozhankin@gmail.com", "info@redde.ru"]
8
+ gem.description = %q{Admin scaffold generator for redde projects}
9
+ gem.summary = %q{Admin scaffold generator for redde projects}
10
10
  gem.homepage = "http://github.com/redde/redde"
11
11
 
12
12
  gem.files = `git ls-files`.split($\)
@@ -15,14 +15,15 @@ Gem::Specification.new do |gem|
15
15
  gem.name = "redde"
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = Redde::VERSION
18
+ gem.license = "MIT"
19
+
20
+ gem.add_runtime_dependency "jquery-rails"
21
+ gem.add_runtime_dependency "jquery-ui-rails"
18
22
 
19
- gem.add_runtime_dependency 'russian', '>= 0.6.0'
20
- gem.add_runtime_dependency 'haml-rails'
21
- gem.add_runtime_dependency 'compass-rails'
22
- gem.add_development_dependency 'jquery-ui-rails'
23
- gem.add_development_dependency 'jquery-rails'
24
23
  gem.add_development_dependency 'rails', '>= 3.1'
25
24
  gem.add_development_dependency 'rspec-rails', '>= 2.7'
25
+ gem.add_development_dependency 'factory_girl_rails', '>= 2.7'
26
26
  gem.add_development_dependency 'guard-rspec'
27
+ gem.add_development_dependency "sqlite3"
27
28
  gem.add_development_dependency 'generator_spec'
28
29
  end
data/spec/dummy/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Dummy::Application.load_tasks
File without changes
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,12 @@
1
+ # coding: utf-8
2
+
3
+ class ArticlesController < ApplicationController
4
+
5
+ def index
6
+ end
7
+
8
+ def show
9
+ @article = Article.find(params[:id])
10
+ end
11
+
12
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ class Article < ActiveRecord::Base
2
+ validates :title, presence: true
3
+ end
@@ -0,0 +1,2 @@
1
+ class ArticleCategory < ActiveRecord::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ %h1= @article.title
2
+ = render @article.page
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", media: "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= yield :js %>
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>