redde 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/redde/{layouts → blocks}/header.sass +0 -1
  3. data/app/assets/stylesheets/redde/{layouts → blocks}/main-menu.sass +3 -2
  4. data/app/assets/stylesheets/redde/blocks/main.sass +22 -0
  5. data/app/assets/stylesheets/redde/{layouts → blocks}/page-header.sass +2 -5
  6. data/app/assets/stylesheets/redde/{layouts → blocks}/page-sidebar.sass +2 -3
  7. data/app/assets/stylesheets/redde/blocks/ra-layout.sass +38 -0
  8. data/app/assets/stylesheets/redde/blocks/ra-login.sass +38 -0
  9. data/app/assets/stylesheets/redde/{layouts → blocks}/sidebar.sass +3 -6
  10. data/app/assets/stylesheets/redde/blocks/sort-tree.sass +1 -1
  11. data/app/assets/stylesheets/redde/defaults/reset.sass +1 -13
  12. data/app/assets/stylesheets/redde/{defaults → elements}/btn.sass +2 -0
  13. data/app/assets/stylesheets/redde/{defaults → elements}/sbm.sass +9 -8
  14. data/app/assets/stylesheets/redde/index.scss +1 -1
  15. data/app/assets/stylesheets/redde/mixins.sass +9 -0
  16. data/app/helpers/redde/admin_helper.rb +7 -0
  17. data/app/helpers/redde/form_helper.rb +0 -1
  18. data/app/helpers/redde/index_helper.rb +22 -0
  19. data/app/views/admin/redde/_header.html.haml +1 -1
  20. data/app/views/admin/redde/_sidebar.html.haml +1 -1
  21. data/app/views/admin/redde_photos/_photos.haml +1 -6
  22. data/app/views/layouts/admin.html.haml +4 -4
  23. data/app/views/layouts/login.html.haml +22 -23
  24. data/lib/redde/version.rb +1 -1
  25. metadata +16 -15
  26. data/app/assets/stylesheets/redde/layouts/login.sass +0 -25
  27. data/app/assets/stylesheets/redde/layouts/main.sass +0 -48
  28. /data/app/assets/stylesheets/redde/{defaults → elements}/del.sass +0 -0
  29. /data/app/assets/stylesheets/redde/{defaults → elements}/inp.sass +0 -0
  30. /data/app/assets/stylesheets/redde/{defaults → elements}/sel.sass +0 -0
  31. /data/app/assets/stylesheets/redde/{defaults → elements}/txtr.sass +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5948cdc5b2b31de8f556a903d06211043b329adf
4
- data.tar.gz: c1063541c99f5e9a0c1db1c9bb99b9c2e3a61b9b
3
+ metadata.gz: 4453c93ffd2ab8fa7e1ad201948890a902d46188
4
+ data.tar.gz: 14be1bdcf588202ce8c319ac2164f7dcb90bbd59
5
5
  SHA512:
6
- metadata.gz: 03a1967bb460a6ccb601bf63c056209deb83831c26a2a67db96c0d4dbc687ae135ec252d6a4e2f108397965632a991d0355da6e7ec3baa8f29d1e915256ef475
7
- data.tar.gz: 754ff988354cfe98000fc2ef26701be93c8e4252ee93cc1b0381a699211853b7bfb389f4a05fc57e0063000636d5b347705ef3106a1908bca9972825362fbcf5
6
+ metadata.gz: c270cee3ea39d48822e0faab9bf95a69aaa8ff0f0396967097d872348932b0c115b40b18ee7c03a3899bb132fb42e19028a2eec08cdc8d229d4af688064e7b15
7
+ data.tar.gz: 950368c314e35e826aac88c11853fbfb9b06361f27baa07beced6a402a330eb8c65ced8075d27c05e3bbe70a08d3d440ac10f1f850a7bbe24349412acfa27ad1
@@ -6,7 +6,6 @@
6
6
  box-shadow: #666 0 0 3px
7
7
  background-color: #176d99
