billy_cms 0.0.2
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 +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +10 -0
- data/app/assets/images/billy_cms/32px.png +0 -0
- data/app/assets/images/billy_cms/40px.png +0 -0
- data/app/assets/images/billy_cms/fileicon.png +0 -0
- data/app/assets/images/billy_cms/throbber.gif +0 -0
- data/app/assets/javascripts/billy_cms/backend/app.js.erb +217 -0
- data/app/assets/javascripts/billy_cms/backend/attributes.js +33 -0
- data/app/assets/javascripts/billy_cms/backend/billy_object.js +41 -0
- data/app/assets/javascripts/billy_cms/backend/directives/ng-jstree.js +200 -0
- data/app/assets/javascripts/billy_cms/backend/jstree.js +7781 -0
- data/app/assets/javascripts/billy_cms/backend/ngfileupload.js +2506 -0
- data/app/assets/javascripts/billy_cms/backend/page_type.js +11 -0
- data/app/assets/javascripts/billy_cms/backend/ui-router.js +4370 -0
- data/app/assets/javascripts/billy_cms/backend.js +15 -0
- data/app/assets/javascripts/billy_cms/frontend/api_connector.js +5 -0
- data/app/assets/javascripts/billy_cms/frontend/editing.es6 +120 -0
- data/app/assets/javascripts/billy_cms/frontend/google_maps.js +13 -0
- data/app/assets/javascripts/billy_cms/frontend/navbar.js +0 -0
- data/app/assets/javascripts/billy_cms/frontend/slick.es6 +8 -0
- data/app/assets/javascripts/billy_cms.js +16 -0
- data/app/assets/stylesheets/billy_cms/backend/index.scss +17 -0
- data/app/assets/stylesheets/billy_cms/editmode.scss +78 -0
- data/app/assets/stylesheets/billy_cms/index.scss +5 -0
- data/app/assets/stylesheets/billy_cms/jstree.scss +1061 -0
- data/app/assets/stylesheets/billy_cms.css +15 -0
- data/app/controllers/billy_cms/api/api_controller.rb +25 -0
- data/app/controllers/billy_cms/api/attributes_controller.rb +65 -0
- data/app/controllers/billy_cms/api/page_types_controller.rb +13 -0
- data/app/controllers/billy_cms/api/pages_controller.rb +63 -0
- data/app/controllers/billy_cms/backend_controller.rb +10 -0
- data/app/controllers/billy_cms/base_controller.rb +23 -0
- data/app/helpers/billy_cms/cms_path_helper.rb +8 -0
- data/app/helpers/billy_cms/content_helper.rb +17 -0
- data/app/helpers/billy_cms/permission_helper.rb +24 -0
- data/app/models/billy_cms/additional_attribute.rb +6 -0
- data/app/models/billy_cms/additional_attributes_page_types.rb +6 -0
- data/app/models/billy_cms/page.rb +61 -0
- data/app/models/billy_cms/page_type.rb +7 -0
- data/app/models/billy_router.rb +20 -0
- data/app/serializers/billy_cms/additional_attribute_serializer.rb +6 -0
- data/app/serializers/billy_cms/page_serializer.rb +15 -0
- data/app/serializers/billy_cms/page_type_serializer.rb +5 -0
- data/app/views/billy_cms/_edit_page_button.html.erb +1 -0
- data/app/views/billy_cms/_page_settings_form.html.erb +25 -0
- data/app/views/billy_cms/_page_settings_modal.html.erb +19 -0
- data/app/views/billy_cms/_settings_page_button.html.erb +4 -0
- data/app/views/billy_cms/backend/_attributes.html.erb +12 -0
- data/app/views/billy_cms/backend/_header.html.erb +84 -0
- data/app/views/billy_cms/backend/_tree.html.erb +58 -0
- data/app/views/billy_cms/backend/index.html.erb +19 -0
- data/billy_cms.gemspec +32 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/billy_cms/version.rb +3 -0
- data/lib/billy_cms.rb +5 -0
- metadata +147 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module BillyCms
|
2
|
+
module Api
|
3
|
+
class ApiController < ActionController::Base
|
4
|
+
protect_from_forgery with: :null_session
|
5
|
+
skip_before_filter :verify_authenticity_token
|
6
|
+
|
7
|
+
before_filter :ensure_user_is_admin
|
8
|
+
|
9
|
+
def current_user
|
10
|
+
@current_user ||= begin
|
11
|
+
users = User.where(id: session[:user_id]).presence
|
12
|
+
session[:user_id] && users ? users.first : false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
protected
|
17
|
+
|
18
|
+
def ensure_user_is_admin
|
19
|
+
unless current_user && current_user.admin?
|
20
|
+
render text: 'Forbidden', status: 403
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module BillyCms
|
2
|
+
module Api
|
3
|
+
class AttributesController < ApiController
|
4
|
+
def index
|
5
|
+
render json: AdditionalAttribute.all
|
6
|
+
end
|
7
|
+
|
8
|
+
def show
|
9
|
+
render json: AdditionalAttribute.find(params[:id])
|
10
|
+
end
|
11
|
+
|
12
|
+
def update
|
13
|
+
render nothing: true, status: 400 unless params[:attribute]
|
14
|
+
attribute = AdditionalAttribute.find params[:id]
|
15
|
+
if attribute.update_attributes attribute_params
|
16
|
+
render json: {
|
17
|
+
success: true,
|
18
|
+
attribute: attribute
|
19
|
+
}
|
20
|
+
else
|
21
|
+
render json: {
|
22
|
+
success: false,
|
23
|
+
error: attribute.error_messages,
|
24
|
+
}, status: 500
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def create
|
29
|
+
render nothing: true, status: 400 unless params[:attribute]
|
30
|
+
attribute = AdditionalAttribute.new attribute_params
|
31
|
+
if attribute.save
|
32
|
+
render json: {
|
33
|
+
success: true,
|
34
|
+
attribute: attribute
|
35
|
+
}
|
36
|
+
else
|
37
|
+
render json: {
|
38
|
+
success: false,
|
39
|
+
error: attribute.error_messages,
|
40
|
+
}, status: 500
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def destroy
|
45
|
+
render :nothing, status: 400 unless params[:id]
|
46
|
+
if AdditionalAttribute.delete(params[:id])
|
47
|
+
render json: {
|
48
|
+
success: true
|
49
|
+
}
|
50
|
+
else
|
51
|
+
render json: {
|
52
|
+
success: false,
|
53
|
+
error: attribute.error_messages,
|
54
|
+
}, status: 500
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def attributes_params
|
61
|
+
params.require(:attribute).permit(:title, :attribute, :attribute_type) if current_user.admin?
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module BillyCms
|
2
|
+
module Api
|
3
|
+
class PagesController < ApiController
|
4
|
+
def index
|
5
|
+
render json: Page.all
|
6
|
+
end
|
7
|
+
|
8
|
+
def update
|
9
|
+
render nothing: true, status: 400 unless params[:page]
|
10
|
+
page = Page.find params[:id]
|
11
|
+
if page.update_attributes page_params
|
12
|
+
render json: {
|
13
|
+
success: true,
|
14
|
+
page: page
|
15
|
+
}
|
16
|
+
else
|
17
|
+
render json: {
|
18
|
+
success: false,
|
19
|
+
error: page.error_messages,
|
20
|
+
}, status: 500
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
render nothing: true, status: 400 unless params[:page]
|
26
|
+
page = Page.new page_params
|
27
|
+
if page.save
|
28
|
+
render json: {
|
29
|
+
success: true,
|
30
|
+
page: page
|
31
|
+
}
|
32
|
+
else
|
33
|
+
render json: {
|
34
|
+
success: false,
|
35
|
+
error: page.error_messages,
|
36
|
+
}, status: 500
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy
|
41
|
+
render :nothing, status: 400 unless params[:id]
|
42
|
+
if Page.delete(params[:id])
|
43
|
+
render json: {
|
44
|
+
success: true
|
45
|
+
}
|
46
|
+
else
|
47
|
+
render json: {
|
48
|
+
success: false,
|
49
|
+
error: page.error_messages,
|
50
|
+
}, status: 500
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def page_params
|
57
|
+
page = Page.find(params[:id]) if params[:id].present?
|
58
|
+
allowed_types = page ? page.additional_attributes.map(&:name).map(&:to_sym) : []
|
59
|
+
params.require(:page).permit(:title, :content, :parent_page_id, :order_key, :hide_from_navigation, :page_type, additional_attributes_values: allowed_types) if current_user.admin?
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module BillyCms
|
2
|
+
class BaseController < ActionController::Base
|
3
|
+
layout 'application'
|
4
|
+
before_filter :set_page_object
|
5
|
+
# Prevent CSRF attacks by raising an exception.
|
6
|
+
# For APIs, you may want to use :null_session instead.
|
7
|
+
protect_from_forgery with: :exception
|
8
|
+
|
9
|
+
def show
|
10
|
+
end
|
11
|
+
|
12
|
+
def set_page_object
|
13
|
+
path = params[:path]
|
14
|
+
if request.path == root_path
|
15
|
+
@page = Page.friendly.find('startseite')
|
16
|
+
elsif path
|
17
|
+
slug = path.split('/').last
|
18
|
+
@page = Page.friendly.find(slug)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module BillyCms
|
2
|
+
module ContentHelper
|
3
|
+
|
4
|
+
def page_field(page, field, options = {})
|
5
|
+
tag_name = options[:tag] || :div
|
6
|
+
content_tag tag_name, page.send(field).to_s.html_safe, class: "page-#{field.to_s}", 'billycms-attribute' => field.to_s, 'billycms-page' => page[:id], contenteditable: false
|
7
|
+
end
|
8
|
+
|
9
|
+
def cms_image(obj, options = {})
|
10
|
+
content_tag :div, class: "page-content page-content-binary", 'billycms-attribute' => 'content', 'billycms-page' => obj[:id] do
|
11
|
+
image_tag(obj.content.to_s) +
|
12
|
+
file_field_tag(:obj_input_file)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module BillyCms
|
2
|
+
module PermissionHelper
|
3
|
+
def can_edit?(page)
|
4
|
+
return false unless page
|
5
|
+
return false unless current_user && current_user.admin?
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
def billy_edit_button(page = nil)
|
10
|
+
return unless can_edit?(page ||= @page) and !page.nil?
|
11
|
+
render partial: 'billy_cms/edit_page_button', locals: { page: page }
|
12
|
+
end
|
13
|
+
|
14
|
+
def billy_settings_button(page = nil)
|
15
|
+
return unless can_edit?(page ||= @page) and !page.nil?
|
16
|
+
return unless can_edit?(page) and !page.nil?
|
17
|
+
render partial: 'billy_cms/settings_page_button', locals: { page: page }
|
18
|
+
end
|
19
|
+
|
20
|
+
def billy_buttons(page = nil)
|
21
|
+
billy_edit_button(page) + billy_settings_button(page)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module BillyCms
|
2
|
+
class Page < ActiveRecord::Base
|
3
|
+
extend FriendlyId
|
4
|
+
friendly_id :title, use: :slugged
|
5
|
+
|
6
|
+
has_many :pages, class_name: 'Page', foreign_key: :parent_page_id
|
7
|
+
belongs_to :parent_page, class_name: 'Page', foreign_key: :parent_page_id
|
8
|
+
|
9
|
+
def cms_path
|
10
|
+
get_cms_path_component_for_parent '', self
|
11
|
+
end
|
12
|
+
|
13
|
+
def children
|
14
|
+
pages.sort_by(&:order_key)
|
15
|
+
end
|
16
|
+
|
17
|
+
def navigation
|
18
|
+
self.children.reject { |page| page.hide_from_navigation? || page.page_type == 'Binary' || page.page_type == 'Box' }
|
19
|
+
end
|
20
|
+
|
21
|
+
def boxes
|
22
|
+
pages.where(page_type: 'box').sort_by(&:order_key)
|
23
|
+
end
|
24
|
+
|
25
|
+
def binaries
|
26
|
+
pages.where(page_type: 'Binary').sort_by(&:order_key)
|
27
|
+
end
|
28
|
+
|
29
|
+
def is_in_path?(path)
|
30
|
+
if path == '/'
|
31
|
+
return slug == 'startseite' ? true : false
|
32
|
+
end
|
33
|
+
# byebug if id == 6
|
34
|
+
reg = Regexp.new("^(#{cms_path})", 'i')
|
35
|
+
path.match(reg) != nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def sibblings
|
39
|
+
self.class.where(parent_page_id: parent_page_id).where.not(id: id).order(:order_key)
|
40
|
+
end
|
41
|
+
|
42
|
+
def binary?
|
43
|
+
self.page_type == 'Binary'
|
44
|
+
end
|
45
|
+
|
46
|
+
def additional_attributes
|
47
|
+
type = PageType.find_by_name(self.page_type)
|
48
|
+
return [] unless type.present?
|
49
|
+
type.additional_attributes
|
50
|
+
end
|
51
|
+
|
52
|
+
def additional_attribute(attribute_name)
|
53
|
+
self.additional_attributes_values[attribute_name.to_s] if self.additional_attributes_values.present?
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
def get_cms_path_component_for_parent(current_path, current_page)
|
58
|
+
current_path += "#{get_cms_path_component_for_parent(current_path, current_page.parent_page) if current_page.parent_page}#{"/#{current_page.slug}" if current_page}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class BillyRouter
|
2
|
+
def call(env)
|
3
|
+
# Matched from routes, you can access all matched parameters
|
4
|
+
path = env['action_dispatch.request.path_parameters'][:path]
|
5
|
+
slug = path.split('/').last
|
6
|
+
|
7
|
+
page = BillyCms::Page.friendly.find(slug)
|
8
|
+
controller_class_name = page.page_type.to_s.camelcase + 'Controller'
|
9
|
+
|
10
|
+
begin
|
11
|
+
controller_name = controller_class_name.constantize
|
12
|
+
rescue NameError
|
13
|
+
controller_name = CmsController
|
14
|
+
end
|
15
|
+
|
16
|
+
action_name = 'show'
|
17
|
+
|
18
|
+
controller_name.action(action_name.to_sym).call(env)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class BillyCms::PageSerializer < ActiveModel::Serializer
|
2
|
+
attributes :id,
|
3
|
+
:page_type,
|
4
|
+
:title,
|
5
|
+
:content,
|
6
|
+
:slug,
|
7
|
+
:cms_path,
|
8
|
+
:updated_at,
|
9
|
+
:created_at,
|
10
|
+
:last_modified_by,
|
11
|
+
:parent_page_id,
|
12
|
+
:parent_page,
|
13
|
+
:hide_from_navigation,
|
14
|
+
:order_key
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<button class="billycms_edit_button" billycms-page-id="<%= page.id %>"></button>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= form_tag '/', method: :post, class: 'form-horizontal', id: 'page-settings-form', 'billycms-id' => page.id do %>
|
2
|
+
<%= content_tag :div, class: 'form-group' do %>
|
3
|
+
<%= label_tag :id, 'ID:' %>
|
4
|
+
<%= number_field_tag :id, page.id, disabled: true, readonly: true %>
|
5
|
+
<% end %>
|
6
|
+
<%= content_tag :div, class: 'form-group' do %>
|
7
|
+
<%= label_tag :path, 'Pfad:' %>
|
8
|
+
<%= text_field_tag :path, page.cms_path, disabled: true, readonly: true %>
|
9
|
+
<% end %>
|
10
|
+
<%= content_tag :div, class: 'form-group' do %>
|
11
|
+
<%= label_tag :hide_from_navigation, 'In der Navigation verstecken:' %>
|
12
|
+
<%= check_box_tag :hide_from_navigation, true, page.hide_from_navigation, onchange: 'this.value = this.checked' %>
|
13
|
+
<% end %>
|
14
|
+
<%= content_tag :div, class: 'form-group' do %>
|
15
|
+
<%= label_tag :order_key, 'Sortierschlüssel:' %>
|
16
|
+
<%= number_field_tag :order_key, page.order_key %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% page.additional_attributes.each do |attribute| %>
|
20
|
+
<%= content_tag :div, class: 'form-group' do %>
|
21
|
+
<%= label_tag "additional_attributes_values_#{attribute.name}", attribute.title %>
|
22
|
+
<%= text_field_tag "additional_attributes_values[#{attribute.name}]", page.additional_attribute(attribute.name) %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% if page.present? %>
|
2
|
+
<div class="modal fade page-settings-modal" id="<%= id %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
3
|
+
<div class="modal-dialog" role="document">
|
4
|
+
<div class="modal-content">
|
5
|
+
<div class="modal-header">
|
6
|
+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
7
|
+
<h4 class="modal-title" id="myModalLabel">Einstellungen: <%= page.title %></h4>
|
8
|
+
</div>
|
9
|
+
<div class="modal-body">
|
10
|
+
<%= render partial: 'billy_cms/page_settings_form', locals: { page: page } %>
|
11
|
+
</div>
|
12
|
+
<div class="modal-footer">
|
13
|
+
<button type="button" class="btn btn-default" data-dismiss="modal">Schließen</button>
|
14
|
+
<button type="button" class="btn btn-primary">Speichern</button>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<button class="billycms_settings_button" billycms-page-id="<%= page.id %>"></button>
|
2
|
+
<%= content_tag :button, '', class: 'billycms_settings_button', data: { toggle: 'modal', target: "#page-settings-modal-#{page.id}" }%>
|
3
|
+
|
4
|
+
<%= render 'billy_cms/page_settings_modal', id: "page-settings-modal-#{page.id}", page: page %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<md-content>
|
2
|
+
<h2>Attribute</h2>
|
3
|
+
|
4
|
+
<md-list>
|
5
|
+
<md-list-item class="md-2-line" ng-repeat="attribute in attrs.possibleAttributes">
|
6
|
+
<div class="md-list-item-text" layout="column">
|
7
|
+
<h3>{{ attribute.title }}</h3>
|
8
|
+
<p>{{ attribute.name }} • {{attribute.attribute_type}}</p>
|
9
|
+
</div>
|
10
|
+
</md-list-item>
|
11
|
+
</md-list>
|
12
|
+
</md-content>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<div>
|
2
|
+
<md-toolbar class="md-menu-toolbar">
|
3
|
+
<div layout="row">
|
4
|
+
<md-toolbar-filler layout layout-align="center center">
|
5
|
+
<md-icon md-svg-icon="call:chat"></md-icon>
|
6
|
+
</md-toolbar-filler>
|
7
|
+
<div>
|
8
|
+
<h2 class="md-toolbar-tools">Seite</h2>
|
9
|
+
<md-menu-bar>
|
10
|
+
<md-menu>
|
11
|
+
<button ng-click="$mdOpenMenu()">
|
12
|
+
Datei
|
13
|
+
</button>
|
14
|
+
<md-menu-content>
|
15
|
+
<md-menu-item>
|
16
|
+
<md-button ng-click="app.openInPreview(app.selectedNode)">
|
17
|
+
Vorschau
|
18
|
+
</md-button>
|
19
|
+
</md-menu-item>
|
20
|
+
<md-menu-divider></md-menu-divider>
|
21
|
+
<md-menu-item>
|
22
|
+
<md-menu>
|
23
|
+
<md-button ng-click="$mdOpenMenu()">Neu</md-button>
|
24
|
+
<md-menu-content>
|
25
|
+
<md-menu-item><md-button ng-click="app.createNewPageForNode(app.selectedNode)">Seite</md-button></md-menu-item>
|
26
|
+
<md-menu-item><md-button ng-click="app.createNewFileForNode(app.selectedNode)">Datei (Bild, PDF, ...)</md-button></md-menu-item>
|
27
|
+
<md-menu-item></md-menu-item>
|
28
|
+
</md-menu-content>
|
29
|
+
</md-menu>
|
30
|
+
</md-menu-item>
|
31
|
+
<md-menu-item>
|
32
|
+
<md-button ng-click="app.deleteNode(app.selectedNode)">
|
33
|
+
löschen
|
34
|
+
<span class="md-alt-text"> {{ 'M-D'}}</span>
|
35
|
+
</md-button>
|
36
|
+
</md-menu-item>
|
37
|
+
<md-menu-item>
|
38
|
+
<md-button disabled="disabled" ng-click="ctrl.sampleAction('Rename', $event)">
|
39
|
+
Rename
|
40
|
+
</md-button>
|
41
|
+
</md-menu-item>
|
42
|
+
<md-menu-divider></md-menu-divider>
|
43
|
+
<md-menu-item>
|
44
|
+
<md-button ng-click="ctrl.sampleAction('Print', $event)">
|
45
|
+
Print
|
46
|
+
<span class="md-alt-text">{{ 'M-P'}}</span>
|
47
|
+
</md-button>
|
48
|
+
</md-menu-item>
|
49
|
+
</md-menu-content>
|
50
|
+
</md-menu>
|
51
|
+
<md-menu>
|
52
|
+
<button ng-click="$mdOpenMenu()">
|
53
|
+
System
|
54
|
+
</button>
|
55
|
+
<md-menu-content>
|
56
|
+
<md-menu-item>
|
57
|
+
<md-button ui-sref="tree">
|
58
|
+
Baumansicht
|
59
|
+
</md-button>
|
60
|
+
</md-menu-item>
|
61
|
+
<md-menu-item>
|
62
|
+
<md-button ui-sref="page_types">
|
63
|
+
Seitentypen
|
64
|
+
</md-button>
|
65
|
+
</md-menu-item>
|
66
|
+
<md-menu-item>
|
67
|
+
<md-button ui-sref="additional_attributes">
|
68
|
+
Zusätzliche Attribute
|
69
|
+
</md-button>
|
70
|
+
</md-menu-item>
|
71
|
+
<md-menu-divider></md-menu-divider>
|
72
|
+
<md-menu-item>
|
73
|
+
<md-menu>
|
74
|
+
<md-button ng-click="$mdOpenMenu()">Systemeinstellungen</md-button>
|
75
|
+
<md-menu-content>bla</md-menu-content>
|
76
|
+
</md-menu>
|
77
|
+
</md-menu-item>
|
78
|
+
</md-menu-content>
|
79
|
+
</md-menu>
|
80
|
+
</md-menu-bar>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
</md-toolbar>
|
84
|
+
</div>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<div layout="row" layout-wrap>
|
2
|
+
<aside flex="30">
|
3
|
+
<div js-tree="app.treeConfig" ng-model="app.tree" tree="app.treeInstance" tree-events="ready:app.onTreeReady"></div>
|
4
|
+
</aside>
|
5
|
+
<form flex="70" ng-show="app.selectedNode" ng-submit="app.saveNode(app.selectedNode)">
|
6
|
+
<md-input-container class="md-block">
|
7
|
+
<label>ID: {{app.selectedNode.id}}</label>
|
8
|
+
</md-input-container>
|
9
|
+
<md-input-container class="md-block">
|
10
|
+
<label>Titel</label>
|
11
|
+
<input type="text" ng-model="app.selectedNode.title" />
|
12
|
+
</md-input-container>
|
13
|
+
<md-input-container class="md-block">
|
14
|
+
<label>Seitentyp</label>
|
15
|
+
<md-select ng-model="app.selectedNode.page_type">
|
16
|
+
<md-option ng-repeat="type in app.allPageTypes" value="{{type.name}}">
|
17
|
+
{{type.title}}
|
18
|
+
</md-option>
|
19
|
+
</md-select>
|
20
|
+
</md-input-container>
|
21
|
+
<md-input-container class="md-block">
|
22
|
+
<label>Slug</label>
|
23
|
+
<input type="text" ng-model="app.selectedNode.slug" />
|
24
|
+
</md-input-container>
|
25
|
+
<md-input-container class="md-block">
|
26
|
+
<label>Sortierschlüssel</label>
|
27
|
+
<input type="number" ng-model="app.selectedNode.order_key" step="1" />
|
28
|
+
</md-input-container>
|
29
|
+
<md-input-container class="md-block">
|
30
|
+
<md-checkbox ng-model="app.selectedNode.hide_from_navigation">In der Navigation verstecken?</md-checkbox>
|
31
|
+
</md-input-container>
|
32
|
+
<md-input-container class="md-block">
|
33
|
+
<label>Pfad: {{app.selectedNode.cms_path}}</label>
|
34
|
+
<input type="text" ng-value="app.selectedNode.cms_path" readonly />
|
35
|
+
</md-input-container>
|
36
|
+
|
37
|
+
<div layout="row">
|
38
|
+
<div flex="10">Inhalt</div>
|
39
|
+
<div flex="80" ng-if="app.selectedNode.page_type !== 'Binary'">
|
40
|
+
<textarea ui-tinymce="app.tinymceOptions" ng-model="app.selectedNode.content"></textarea>
|
41
|
+
</div>
|
42
|
+
<div flex="80" ng-if="app.selectedNode.page_type === 'Binary'">
|
43
|
+
<div style="border: 1px solid gray; min-height: 100px;" flex="100" layout="row">
|
44
|
+
<img ng-src="{{app.selectedNode.content}}" ng-if="app.selectedNode.isDataType('image')" style="max-width: 100%; height: auto;" />
|
45
|
+
{{app.selectedNode.content}}
|
46
|
+
</div>
|
47
|
+
<div class="md-button md-raised file-wrapper">
|
48
|
+
<input type="file" ngf-select="app.setBinaryContent($file, app.selectedNode)" />
|
49
|
+
Datei ändern
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div layout="row">
|
55
|
+
<input type="submit" value="speichern" class="md-button md-primary md-raised" />
|
56
|
+
</div>
|
57
|
+
</form>
|
58
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div ng-controller="ApplicationCtrl as app" ng-cloak>
|
2
|
+
<script type="text/ng-template" id="header/header.html">
|
3
|
+
<%= render partial: 'header' %>
|
4
|
+
</script>
|
5
|
+
<script type="text/ng-template" id="tree/tree.html">
|
6
|
+
<%= render partial: 'tree' %>
|
7
|
+
</script>
|
8
|
+
<script type="text/ng-template" id="page_types/page_types.html">
|
9
|
+
SEITENTYPEN
|
10
|
+
</script>
|
11
|
+
<script type="text/ng-template" id="attributes/attributes.html">
|
12
|
+
<%= render partial: 'attributes' %>
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<billy-header-toolbar></billy-header-toolbar>
|
16
|
+
|
17
|
+
<div ui-view></div>
|
18
|
+
|
19
|
+
</div>
|