rad_common_interface 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/Rakefile +1 -0
  2. data/app/static/demo/images/img1.jpg +0 -0
  3. data/app/static/demo/images/img1_200.jpg +0 -0
  4. data/app/static/demo/images/img1_icon.jpg +0 -0
  5. data/app/static/demo/images/img1_thumb.jpg +0 -0
  6. data/app/static/demo/images/img2.jpg +0 -0
  7. data/app/static/demo/images/img2_200.jpg +0 -0
  8. data/app/static/demo/images/img2_icon.jpg +0 -0
  9. data/app/static/demo/images/img2_thumb.jpg +0 -0
  10. data/app/static/demo/images/img3.jpg +0 -0
  11. data/app/static/demo/images/img3_200.jpg +0 -0
  12. data/app/static/demo/images/img3_icon.jpg +0 -0
  13. data/app/static/demo/images/img3_thumb.jpg +0 -0
  14. data/app/static/demo/images/img_big.jpg +0 -0
  15. data/app/static/demo/images/img_big_icon.jpg +0 -0
  16. data/app/static/demo/images/img_big_thum.jpg +0 -0
  17. data/app/static/demo/images/video_icon.png +0 -0
  18. data/app/static/face/attachments.js +85 -0
  19. data/app/static/face/dialogs.js +189 -0
  20. data/app/static/face/discussion.js +47 -0
  21. data/app/static/face/markup.js +53 -0
  22. data/app/static/face/more.js +33 -0
  23. data/app/static/face/table.js +24 -0
  24. data/app/static/face/tabs.js +26 -0
  25. data/app/static/face.css +8 -0
  26. data/app/static/face.js +109 -0
  27. data/app/static/lib/SimpleDialog/SimpleDialog.ContextMenu.js +36 -0
  28. data/app/static/lib/SimpleDialog/SimpleDialog.Image.js +121 -0
  29. data/app/static/lib/SimpleDialog/SimpleDialog.Mask.js +76 -0
  30. data/app/static/lib/SimpleDialog/SimpleDialog.Static.js +0 -0
  31. data/app/static/lib/SimpleDialog/SimpleDialog.css +12 -0
  32. data/app/static/lib/SimpleDialog/SimpleDialog.js +158 -0
  33. data/app/static/lib/ajax_file_uploading.js +33 -0
  34. data/app/static/themes/default/reset.css +127 -0
  35. data/app/static/themes/default/style/application.less +51 -0
  36. data/app/static/themes/default/style/aspects.less +15 -0
  37. data/app/static/themes/default/style/basic.less +49 -0
  38. data/app/static/themes/default/style/forms.less +34 -0
  39. data/app/static/themes/default/style/items.less +43 -0
  40. data/app/static/themes/default/style/markup.less +16 -0
  41. data/app/static/themes/default/style/micelaneous.less +10 -0
  42. data/app/static/themes/default/style/mixins.less +72 -0
  43. data/app/static/themes/default/style/styles.less +57 -0
  44. data/app/static/themes/default/style/tools.less +15 -0
  45. data/app/static/themes/default/style/variables.less +38 -0
  46. data/app/static/themes/default/style.css +944 -0
  47. data/app/static/themes/default/style.js +127 -0
  48. data/app/static/themes/default/style.less +22 -0
  49. data/app/static/vendor/flext.js +254 -0
  50. data/app/static/vendor/formalize/formalize.css +311 -0
  51. data/app/static/vendor/formalize/mootools.formalize.js +163 -0
  52. data/app/static/vendor/formalize/reset.css +171 -0
  53. data/app/static/vendor/iFrameFormRequest.js +95 -0
  54. data/app/static/vendor/mootools-more.js +4185 -0
  55. data/app/static/vendor/purr/purr.css +43 -0
  56. data/app/static/vendor/purr/purr.js +308 -0
  57. data/app/views/face/_attachments_tag.html.haml +17 -0
  58. data/app/views/rad/face/demo/commons/aspects.html.haml +32 -0
  59. data/app/views/rad/face/demo/commons/basic.html.haml +86 -0
  60. data/app/views/rad/face/demo/commons/forms.html.haml +57 -0
  61. data/app/views/rad/face/demo/commons/items.html.haml +32 -0
  62. data/app/views/rad/face/demo/commons/style.html.erb +111 -0
  63. data/app/views/rad/face/demo/dialogs/dialog.js.haml +1 -0
  64. data/app/views/rad/face/demo/dialogs/dialog_form.html.haml +7 -0
  65. data/app/views/rad/face/demo/dialogs/dialog_form.js.erb +1 -0
  66. data/app/views/rad/face/demo/dialogs/inplace/_element.html.haml +3 -0
  67. data/app/views/rad/face/demo/dialogs/inplace/_form.html.haml +3 -0
  68. data/app/views/rad/face/demo/dialogs/inplace.js.haml +1 -0
  69. data/app/views/rad/face/demo/dialogs/inplace_form.js.haml +2 -0
  70. data/app/views/rad/face/demo/dialogs/show.html.haml +27 -0
  71. data/app/views/rad/face/demo/helps/help.html.haml +1 -0
  72. data/app/views/rad/face/demo/helps/index.html.haml +25 -0
  73. data/app/views/rad/face/demo/layout.html.haml +3 -0
  74. data/app/views/rad/face/demo/layout.js.haml +11 -0
  75. data/app/views/rad/face/demo/shared/_comments.html.haml +11 -0
  76. data/app/views/rad/face/demo/shared/_core_tools.html.haml +6 -0
  77. data/app/views/rad/face/demo/shared/_line_previews.html.haml +40 -0
  78. data/app/views/rad/face/demo/shared/_paginator.html.haml +7 -0
  79. data/app/views/rad/face/demo/shared/_tools.html.haml +25 -0
  80. data/app/views/rad/face/demo/shared/_top_navigation_bottom.html.haml +34 -0
  81. data/app/views/rad/face/demo/sites/blog.html.haml +12 -0
  82. data/app/views/rad/face/demo/sites/home.html.haml +8 -0
  83. data/app/views/rad/face/demo/sites/post.html.haml +10 -0
  84. data/app/views/rad/face/demo/sites/style.html.haml +8 -0
  85. data/app/views/themes/default/application.html.haml +25 -0
  86. data/app/views/themes/default/basic_list.html.haml +2 -0
  87. data/app/views/themes/default/basic_list_item.html.haml +5 -0
  88. data/app/views/themes/default/bottom_panel.html.haml +16 -0
  89. data/app/views/themes/default/comment.html.haml +20 -0
  90. data/app/views/themes/default/controls.html.haml +3 -0
  91. data/app/views/themes/default/demo_metadata.rb +118 -0
  92. data/app/views/themes/default/details.html.haml +6 -0
  93. data/app/views/themes/default/discussion.html.haml +7 -0
  94. data/app/views/themes/default/divider.html.haml +2 -0
  95. data/app/views/themes/default/forms/errors.html.haml +4 -0
  96. data/app/views/themes/default/forms/field.html.haml +18 -0
  97. data/app/views/themes/default/forms/form.html.haml +4 -0
  98. data/app/views/themes/default/forms/line.html.haml +8 -0
  99. data/app/views/themes/default/help.html.haml +3 -0
  100. data/app/views/themes/default/html.html.haml +1 -0
  101. data/app/views/themes/default/index.html.haml +6 -0
  102. data/app/views/themes/default/item.html.haml +12 -0
  103. data/app/views/themes/default/layout_templates/dashboard.html.haml +1 -0
  104. data/app/views/themes/default/layout_templates/default.html.haml +22 -0
  105. data/app/views/themes/default/line.html.haml +21 -0
  106. data/app/views/themes/default/message.html.haml +2 -0
  107. data/app/views/themes/default/more.html.haml +8 -0
  108. data/app/views/themes/default/narrow.html.haml +2 -0
  109. data/app/views/themes/default/navigation.html.haml +16 -0
  110. data/app/views/themes/default/paginator.html.haml +8 -0
  111. data/app/views/themes/default/shared/details.html.haml +17 -0
  112. data/app/views/themes/default/table.html.haml +9 -0
  113. data/app/views/themes/default/table_row.html.haml +4 -0
  114. data/app/views/themes/default/tabs.html.haml +27 -0
  115. data/app/views/themes/default/tag_selector.html.haml +10 -0
  116. data/app/views/themes/default/text.html.haml +4 -0
  117. data/app/views/themes/default/thumb.html.haml +10 -0
  118. data/app/views/themes/default/title.html.haml +3 -0
  119. data/app/views/themes/default/tool.html.haml +5 -0
  120. data/app/views/themes/default/toolbar.html.haml +16 -0
  121. data/app/views/themes/default/top_panel.html.haml +18 -0
  122. metadata +153 -25