8
8
  background-image: linear-gradient(to top, #156d97, #19719b)
9
- margin-bottom: 20px
10
9
 
11
10
  .header__init
12
11
  box-sizing: border-box
@@ -7,13 +7,14 @@
7
7
  //= depend_on_asset redde/main-menu/list.svg
8
8
  //= depend_on_asset redde/main-menu/list_active.svg
9
9
 
10
+ @import redde/mixins
11
+
10
12
  .main-menu
11
- float: left
13
+ font-size: 14px
12
14
 
13
15
  .main-menu__link
14
16
  color: #bfd8e3
15
17
  text-decoration: none
16
- font-size: 14px
17
18
  line-height: 17px
18
19
  float: left
19
20
  padding: 17px 21px
@@ -0,0 +1,22 @@
1
+ @import redde/mixins
2
+
3
+ .main
4
+ +clearfix
5
+ box-shadow: 0 0 3px #ccc
6
+ border-radius: 6px
7
+ border: 1px solid #D7D7D7
8
+ min-height: 500px
9
+ background-color: #fff
10
+ padding: 0
11
+ border-bottom: 1px solid #DADEE5
12
+
13
+ .main__sidebar
14
+ float: right
15
+ padding: 30px
16
+ width: 245px
17
+ border-left: 1px solid $pale-gray
18
+
19
+ .main__content
20
+ padding: 30px
21
+ .main__sidebar + &
22
+ margin-right: 305px
@@ -1,17 +1,14 @@
1
1
  //= depend_on_asset redde/plus.svg
2
+ @import redde/mixins
2
3
 
3
4
  .page-header
4
5
  position: relative
5
6
  background: #F1F5F9
6
7
  border-bottom: 1px solid #DADEE5
7
8
  padding: 18px 30px
8
- margin: 0
9
9
  border-top-right-radius: 5px
10
10
  border-top-left-radius: 5px
11
- &:after
12
- content: ''
13
- display: table
14
- clear: both
11
+ +a_clearfix
15
12
 
16
13
  .page-header__title
17
14
  font-size: 16px
@@ -1,9 +1,8 @@
1
- .page-sidebar
2
- font-size: 12px
1
+ @import redde/mixins
3
2
 
4
3
  .page-sidebar__title
5
4
  line-height: 1
6
5
  padding: 0 0 3px 0
7
- border-bottom: 1px solid #efefef
6
+ border-bottom: 1px solid $pale-gray
8
7
  color: #222
9
8
  font-weight: bold
@@ -0,0 +1,38 @@
1
+ @import redde/mixins
2
+
3
+ .ra-layout,
4
+ .ra-layout__body
5
+ width: 100%
6
+ height: 100%
7
+
8
+ .ra-layout__body
9
+ min-width: 1000px
10
+ overflow-y: scroll
11
+ background-color: #F3F1EC
12
+ text-align: left
13
+ font: 12px $family
14
+
15
+ .ra-layout__header
16
+ margin-bottom: 20px
17
+
18
+ .ra-layout__wrapper
19
+ +a_clearfix
20
+ box-sizing: border-box
21
+ padding: 0 30px 30px 215px
22
+ max-width: 1260px
23
+ min-width: 800px
24
+ margin: 0 auto
25
+
26
+ .ra-layout__sidebar
27
+ width: 215px
28
+ float: left
29
+ margin-top: 12px
30
+ margin-left: -215px
31
+
32
+ .ra-layout__main
33
+ margin-left: -185px
34
+
35
+ .ra-layout__sidebar + &
36
+ float: left
37
+ width: 100%
38
+ margin-left: 0
@@ -0,0 +1,38 @@
1
+ @import redde/mixins
2
+
3
+ .ra-login,
4
+ .ra-login__body
5
+ width: 100%
6
+ height: 100%
7
+
8
+ .ra-login__body
9
+ background-color: #F3F1EC
10
+ text-align: left
11
+ font: 12px $family
12
+
13
+ .ra-login__main.main
14
+ min-height: 0
15
+ width: 370px
16
+ margin: 20px auto 120px
17
+
18
+ .ra-login__table
19
+ border-collapse: collapse
20
+ width: 100%
21
+ height: 100%
22
+
23
+ .ra-login__cell
24
+ vertical-align: middle
25
+
26
+ .ra-login__inp
27
+ box-sizing: border-box
28
+ width: 100%
29
+ margin-top: 2px
30
+
31
+ .ra-login__label
32
+ font-size: 13px
33
+
34
+ .ra-login__field
35
+ margin-bottom: 5px
36
+
37
+ .ra-login__actions
38
+ margin-top: 10px
@@ -1,7 +1,5 @@
1
1
  .sidebar
2
- width: 215px
3
- float: left
4
- margin-top: 12px
2
+ font-size: 13px
5
3
 
6
4
  .sidebar__badge
7
5
  font-size: 10px
@@ -13,13 +11,12 @@
13
11
  content: ')'
14
12
  color: #000
15
13
 
16
- .sidebar__link
14
+ .sidebar__link
17
15
  display: block
18
16
  overflow: hidden
19
17
  padding: 6px 6px 6px 36px
20
18
  margin-left: -6px
21
19
  text-decoration: none
22
- font-size: 13px
23
20
  line-height: (16em/13)
24
21
  color: #555
25
22
  text-shadow: 0px 1px 1px #fff
@@ -27,4 +24,4 @@
27
24
  font-weight: bold
28
25
  color: #000
29
26
  background-color: #e5e3de
30
- border-radius: 4px 0 0 4px
27
+ border-radius: 4px 0 0 4px
@@ -1,5 +1,5 @@
1
1
  //= depend_on_asset redde/folder.png
2
- //= depend_on_asset redde/defaults/del.css
2
+ //= depend_on_asset redde/elements/del.css
3
3
 
4
4
  .sort-tree
5
5
  // сделать через класс не получилось всвязи особенности скрипта, при создании нового вложенного списка класс не добавляется => искользуем каскады
@@ -10,16 +10,4 @@ th
10
10
  a
11
11
  color: $link
12
12
  &:hover
13
- text-decoration:none
14
-
15
- html,
16
- body
17
- width: 100%
18
- height: 100%
19
-
20
- body
21
- min-width: 1000px
22
- overflow-y: scroll
23
- background-color: #F3F1EC
24
- text-align: left
25
- font: 12px $family
13
+ text-decoration: none
@@ -9,3 +9,5 @@
9
9
  color: #fff
10
10
  background-color: #53a0c6
11
11
  padding: 8px 13px
12
+ border: 0 none
13
+ cursor: pointer
@@ -2,23 +2,24 @@
2
2
 
3
3
  .sbm
4
4
  display: inline-block
5
- background: #19709b
5
+ background: $link
6
6
  color: #fff
7
- font-size: 13px
7
+ font-size: $sbm-size
8
8
  font-family: $family
9
- padding: 9px 20px
9
+ padding: round(9/13*$sbm-size) round(20/13*$sbm-size)
10
10
  border: 0 none
11
- border-radius: 3px
11
+ border-radius: round(3/13*$sbm-size)
12
12
  cursor: pointer
13
13
  outline: none
14
+ text-decoration: none
14
15
 
15
16
  &[disabled]
16
17
  background: #9ea2a4
17
18
  cursor: default
18
19
 
19
20
  &:hover
20
- background: mix(#19709b, #388cb5)
21
- background: linear-gradient(#19709b 70%, #388cb5 100%)
21
+ background: mix($link, #388cb5)
22
+ background: linear-gradient($link 70%, #388cb5 100%)
22
23
 
23
24
  &:active
24
25
  background: mix(#186991, #10435c)
@@ -27,6 +28,6 @@
27
28
  &._save:before
28
29
  content: "\A0"
29
30
  display: inline-block
30
- width: 16px
31
- margin-right: 10px
31
+ width: round(16/13*$sbm-size)
32
+ margin-right: round(10/13*$sbm-size)
32
33
  background: image-url('redde/enter.svg') no-repeat 0 5px
@@ -1,5 +1,5 @@
1
1
  //= require ./defaults
2
2
  //= require ./fonts
3
- //= require_directory ./layouts
3
+ //= require_directory ./elements
4
4
  //= require_directory ./blocks
5
5
  //= require ./redactor
@@ -3,6 +3,15 @@ $family: "Lucida Grande", "Lucida Sans Unicode", helvetica, arial, verdana, sans
3
3
  $text: #000
4
4
  $link: #19709b
5
5
  $light-red: #fb4657
6
+ $pale-gray: #efefef
7
+
8
+ $sbm-size: 13px !default
9
+
10
+ =a_clearfix
11
+ &:after
12
+ content: ''
13
+ display: table
14
+ clear: both
6
15
 
7
16
  =clearfix
8
17
  &:before, &:after
@@ -1,6 +1,13 @@
1
1
  # coding: utf-8
2
2
  module Redde::AdminHelper
3
3
 
4
+ def page_sidebar title = nil, &block
5
+ content_for :page_sidebar do
6
+ concat content_tag(:div, title, class: 'page-sidebar__title') if title
7
+ concat capture(&block)
8
+ end
9
+ end
10
+
4
11
  def page_header(item = nil, &block)
5
12
  if block_given?
6
13
  content_for(:page_header, content_tag(:div, capture(&block), class: 'page-header'))
@@ -54,5 +54,4 @@ module Redde::FormHelper
54
54
  ::ActionView::Base.field_error_proc = default_field_error_proc
55
55
  end
56
56
  end
57
-
58
57
  end
@@ -94,4 +94,26 @@ module Redde::IndexHelper
94
94
  end
95
95
  end
96
96
  end
97
+
98
+ def show_tree(c)
99
+ link = link_to c.name, [:edit, :admin, c]
100
+ edit = link_to 'Удал', [:admin, c], data: { confirm: 'Точно удалить?' },
101
+ method: :delete, class: 'del'
102
+ html = content_tag(:div, link + content_tag(:p, edit))
103
+ if c.children.any?
104
+ html << content_tag(:ol) do
105
+ raw c.children.map { |ch| show_tree(ch) }.join('')
106
+ end
107
+ end
108
+ content_tag :li, raw(html), id: "list_#{c.id}"
109
+ end
110
+
111
+ def ancestry_options(items, symbol = :name)
112
+ result = []
113
+ items.map do |item, sub_items|
114
+ result << [yield(item), item.id]
115
+ result += ancestry_options(sub_items) { |i| "#{'---' * i.depth} #{i.send(symbol)}" }
116
+ end
117
+ result
118
+ end
97
119
  end
@@ -1,4 +1,4 @@
1
- %header.header
1
+ %header.ra-layout__header.header
2
2
  .header__init
3
3
  = link_to admin_root_path || '/admin', class: 'header__logo' do
4
4
  ReddeCMS
@@ -1,4 +1,4 @@
1
- %nav.sidebar
1
+ %nav.ra-layout__sidebar.sidebar
2
2
  - case @active
3
3
  - when :shop
4
4
  = sidebar_link 'Товары', [:admin, :products]
@@ -1,10 +1,5 @@
1
1
  - unless parent.new_record?
2
- = content_for(:page_sidebar) do
3
- .page-sidebar__title
4
- Фотографии
5
- - if editable ||= false
6
- = link_to "ред.", [:admin, parent]
7
-
2
+ = page_sidebar raw("Фотографии ").concat(if editable ||= false then link_to("ред.", [:admin, parent]) end) do
8
3
  %ul.photos.js-photos{ "data-sortable" => { items: :li, handle: nil, axis: nil, url: url_for([:sort, :admin, :redde_photos])}.to_json }
9
4
  = render partial: 'admin/redde_photos/photo', collection: parent.photos
10
5
 
@@ -1,5 +1,5 @@
1
1
  !!!
2
- %html{ lang: 'en' }
2
+ %html.ra-layout{ lang: 'en' }
3
3
  %head
4
4
  %meta{ charset: 'UTF-8'}
5
5
  %title= @page_title || 'ReddeCMS'
@@ -8,11 +8,11 @@
8
8
  = javascript_include_tag 'admin'
9
9
  = yield :js
10
10
  = csrf_meta_tag
11
- %body
11
+ %body.ra-layout__body
12
12
  = render 'admin/redde/header'
13
- .wrapper
13
+ .ra-layout__wrapper
14
14
  = render 'admin/redde/sidebar'
15
- .main
15
+ .ra-layout__main.main
16
16
  = yield(:page_header)
17
17
  - if notice
18
18
  .flash-msg._notice= notice
@@ -1,32 +1,31 @@
1
1
  !!!
2
- %html.login{ lang: 'en' }
2
+ %html.ra-login{ lang: 'en' }
3
3
  %head
4
4
  %meta{ charset: 'UTF-8'}
5
5
  %title Вход на сайт | Административная панель
6
6
  = stylesheet_link_tag 'admin'
7
7
  = javascript_include_tag "admin"
8
8
  = csrf_meta_tag
9
- %body
10
- %table.login__table
9
+ %body.ra-login__body
10
+ %table.ra-login__table
11
11
  %tr
12
- %td.login__cell
13
- .main._login
12
+ %td.ra-login__cell
13
+ .ra-login__main.main
14
14
  .page-header
15
- %h1 Административная панель
16
- .page
17
- .content
18
- = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
19
- .login__fields
20
- = f.label :email, 'E-mail'
21
- %br
22
- = f.email_field :email, class: 'login__inp'
23
- .login__fields
24
- = f.label :password, 'Пароль'
25
- %br
26
- = f.password_field :password, size: 35, class: 'login__inp'
27
- - if devise_mapping.rememberable?
28
- .login__fields
29
- = f.check_box :remember_me
30
- = f.label :remember_me, 'Оставаться в системе'
31
- .login__actions
32
- = f.submit 'Войти', class: 'sbm'
15
+ .page-header__title Административная панель
16
+ .main__content
17
+ = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
18
+ .ra-login__field
19
+ = f.label :email, 'E-mail', class: 'ra-login__label'
20
+ %br
21
+ = f.email_field :email, class: 'inp ra-login__inp'
22
+ .ra-login__field
23
+ = f.label :password, 'Пароль', class: 'ra-login__label'
24
+ %br
25
+ = f.password_field :password, size: 35, class: 'inp ra-login__inp'
26
+ - if devise_mapping.rememberable?
27
+ .ra-login__field
28
+ = f.check_box :remember_me
29
+ = f.label :remember_me, 'Оставаться в системе', class: 'ra-login__label'
30
+ .ra-login__actions
31
+ = f.submit 'Войти', class: 'sbm'
data/lib/redde/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redde
2
- VERSION = '0.3.7'.freeze
2
+ VERSION = '0.3.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redde
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Bovykin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-02-01 00:00:00.000000000 Z
12
+ date: 2016-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
@@ -461,33 +461,34 @@ files:
461
461
  - app/assets/javascripts/redde/sortable.coffee
462
462
  - app/assets/stylesheets/redde/blocks/error-msg.sass
463
463
  - app/assets/stylesheets/redde/blocks/flash-msg.sass
464
+ - app/assets/stylesheets/redde/blocks/header.sass
464
465
  - app/assets/stylesheets/redde/blocks/list.sass
466
+ - app/assets/stylesheets/redde/blocks/main-menu.sass
467
+ - app/assets/stylesheets/redde/blocks/main.sass
465
468
  - app/assets/stylesheets/redde/blocks/orders.scss
469
+ - app/assets/stylesheets/redde/blocks/page-header.sass
470
+ - app/assets/stylesheets/redde/blocks/page-sidebar.sass
466
471
  - app/assets/stylesheets/redde/blocks/paginate.sass
467
472
  - app/assets/stylesheets/redde/blocks/pagination.scss
468
473
  - app/assets/stylesheets/redde/blocks/partners.scss
469
474
  - app/assets/stylesheets/redde/blocks/phead-tabs.sass
470
475
  - app/assets/stylesheets/redde/blocks/photos-uploader.sass
471
476
  - app/assets/stylesheets/redde/blocks/photos.sass
477
+ - app/assets/stylesheets/redde/blocks/ra-layout.sass
478
+ - app/assets/stylesheets/redde/blocks/ra-login.sass
472
479
  - app/assets/stylesheets/redde/blocks/redde-form.sass
480
+ - app/assets/stylesheets/redde/blocks/sidebar.sass
473
481
  - app/assets/stylesheets/redde/blocks/sort-tree.sass
474
- - app/assets/stylesheets/redde/defaults/btn.sass
475
- - app/assets/stylesheets/redde/defaults/del.sass
476
482
  - app/assets/stylesheets/redde/defaults/index.sass
477
- - app/assets/stylesheets/redde/defaults/inp.sass
478
483
  - app/assets/stylesheets/redde/defaults/reset.sass
479
- - app/assets/stylesheets/redde/defaults/sbm.sass
480
- - app/assets/stylesheets/redde/defaults/sel.sass
481
- - app/assets/stylesheets/redde/defaults/txtr.sass
484
+ - app/assets/stylesheets/redde/elements/btn.sass
485
+ - app/assets/stylesheets/redde/elements/del.sass
486
+ - app/assets/stylesheets/redde/elements/inp.sass
487
+ - app/assets/stylesheets/redde/elements/sbm.sass
488
+ - app/assets/stylesheets/redde/elements/sel.sass
489
+ - app/assets/stylesheets/redde/elements/txtr.sass
482
490
  - app/assets/stylesheets/redde/fonts.sass
483
491
  - app/assets/stylesheets/redde/index.scss
484
- - app/assets/stylesheets/redde/layouts/header.sass
485
- - app/assets/stylesheets/redde/layouts/login.sass
486
- - app/assets/stylesheets/redde/layouts/main-menu.sass
487
- - app/assets/stylesheets/redde/layouts/main.sass
488
- - app/assets/stylesheets/redde/layouts/page-header.sass
489
- - app/assets/stylesheets/redde/layouts/page-sidebar.sass
490
- - app/assets/stylesheets/redde/layouts/sidebar.sass
491
492
  - app/assets/stylesheets/redde/mixins.sass
492
493
  - app/assets/stylesheets/redde/redactor/index.scss
493
494
  - app/assets/stylesheets/redde/redactor/wym.css
@@ -1,25 +0,0 @@
1
- .main._login
2
- min-height: 0
3
- width: 370px
4
- margin: 0 auto
5
- margin-bottom: 100px
6
-
7
- .login__table
8
- border-collapse: collapse
9
- width: 100%
10
- height: 100%
11
-
12
- .login__cell
13
- vertical-align: middle
14
-
15
- .login__inp
16
- box-sizing: border-box
17
- width: 100%
18
- margin-left: 0 !important
19
- margin-top: 1px
20
-
21
- .login__fields
22
- margin-bottom: 5px
23
-
24
- .login__actions
25
- margin-top: 10px
@@ -1,48 +0,0 @@
1
- @import redde/mixins
2
-
3
- .wrapper
4
- box-sizing: border-box
5
- padding: 0 30px 30px 215px
6
- max-width: 1260px
7
- min-width: 800px
8
- margin: 0 auto
9
- &:after
10
- content: ''
11
- display: table
12
- clear: both
13
-
14
- .sidebar
15
- margin-left: -215px
16
-
17
- .main
18
- box-shadow: 0 0 3px #ccc
19
- border-radius: 6px
20
- border: 1px solid #D7D7D7
21
- min-height: 500px
22
- background-color: #fff
23
- padding: 0
24
- border-bottom: 1px solid #DADEE5
25
- margin: 0
26
- margin-left: -185px
27
-
28
- +clearfix
29
-
30
- .sidebar + &
31
- float: left
32
- width: 100%
33
- margin-left: 0
34
-
35
-
36
- .main__sidebar
37
- float: right
38
- padding: 30px
39
- width: 245px
40
- border-left: 1px solid #efefef
41
-
42
- .main__content
43
- padding: 30px
44
- .main__sidebar + &
45
- margin-right: 305px
46
-
47
- // .sidebar .page-sidebar
48
- // float: right