redde 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/redde/admin_helper.rb +22 -1
- data/app/helpers/redde/form_helper.rb +0 -1
- data/app/views/admin/base/edit.html.haml +2 -12
- data/app/views/admin/base/index.html.haml +1 -1
- data/app/views/admin/base/tree.html.haml +1 -3
- data/app/views/admin/managers/edit.html.haml +1 -7
- data/app/views/admin/managers/index.html.haml +1 -3
- data/app/views/admin/redde/_page_header.html.haml +2 -3
- data/app/views/admin/redde/_page_header_edit.html.haml +7 -0
- data/app/views/admin/system_commands/index.html.haml +2 -2
- data/app/views/layouts/admin.html.haml +4 -9
- data/lib/redde/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dfe0485b6b977a44124ef52c40206d970a8da28
|
4
|
+
data.tar.gz: d2e0b886c2906a310ee6e865f34fd5ee014709d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fca82ce871d89b082e6e38cb4a0bfc3e665639efc9d794b0c103d70a4bd483843e111b23d8a3a482bfb1e96b86325e38cfd5b189c76fc3edcb481fa8f65234a
|
7
|
+
data.tar.gz: 49ca40569bf78635f09bbc943451967531914ebce3fa3b6af93b1f09dd0db1dc94edab5918ac6dd53b25d51ec7b17b708a1ce3e50c8e2ba2ae2de9161059ca2d
|
@@ -1,5 +1,26 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
module Redde::AdminHelper
|
3
|
+
|
4
|
+
def page_header(item = nil, &block)
|
5
|
+
if block_given?
|
6
|
+
content_for(:page_header, content_tag(:div, capture(&block), class: 'page-header'))
|
7
|
+
elsif action_name == 'index'
|
8
|
+
content_for(:page_header, content_tag(:div, render('admin/redde/page_header'), class: 'page-header'))
|
9
|
+
else
|
10
|
+
content_for(:page_header, content_tag(:div, render('admin/redde/page_header_edit', item: instance_variable_get("@#{record}")), class: 'page-header'))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def redde_page(&block)
|
15
|
+
item = instance_variable_get("@#{record}")
|
16
|
+
|
17
|
+
capture do
|
18
|
+
concat page_header
|
19
|
+
concat redde_form_for([:admin, item]) { |f| capture(f, &block) }
|
20
|
+
concat photoable(item)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
3
24
|
def command_link(name, action, confirm = nil)
|
4
25
|
options = { method: :put }
|
5
26
|
options[:data] = { confirm: confirm } if confirm.present?
|
@@ -16,7 +37,7 @@ module Redde::AdminHelper
|
|
16
37
|
end
|
17
38
|
|
18
39
|
def photoable(parent)
|
19
|
-
render('admin/redde_photos/photos', parent: parent)
|
40
|
+
render('admin/redde_photos/photos', parent: parent) if parent.class.reflect_on_association(:photos)
|
20
41
|
end
|
21
42
|
|
22
43
|
def tsingular(model)
|
@@ -1,19 +1,9 @@
|
|
1
|
-
|
2
|
-
- content_for :page_header do
|
3
|
-
.page-header__title
|
4
|
-
- if item.new_record?
|
5
|
-
Добавить #{taccusative(record)}
|
6
|
-
- else
|
7
|
-
Редактировать #{taccusative(record)}
|
8
|
-
= link_to 'Назад', { action: :index }, class: 'btn page-header__btn'
|
9
|
-
|
10
|
-
= photoable(item) if item.class.reflect_on_association(:photos)
|
11
|
-
|
12
|
-
= redde_form_for [:admin, item] do |f|
|
1
|
+
= redde_page do |f|
|
13
2
|
- form_column_names.each do |column|
|
14
3
|
= f.redde_field column.to_sym
|
15
4
|
- if column_names.include?('ancestry')
|
16
5
|
= f.redde_select :parent_id, options_from_collection_for_select(f.object.class.all, :id, :title, f.object.parent_id), { include_blank: '- Выбрать -' }
|
6
|
+
|
17
7
|
-# %div= render 'redditor/admin/page', { f: f } if @article.methods.include?(:page)
|
18
8
|
|
19
9
|
-# проверить и написать правильное условие
|
@@ -1,12 +1,10 @@
|
|
1
|
-
=
|
1
|
+
= page_header
|
2
2
|
|
3
3
|
- res_collection = instance_variable_get("@#{collection}")
|
4
4
|
- if res_collection.any?
|
5
5
|
- cache [model_name.maximum(:updated_at).to_i] do
|
6
6
|
%ol.sort-tree{ 'data-sort-tree' => '' }= render partial: 'tree_item', collection: res_collection, as: :item
|
7
7
|
|
8
|
-
=# sort_tree sort_admin_categories_path, 2
|
9
|
-
|
10
8
|
- else
|
11
9
|
%h3
|
12
10
|
Ни одной
|
@@ -1,10 +1,4 @@
|
|
1
|
-
|
2
|
-
%h1
|
3
|
-
- if @manager.new_record?
|
4
|
-
Добавить #{taccusative(:manager)}
|
5
|
-
- else
|
6
|
-
Редактировать #{taccusative(:manager)}
|
7
|
-
%p= link_to 'Назад', [:admin, :managers]
|
1
|
+
= page_header
|
8
2
|
|
9
3
|
= redde_form_for [:admin, @manager] do |f|
|
10
4
|
= f.redde_text_field :email
|
@@ -1,3 +1,2 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
= link_to "Добавить #{taccusative("#{record}")}", { action: :new }, class: 'btn page-header__btn'
|
1
|
+
.page-header__title= tplural model_name
|
2
|
+
= link_to "Добавить #{taccusative("#{record}")}", { action: :new }, class: 'btn page-header__btn'
|
@@ -13,16 +13,11 @@
|
|
13
13
|
.wrapper
|
14
14
|
= render 'admin/redde/sidebar'
|
15
15
|
.main
|
16
|
-
|
17
|
-
= yield(:page_header)
|
16
|
+
= yield(:page_header)
|
18
17
|
- if notice
|
19
18
|
.flash-msg._notice= notice
|
20
19
|
- if alert
|
21
20
|
.flash-msg._alert= alert
|
22
|
-
.
|
23
|
-
|
24
|
-
|
25
|
-
- if yield(:page_sidebar).present?
|
26
|
-
.main__sidebar.page-sidebar= yield(:page_sidebar)
|
27
|
-
.main__content
|
28
|
-
= yield
|
21
|
+
- if yield(:page_sidebar).present?
|
22
|
+
.main__sidebar.page-sidebar= yield(:page_sidebar)
|
23
|
+
.main__content= yield
|
data/lib/redde/version.rb
CHANGED
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.
|
4
|
+
version: 0.3.1
|
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-01-
|
12
|
+
date: 2016-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jquery-rails
|
@@ -567,6 +567,7 @@ files:
|
|
567
567
|
- app/views/admin/redde/_header.html.haml
|
568
568
|
- app/views/admin/redde/_main_menu.html.haml
|
569
569
|
- app/views/admin/redde/_page_header.html.haml
|
570
|
+
- app/views/admin/redde/_page_header_edit.html.haml
|
570
571
|
- app/views/admin/redde/_sidebar.html.haml
|
571
572
|
- app/views/admin/redde/_validate.haml
|
572
573
|
- app/views/admin/redde_photos/_photo.haml
|
@@ -621,7 +622,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
621
622
|
version: '0'
|
622
623
|
requirements: []
|
623
624
|
rubyforge_project:
|
624
|
-
rubygems_version: 2.5.1
|
625
|
+
rubygems_version: 2.4.5.1
|
625
626
|
signing_key:
|
626
627
|
specification_version: 4
|
627
628
|
summary: Admin scaffold generator for redde projects
|