@@ -0,0 +1,7 @@
1
+ = b.title "Dialog Title"
2
+ - b.form_tag action: url_for(:dialog, format: :js) do |f|
3
+ = f.hidden_field_tag :theme, params.theme
4
+ = f.text_field_tag :name, "Some Name", label: "Name"
5
+ = f.text_area_tag :body, "Some text"
6
+ = f.check_box_tag :valid, true, label: 'Valid'
7
+ = f.line ok_button('Ok'), cancel_button('Cancel')
@@ -0,0 +1 @@
1
+ rad.dialog().show("<%= js render('dialog_form', format: 'html') %>");
@@ -0,0 +1,3 @@
1
+ #inplace_element
2
+ = h @text
3
+ = link_to('[edit]', :inplace_form, format: :js, theme: params.theme)
@@ -0,0 +1,3 @@
1
+ - b.form_tag action: url_for(:inplace, format: :js) do |f|
2
+ = f.text_area_tag :text, ''
3
+ = f.line ok_button, cancel_button
@@ -0,0 +1 @@
1
+ rad.inplace('#inplace_element').update("#{js render('inplace/element')}");
@@ -0,0 +1,2 @@
1
+ - form = js render('inplace/form', format: :html)
2
+ rad.inplace('#inplace_element').edit('#{form}');
@@ -0,0 +1,27 @@
1
+ = b.divider "Context Menu"
2
+ %a{href: "#", class: "the_context_menu_button", "data-content_id" => "add_content_menu"}
3
+ Add
4
+ #add_content_menu.hidden
5
+ %a{href: "#"} Page
6
+ %a{href: "#"} Note
7
+ %a{href: "#"} File
8
+
9
+ = b.divider "Dialog"
10
+ = link_to('Show Dialog', :dialog_form, format: :js, theme: params.theme)
11
+
12
+ = b.divider "Images"
13
+ - b.text do
14
+ %a{href: url_for("/static/demo/images/img1.jpg")}
15
+ %img{src: url_for("/static/demo/images/img1_icon.jpg")}
16
+ %a{href: url_for("/static/demo/images/img2.jpg")}
17
+ %img{src: url_for("/static/demo/images/img2_icon.jpg")}
18
+ %a{href: url_for("/static/demo/images/img3.jpg")}
19
+ %img{src: url_for("/static/demo/images/img3_icon.jpg")}
20
+ %a{href: url_for("/static/demo/images/img_big.jpg")}
21
+ %img{src: url_for("/static/demo/images/img_big_icon.jpg")}
22
+ .clear
23
+
24
+ Use Left/Right arrows to navigate between images.
25
+
26
+ = b.divider "In-place editor"
27
+ = render 'inplace/element'
@@ -0,0 +1 @@
1
+ = render themed_partial('/help')
@@ -0,0 +1,25 @@
1
+ - helps = Rad::Face::Demo::Helps
2
+ - commons = Rad::Face::Demo::Commons
3
+ - dialogs = Rad::Face::Demo::Dialogs
4
+
5
+ - theme = (params.theme || 'default').to_sym
6
+
7
+ = b.title "The :#{theme} theme:"
8
+
9
+ - b.basic_list do |o|
10
+ - o.content do
11
+ = b.basic_list_item link_to('Help', helps, :help, theme: theme)
12
+
13
+ - urls = %w{basic forms aspects style items}.collect{|action| link_to action.humanize, commons, action.to_sym, theme: theme}
14
+ = b.basic_list_item urls.join(', ')
15
+
16
+ = b.basic_list_item link_to('Dialogs', dialogs, :show, theme: theme)
17
+
18
+ %br
19
+
20
+ = render themed_partial('/index')
21
+ = render themed_partial('/index2') if theme == :default and template.exist?(themed_partial('/index2'))
22
+
23
+ %br
24
+
25
+ = b.text "Sources: <a href='http://github.com/alexeypetrushin/rad_common_interface'>http://github.com/alexeypetrushin/rad_common_interface</a>."
@@ -0,0 +1,3 @@
1
+ - content_for :head do
2
+ = stylesheet_link_tag '/themes/default/style.css'
3
+ = render themed_partial('/application')
@@ -0,0 +1,11 @@
1
+ = "try{"
2
+ - unless params._target.blank?
3
+ var target = $('#{params._target}');
4
+ - else
5
+ var target = $('body');
6
+
7
+ = yield
8
+
9
+ - if msg = flash.sticky_error || flash.error || flash.sticky_info || flash.info
10
+ rad.info("#{js msg}");
11
+ = "}catch(e){console.log(e)};"
@@ -0,0 +1,11 @@
1
+ - b.discussion id: "discussion_id", class: "discussion_class" do |o|
2
+ - o.name "3 comments"
3
+ - o.controls "<a href='#'>comment</a>"
4
+ - o.content do
5
+ - 3.times do |i|
6
+ - b.comment id: 'comment_id', class: 'comment_class' do |o|
7
+ - o.details samples.comment_details
8
+ - o.owner link_to("admin", '#')
9
+ - o.avatar image_tag(url_for("/static/demo/images/img1_icon.jpg")) unless i == 1
10
+ - o.text samples.comment_text
11
+ - o.controls samples.controls
@@ -0,0 +1,6 @@
1
+ - content_for :tools do
2
+ - b.tool name: "Parameters" do
3
+ - b.more name: "...", id: 'more' do
4
+ - b.basic_list do
5
+ = b.basic_list_item(tag(:a, "Update icon", href: '#'))
6
+ = b.basic_list_item(tag(:a, "Edit", href: '#') + " " + tag(:a, "Delete", href: '#'))
@@ -0,0 +1,40 @@
1
+ - attachment = samples.attachments.first
2
+ - b.line do |o|
3
+ - o.name samples.name
4
+ - o.image attachment
5
+ - o.text samples.detail_text
6
+ - o.url attachment.url
7
+ - o.controls samples.controls
8
+
9
+ - b.line do |o|
10
+ - o.name samples.name
11
+ - o.image attachment
12
+ - o.text samples.detail_text
13
+ - o.url attachment.url
14
+ - o.controls samples.controls
15
+ - o.tags samples.tags + ["<div class='m_item_type'>Note</div>"]
16
+ - o.details samples.details
17
+
18
+ - b.line do |o|
19
+ - o.name samples.name
20
+ - o.text samples.detail_text
21
+ - o.url attachment.url
22
+ - o.controls samples.controls
23
+ - o.tags samples.tags + ["<div class='m_item_type'>Page</div>"]
24
+ - o.details samples.details
25
+
26
+ - b.line do |o|
27
+ - o.name samples.name
28
+ - o.url attachment.url
29
+ - o.controls samples.controls
30
+ - o.tags samples.tags + ["<div class='m_item_type'>Task</div>"]
31
+ - o.details samples.details
32
+
33
+ - b.line do |o|
34
+ - o.name samples.name
35
+ - o.image attachment
36
+ - o.text samples.detail_text
37
+ - o.url attachment.url
38
+ - o.controls samples.controls
39
+ - o.tags samples.tags + ["<div class='m_item_type'>Note</div>"]
40
+ - o.details samples.details
@@ -0,0 +1,7 @@
1
+ - pages = %w{1 2 3 4 5 6 7}.collect{|t| "<a href='#'>#{t}</a>"}
2
+ - b.paginator do |o|
3
+ - o.prev "<a href='#'>Prev</a>"
4
+ - o.pages [1, 2, 3, 4, 5, 6, 7]
5
+ - o.to_link lambda{|t| "<a href='#'>#{t}</a>"}
6
+ - o.current_page 3
7
+ - o.next "<a href='#'>Next</a>"
@@ -0,0 +1,25 @@
1
+ - content_for :tools do
2
+ - b.tool do
3
+ - b.more name: "...", id: 'add_button' do |o|
4
+ - o.core do
5
+ = link_to 'Add', '#'
6
+ - o.more do
7
+ = link_to('Note', '#') + tag(:span, ', ')
8
+ = link_to 'Selector', '#'
9
+
10
+ - b.tool name: "Search" do
11
+ - form_tag do
12
+ = text_field_tag ''
13
+
14
+ - b.tool name: "Tags" do
15
+ - b.tag_selector do |o|
16
+ - o.selected ['hot', 'low']
17
+ - o.selected_tag_to_link lambda{|tag| link_to tag.name, '#'}
18
+ - o.tags [{name: 'top', count: 10}, {name: 'low', count: 1}, {name: 'hot', count: 7}, {name: 'middle', count: 3}, {name: 'middle', count: 3}, {name: 'middle', count: 3}, {name: 'ajax', count: 1}, {name: 'important', count: 4}, {name: 'artifical_intelligence', count: 6}, {name: 'google', count: 1}, {name: 'body', count: 2}, {name: 'sport', count: 8}].collect{|hash| hash.to_openobject}
19
+ - o.tag_to_link lambda{|tag| link_to tag.name, '#'}
20
+
21
+ - b.tool name: "Parameters" do
22
+ - b.more name: "...", id: 'more' do
23
+ - b.basic_list do
24
+ = b.basic_list_item(tag(:a, "Update icon", href: '#'))
25
+ = b.basic_list_item(tag(:a, "Edit", href: '#') + " " + tag(:a, "Delete", href: '#'))
@@ -0,0 +1,34 @@
1
+ - content_for :top_panel do
2
+ - b.top_panel id: "top_panel_id", class: "top_panel_class" do |o|
3
+ - o.logo_image demo_metadata.logo_image
4
+ - o.logo_text demo_metadata.logo_text
5
+ - o.left do |a|
6
+ - a.add 'Documents'
7
+ - a.add 'Main'
8
+
9
+ - o.right do |a|
10
+ - a.add "Hello, Guest"
11
+ - a.add link_to("Log In", "#")
12
+ - a.add link_to("Register", "#")
13
+
14
+
15
+ - content_for :navigation do
16
+ - b.navigation do |o|
17
+ - o.left do |a|
18
+ - samples.top_menu_items.each do |menu|
19
+ - if samples.active_top_menu == menu
20
+ - a.add content: menu, active: true
21
+ - else
22
+ - a.add link_to(menu, Rad::Face::Demo::Commons, :select_menu, top_menu: menu)
23
+
24
+ - o.right do |a|
25
+ - a.add content: 'en', active: true
26
+ - a.add link_to('ru', '#')
27
+
28
+
29
+ - content_for :bottom_panel do
30
+ - b.bottom_panel do |o|
31
+ - o.left do
32
+ Some bottom links
33
+ - o.right do
34
+ Powered by <a href='http://4ire.net'>4ire.net</a>
@@ -0,0 +1,12 @@
1
+ = render '/rad/face/demo/shared/top_navigation_bottom'
2
+
3
+ = render '/rad/face/demo/shared/tools'
4
+
5
+ - b.item do |o|
6
+ - o.name samples.name
7
+ - o.text samples.text
8
+ - o.controls samples.controls
9
+
10
+ = render '/rad/face/demo/shared/line_previews'
11
+
12
+ = render '/rad/face/demo/shared/paginator'
@@ -0,0 +1,8 @@
1
+ = render '/rad/face/demo/shared/top_navigation_bottom'
2
+
3
+ = render '/rad/face/demo/shared/core_tools'
4
+
5
+ - b.item id: "note_id", class: "note_class" do |o|
6
+ - o.text demo_metadata.homepage_html
7
+ - o.controls [link_to('edit', '#'), link_to('delete', '#')]
8
+ - o.details samples.details
@@ -0,0 +1,10 @@
1
+ = render '/rad/face/demo/shared/top_navigation_bottom'
2
+
3
+ = render '/rad/face/demo/shared/tools'
4
+
5
+ - b.item id: "note_id", class: "note_class" do |o|
6
+ - o.text samples.text
7
+ - o.controls [link_to('edit', '#'), link_to('delete', '#')]
8
+ - o.details samples.details
9
+
10
+ = render '/rad/face/demo/shared/comments'
@@ -0,0 +1,8 @@
1
+ = render '/rad/face/demo/shared/top_navigation_bottom'
2
+
3
+ = render '/rad/face/demo/shared/tools'
4
+
5
+ - b.item id: "note_id", class: "note_class" do |o|
6
+ - o.text demo_metadata.style_html
7
+ - o.controls [link_to('edit', '#'), link_to('delete', '#')]
8
+ - o.details samples.details
@@ -0,0 +1,25 @@
1
+ !!! 5
2
+ %html{lang: I18n.locale}
3
+
4
+ %head
5
+ %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
6
+ - unless (title = @html_title || @title || respond_to(:title)).blank?
7
+ %title= h title
8
+
9
+ %link{rel: "icon", href: "/favicon.ico", type: "image/x-icon"}
10
+
11
+ = stylesheet_link_tag '/themes/default/reset.css'
12
+ = stylesheet_link_tag '/face.css'
13
+ = yield :head
14
+
15
+ %body
16
+ = yield :top_panel
17
+ = yield :navigation
18
+
19
+ = render themed_partial("/layout_templates/#{theme.layout_template}")
20
+
21
+ = yield :bottom_panel
22
+
23
+ = javascript_include_tag '/face.js'
24
+ = yield :bottom
25
+ = call_deferred_js
@@ -0,0 +1,2 @@
1
+ - if object.content?
2
+ = tag :div, object.content, object.merge_html_attributes(class: " the_basic_list")
@@ -0,0 +1,5 @@
1
+ - if object.content?
2
+ - tag :div, object.merge_html_attributes(class: " l_item") do
3
+ - if object.check_box?
4
+ .l_check_box= object.check_box
5
+ .l_content= object.content
@@ -0,0 +1,16 @@
1
+ - if object.content? or object.left? or object.right?
2
+ - tag :div, object.merge_html_attributes(class: " the_bottom_panel") do
3
+ .css_box
4
+ - if object.content? or object.left?
5
+ .l_left
6
+ .l_item
7
+ = object.content
8
+ = object.left.content
9
+ .css_clear
10
+
11
+ - if object.right?
12
+ .l_right
13
+ .l_item= object.right.content
14
+ .css_clear
15
+
16
+ .css_clear
@@ -0,0 +1,20 @@
1
+ - tag :div, object.merge_html_attributes(class: " the_comment m_selectable") do
2
+ - body = capture do
3
+ .l_text.m_markup
4
+ = object.text
5
+ .css_clear
6
+ - if object.controls?
7
+ .m_hover_controls= object.controls.join(' ')
8
+ - if object.avatar?
9
+ %table.css_table
10
+ %tbody
11
+ %tr
12
+ %td.css_td1
13
+ .l_image= object.avatar
14
+ %td.css_td2
15
+ = body
16
+ - else
17
+ = body
18
+ .m_details= (object.details.to_a + object.owner.to_a).join(', ')
19
+ .css_clear
20
+
@@ -0,0 +1,3 @@
1
+ - object.class ||= ""
2
+ - object.class << " thecontrols"
3
+ = b.toolbar object
@@ -0,0 +1,118 @@
1
+ base = "/face"
2
+
3
+ m = {
4
+ logo_text: "BOS Tec",
5
+ logo_image: nil
6
+ }
7
+
8
+ m[:homepage_html] = <<HTML
9
+ <p>The Terminator (1984) <a href='#'>More at IMDbPro</a></p>
10
+ <p>In the Year of Darkness, 2029, the rulers of this planet devised the ultimate plan. They would reshape the Future by changing the Past. The plan required something that felt no pity. No pain. No fear. Something unstoppable. They created 'THE TERMINATOR'</p>
11
+ <p>The thing that won't die, in the nightmare that won't end. A human-looking, apparently unstoppable cyborg is sent from the future to kill Sarah Connor; Kyle Reese is sent to stop it.</p>
12
+ <p>Your future is in his hands.</p>
13
+ HTML
14
+
15
+ m[:style_html] = <<HTML
16
+ <h1>Heading 1</h1>
17
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
18
+
19
+ <h2>Heading 2</h2>
20
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
21
+
22
+ <h3>Heading 3</h3>
23
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
24
+
25
+ <h4>Heading 4</h4>
26
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
27
+
28
+ <div class="content-separator"></div>
29
+
30
+ <h2>Images in text</h2>
31
+
32
+ <img src="#{base}/images/demo/img1_thumb.jpg">
33
+
34
+ <p>Curabitur faucibus risus quis lectus. <a href="#">Donec vehicula</a>. Pellentesque nec, lectus. Nullam dictum sem. Phasellus varius. Vestibulum in felis in mauris consequat molestie</p>
35
+
36
+ <div class="content-separator"></div>
37
+
38
+ <h2>Blockquote</h2>
39
+
40
+ <blockquote>
41
+ <p>Praesent orci nisi, interdum quis, tristique vitae, consectetur sed, arcu. Ut at sapien non dolor semper sollicitudin. Etiam semper erat quis odio. Quisque commodo suscipit velit. Nulla facilisi.</p>
42
+ <p><cite>- Duis justo quam</cite></p>
43
+ </blockquote>
44
+
45
+ <div class="content-separator"></div>
46
+
47
+ <h2>Lists</h2>
48
+
49
+ <h3>Unsorted list</h3>
50
+ <ul>
51
+ <li>Blandit in, interdum a</li>
52
+ <li>Ultrices non lectus</li>
53
+ <li>Nunc id odio</li>
54
+ <li>Fusce ultricies</li>
55
+ </ul>
56
+
57
+ <h3>Ordered list</h3>
58
+ <ol>
59
+ <li>Blandit in, interdum a</li>
60
+ <li>Ultrices non lectus</li>
61
+ <li>Nunc id odio</li>
62
+ <li>Fusce ultricies</li>
63
+ </ol>
64
+
65
+ <h3>Definition list</h3>
66
+
67
+ <dl>
68
+ <dt>title</dt>
69
+ <dd>definition</dd>
70
+ <dd>definition</dd>
71
+ <dt>title</dt>
72
+ <dt>title</dt>
73
+ <dd>definition</dd>
74
+ <dt>title</dt>
75
+ <dd>definition</dd>
76
+ </dl>
77
+
78
+ <div class="content-separator"></div>
79
+
80
+ <h2>Tables</h2>
81
+
82
+ <h3>Data table</h3>
83
+
84
+ <table class="data-table">
85
+ <tbody><tr>
86
+ <th>Property 1</th>
87
+ <th>Property 2</th>
88
+ <th>Property 3</th>
89
+ <th>Property 4</th>
90
+ </tr>
91
+ <tr class="even">
92
+ <td>Value 1.1</td>
93
+ <td>Value 1.2</td>
94
+ <td>Value 1.3</td>
95
+ <td>Value 1.4</td>
96
+ </tr>
97
+ <tr>
98
+ <td>Value 2.1</td>
99
+ <td>Value 2.2</td>
100
+ <td>Value 2.3</td>
101
+ <td>Value 2.4</td>
102
+ </tr>
103
+ <tr class="even">
104
+ <td>Value 3.1</td>
105
+ <td>Value 3.2</td>
106
+ <td>Value 3.3</td>
107
+ <td>Value 3.4</td>
108
+ </tr>
109
+ <tr>
110
+ <td>Value 4.1</td>
111
+ <td>Value 4.2</td>
112
+ <td>Value 4.3</td>
113
+ <td>Value 4.4</td>
114
+ </tr>
115
+ </tbody></table>
116
+ HTML
117
+
118
+ m
@@ -0,0 +1,6 @@
1
+ - tag :div, object.merge_html_attributes(class: " the_details") do
2
+ - if object.tags?
3
+ .m_tags= object.tags.join(' ')
4
+ - if object.details?
5
+ .m_details= object.details.to_a.join(', ')
6
+ .css_clear
@@ -0,0 +1,7 @@
1
+ - tag :div, object.merge_html_attributes(class: " the_discussion") do
2
+ / .divider.hidden
3
+ / .divider_title= object.name
4
+ .l_comments= object.content.to_a.join("\n")
5
+ - if object.controls?
6
+ .l_controls= object.controls.to_a.join("\n")
7
+ .css_clear
@@ -0,0 +1,2 @@
1
+ - tag :div, object.merge_html_attributes(class: " the_divider") do
2
+ = object.content
@@ -0,0 +1,4 @@
1
+ - unless object.empty?
2
+ .l_errors
3
+ - object.each do |message|
4
+ .l_error= message
@@ -0,0 +1,18 @@
1
+ - errors = object.errors.collect{|msg| tag(:div, msg, class: "l_error")}.join("\n")
2
+ - body = capture do
3
+ .l_input= object.content
4
+ - unless errors.blank?
5
+ .l_errors= errors
6
+ - if object.description?
7
+ .l_description= object.description
8
+ .l_field
9
+ - if object.label?
10
+ %table.css_table
11
+ %tbody
12
+ %tr
13
+ %td.css_td1
14
+ %div{class: "l_label#{' l_required' if object.required?}"}= object.label
15
+ %td.css_td2
16
+ = body
17
+ - else
18
+ = body
@@ -0,0 +1,4 @@
1
+ - object.merge_html_attributes(id: object.id) if object.id?
2
+ - tag :div, object.merge_html_attributes(class: " the_form") do
3
+ - form_tag *object.form_attributes do
4
+ = object.content
@@ -0,0 +1,8 @@
1
+ - if object.items?
2
+ .l_line
3
+ - object.items.each do |item|
4
+ .l_item= item
5
+ .css_clear
6
+ - else
7
+ / preserving space if line empty
8
+ .l_line
@@ -0,0 +1,3 @@
1
+ = b.title "Default Theme"
2
+
3
+ TODO2 add help page for default theme.
@@ -0,0 +1 @@
1
+ Some custom HTML
@@ -0,0 +1,6 @@
1
+ - sites = Rad::Face::Demo::Sites
2
+
3
+ - b.basic_list do |o|
4
+ - o.content do
5
+ - urls = %w{home style blog post}.collect{|action| link_to action.humanize, sites, action.to_sym, theme: 'default'}
6
+ = b.basic_list_item urls.join(', ')
@@ -0,0 +1,12 @@
1
+ - tag :div, object.merge_html_attributes(class: " the_item m_selectable") do
2
+ - if object.controls?
3
+ .m_hover_controls= object.controls.join(' ')
4
+
5
+ - if object.name?
6
+ %h1.m_title= object.name
7
+
8
+ .l_text.m_markup
9
+ = object.text
10
+ .css_clear
11
+
12
+ = render themed_partial('/shared/details'), object: object
@@ -0,0 +1 @@
1
+ - raise 'not impl'
@@ -0,0 +1,22 @@
1
+ .css_box
2
+ - content = capture do
3
+ - if (top_aspects = yield :top_aspects).present?
4
+ .the_aspects= top_aspects
5
+ - if (content = yield :content).present?
6
+ .the_content= content
7
+ - if (aspects = yield :aspects).present? or (bottom_aspects = yield :bottom_aspects).present?
8
+ .the_aspects
9
+ = aspects
10
+ = bottom_aspects
11
+ - if (tools = yield :tools).present?
12
+ %table.css_table
13
+ %tbody
14
+ %tr
15
+ %td.css_td1
16
+ = content
17
+ %td.css_td2
18
+ .the_tools
19
+ = tools
20
+ - else
21
+ .css_box
22
+ = content
@@ -0,0 +1,21 @@
1
+ - tag :div, object.merge_html_attributes(class: " the_line m_selectable") do
2
+ - if object.controls?
3
+ .m_hover_controls= object.controls.join(' ')
4
+ - body = capture do
5
+ %a{href: object.url, class: 'l_title'}= object.name? ? object.name : "(#{t(:empty)})"
6
+ - if object.text?
7
+ .l_text= object.text
8
+ - if object.image?
9
+ %table.css_table
10
+ %tbody
11
+ %tr
12
+ %td.css_td1
13
+ .l_image
14
+ %a{href: object.url}
15
+ %img{src: object.image.icon_url}
16
+ %td.css_td2
17
+ = body
18
+ - else
19
+ = body
20
+ .css_clear
21
+ = render themed_partial('/shared/details'), object: object
@@ -0,0 +1,2 @@
1
+ - if object.content?
2
+ = tag :div, object.content, object.merge_html_attributes(class: " the_#{object.type || 'info'}_message")
@@ -0,0 +1,8 @@
1
+ - more = object.more || object.content
2
+ - if object.core? or present?(more)
3
+ - raise "you should provide unique id for b.more element (to allow it remember it's state in ajax requests')!" unless object.id?
4
+ - core_id, more_id = "#{object.id}_core", "#{object.id}_more"
5
+ = tag :span, object.core, id: core_id if object.core?
6
+ - if more.present?
7
+ = tag :a, object.name, class: "the_more", href: '#', 'data-id' => object.id
8
+ .hidden{id: more_id}= more
@@ -0,0 +1,2 @@
1
+ - if object.content?
2
+ = tag :div, object.content, object.merge_html_attributes(class: " the_narrow")