common_interface 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/Rakefile +8 -63
  2. data/lib/views/CommonInterface/Demo/Basic/_dialog.html.haml +7 -0
  3. data/lib/views/CommonInterface/Demo/Basic/_popup.html.haml +4 -0
  4. data/lib/views/CommonInterface/Demo/Basic/aspects.html.haml +32 -0
  5. data/lib/views/CommonInterface/Demo/Basic/basic.html.haml +122 -0
  6. data/lib/views/CommonInterface/Demo/Basic/dialog.js.erb +1 -0
  7. data/lib/views/CommonInterface/Demo/Basic/folder.html.haml +45 -0
  8. data/lib/views/CommonInterface/Demo/Basic/help.html.haml +7 -0
  9. data/lib/views/CommonInterface/Demo/Basic/index.html.haml +24 -0
  10. data/lib/views/CommonInterface/Demo/Basic/items.html.haml +91 -0
  11. data/lib/views/CommonInterface/Demo/Basic/list.html.haml +23 -0
  12. data/lib/views/CommonInterface/Demo/Basic/page.html.haml +19 -0
  13. data/lib/views/CommonInterface/Demo/Basic/page/_folder.html.haml +10 -0
  14. data/lib/views/CommonInterface/Demo/Basic/page/_note.html.haml +4 -0
  15. data/lib/views/CommonInterface/Demo/Basic/page/_toolbar.html.haml +5 -0
  16. data/lib/views/CommonInterface/Demo/Basic/popup.js.erb +1 -0
  17. data/lib/views/CommonInterface/Demo/Basic/selector.html.haml +38 -0
  18. data/lib/views/CommonInterface/Demo/Basic/style.html.erb +113 -0
  19. data/lib/views/CommonInterface/Demo/Basic/tmp.haml +2 -0
  20. data/lib/views/CommonInterface/Demo/Basic/user.html.haml +16 -0
  21. data/lib/views/CommonInterface/Demo/Site/blog.html.haml +13 -0
  22. data/lib/views/CommonInterface/Demo/Site/home.html.haml +9 -0
  23. data/lib/views/CommonInterface/Demo/Site/post.html.haml +11 -0
  24. data/lib/views/CommonInterface/Demo/Site/style.html.haml +9 -0
  25. data/lib/views/CommonInterface/Demo/layouts/theme.html.erb +1 -0
  26. data/lib/views/CommonInterface/Demo/layouts/theme.js.erb +14 -0
  27. data/lib/views/CommonInterface/Demo/shared/_comments.html.haml +11 -0
  28. data/lib/views/CommonInterface/Demo/shared/_core_tools.html.haml +6 -0
  29. data/lib/views/CommonInterface/Demo/shared/_line_previews.html.haml +39 -0
  30. data/lib/views/CommonInterface/Demo/shared/_paginator.html.haml +7 -0
  31. data/lib/views/CommonInterface/Demo/shared/_tools.html.haml +26 -0
  32. data/lib/views/CommonInterface/Demo/shared/_top_navigation_bottom.html.haml +32 -0
  33. data/lib/views/layouts/config/default.yml +14 -0
  34. data/lib/views/layouts/config/simple_organization.yml +24 -0
  35. data/lib/views/themes/default/application.html.haml +29 -0
  36. data/lib/views/themes/default/aspects/comment.html.haml +14 -0
  37. data/lib/views/themes/default/aspects/controls.html.haml +3 -0
  38. data/lib/views/themes/default/aspects/details.html.haml +6 -0
  39. data/lib/views/themes/default/aspects/discussion.html.haml +9 -0
  40. data/lib/views/themes/default/aspects/paginator.html.haml +8 -0
  41. data/lib/views/themes/default/aspects/tag_selector.html.haml +11 -0
  42. data/lib/views/themes/default/basic/bottom_panel.html.haml +9 -0
  43. data/lib/views/themes/default/basic/dialog.html.haml +1 -0
  44. data/lib/views/themes/default/basic/divider.html.haml +2 -0
  45. data/lib/views/themes/default/basic/html.html.haml +1 -0
  46. data/lib/views/themes/default/basic/inplace.html.haml +1 -0
  47. data/lib/views/themes/default/basic/message.html.haml +3 -0
  48. data/lib/views/themes/default/basic/more.html.haml +5 -0
  49. data/lib/views/themes/default/basic/narrow.html.haml +1 -0
  50. data/lib/views/themes/default/basic/navigation.html.haml +9 -0
  51. data/lib/views/themes/default/basic/popup.html.haml +1 -0
  52. data/lib/views/themes/default/basic/text.html.haml +1 -0
  53. data/lib/views/themes/default/basic/title.html.haml +3 -0
  54. data/lib/views/themes/default/basic/tool.html.haml +4 -0
  55. data/lib/views/themes/default/basic/top_panel.html.haml +18 -0
  56. data/lib/views/themes/default/components/basic_list.html.haml +1 -0
  57. data/lib/views/themes/default/components/basic_list_item.html.haml +4 -0
  58. data/lib/views/themes/default/components/table.html.haml +12 -0
  59. data/lib/views/themes/default/components/table_row.html.haml +5 -0
  60. data/lib/views/themes/default/components/tabs.html.haml +4 -0
  61. data/lib/views/themes/default/components/tabs_item.html.haml +4 -0
  62. data/lib/views/themes/default/components/toolbar.html.haml +14 -0
  63. data/lib/views/themes/default/forms/errors.html.haml +5 -0
  64. data/lib/views/themes/default/forms/field.html.haml +19 -0
  65. data/lib/views/themes/default/forms/form.html.haml +5 -0
  66. data/lib/views/themes/default/forms/line.html.haml +6 -0
  67. data/lib/views/themes/default/help.html.haml +1 -0
  68. data/lib/views/themes/default/items/file.html.haml +19 -0
  69. data/lib/views/themes/default/items/folder.html.haml +23 -0
  70. data/lib/views/themes/default/items/line.html.haml +34 -0
  71. data/lib/views/themes/default/items/list.html.haml +35 -0
  72. data/lib/views/themes/default/items/list_item.html.haml +16 -0
  73. data/lib/views/themes/default/items/note.html.haml +16 -0
  74. data/lib/views/themes/default/items/page.html.haml +29 -0
  75. data/lib/views/themes/default/items/selector.html.haml +18 -0
  76. data/lib/views/themes/default/items/thumb.html.haml +12 -0
  77. data/lib/views/themes/default/items/user.html.haml +12 -0
  78. data/lib/views/themes/default/layout_templates/dashboard.html.haml +1 -0
  79. data/lib/views/themes/default/layout_templates/default.html.haml +11 -0
  80. data/lib/views/themes/default/metadata.rb +117 -0
  81. data/lib/views/themes/simple_organization/application.html.erb +45 -0
  82. data/lib/views/themes/simple_organization/application_js.html.erb +12 -0
  83. data/lib/views/themes/simple_organization/aspects/comment.html.haml +21 -0
  84. data/lib/views/themes/simple_organization/aspects/discussion.html.haml +14 -0
  85. data/lib/views/themes/simple_organization/aspects/paginator.html.haml +5 -0
  86. data/lib/views/themes/simple_organization/aspects/tag_selector.html.haml +10 -0
  87. data/lib/views/themes/simple_organization/basic/bottom_panel.html.erb +12 -0
  88. data/lib/views/themes/simple_organization/basic/divider.html.erb +3 -0
  89. data/lib/views/themes/simple_organization/basic/message.html.erb +7 -0
  90. data/lib/views/themes/simple_organization/basic/more.html.haml +5 -0
  91. data/lib/views/themes/simple_organization/basic/navigation.html.erb +15 -0
  92. data/lib/views/themes/simple_organization/basic/text.html.haml +1 -0
  93. data/lib/views/themes/simple_organization/basic/tool.html.erb +9 -0
  94. data/lib/views/themes/simple_organization/basic/top_panel.html.erb +14 -0
  95. data/lib/views/themes/simple_organization/help.html.erb +1 -0
  96. data/lib/views/themes/simple_organization/items/line.html.haml +17 -0
  97. data/lib/views/themes/simple_organization/items/note.html.haml +16 -0
  98. data/lib/views/themes/simple_organization/items/selector.html.haml +11 -0
  99. data/lib/views/themes/simple_organization/layout_templates/default.html.erb +20 -0
  100. data/lib/views/themes/simple_organization/layout_templates/home.html.erb +14 -0
  101. data/lib/views/themes/simple_organization/metadata.rb +193 -0
  102. data/spec/basic_spec.rb +2 -2
  103. data/spec/helper.rb +1 -2
  104. metadata +104 -5
  105. data/spec/spec.opts +0 -4
@@ -0,0 +1,29 @@
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 *merged_stylesheets(:common_interface_base)
12
+
13
+ = yield :head
14
+
15
+ %body
16
+ .dlayout
17
+ = yield :top_panel
18
+
19
+ .dmax_width
20
+ = yield :navigation
21
+
22
+ = render themed_partial("layout_templates/#{current_theme.layout_template}")
23
+
24
+ = yield :bottom_panel
25
+
26
+ = javascript_include_tag *merged_javascripts(:common_interface_base)
27
+ = javascript_tag "$.refresh_js_css();"
28
+
29
+ = yield :bottom
@@ -0,0 +1,14 @@
1
+ - tag :div, object.merge_html_attributes(:class => " dcomment _comment dselectable_item") do
2
+ .dhover_controls_container
3
+ - if object.controls?
4
+ .dhover_controls= object.controls.join(' ')
5
+
6
+ .dcolumns
7
+ .dfixed.dcolumn{:width => 50}
8
+ .dicon= object.avatar
9
+ .delastic.dcolumn
10
+ .dtext._markup.dmarkup= object.text
11
+
12
+ - if object.details?
13
+ .ditem_details= object.details.to_a.join(', ')
14
+ ._clear
@@ -0,0 +1,3 @@
1
+ - object.class ||= ""
2
+ - object.class << " aspect _aspect"
3
+ = b.toolbar object
@@ -0,0 +1,6 @@
1
+ - tag :div, object.merge_html_attributes(:class => " ddetails_aspect _details aspect _aspect") do
2
+ - if object.tags?
3
+ .ditem_tags= object.tags.join(' ')
4
+ - if object.details?
5
+ .ditem_details= object.details.to_a.join(', ')
6
+ ._clear
@@ -0,0 +1,9 @@
1
+ - tag :div, object.merge_html_attributes(:class => " ddiscussion _discussion aspect _aspect") do
2
+ / .ddivider._hidden
3
+ / .ddivider_title= object.name
4
+
5
+ ._comments= object.content.to_a.join("\n")
6
+
7
+ - if object.controls?
8
+ .dcontrols= object.controls.to_a.join("\n")
9
+ ._clear
@@ -0,0 +1,8 @@
1
+ .dpaginator
2
+ = object.prev if object.prev?
3
+ - object.pages.each do |page|
4
+ - if page == object.current_page
5
+ = tag(:span, page, :class => :dcurrent)
6
+ - else
7
+ = object.to_link.call(page)
8
+ = object.next if object.next?
@@ -0,0 +1,11 @@
1
+ - if object.tags?
2
+ - tag :div, object.merge_html_attributes(:class => " dtag_selector") do
3
+ .dtags
4
+ - classes = ['dsize_1', 'dsize_2', 'dsize_3', 'dsize_4']
5
+ - tag_cloud object.tags, classes do |tag, aclass|
6
+ - if object.selected.include? tag.name
7
+ .dtag.dselected{:class => aclass}
8
+ = object.selected_tag_to_link.call tag
9
+ - else
10
+ .dtag{:class => aclass}
11
+ = object.tag_to_link.call tag
@@ -0,0 +1,9 @@
1
+ .dbottom_panel
2
+ .dmax_width
3
+ .dcontent.dleft_right
4
+ = object.content
5
+
6
+ .dleft= object.left.content
7
+ .dright= object.right.content
8
+
9
+ ._clear
@@ -0,0 +1 @@
1
+ = tag :div, object.content, object.merge_html_attributes(:class => " ddialog _dialog")
@@ -0,0 +1,2 @@
1
+ - tag :div, object.merge_html_attributes(:class => " _divider ddivider") do
2
+ .ddivider_title= object.content
@@ -0,0 +1 @@
1
+ Some custom HTML
@@ -0,0 +1 @@
1
+ = tag :div, object.content, object.merge_html_attributes(:class => " _inplace dinplace")
@@ -0,0 +1,3 @@
1
+ - if object.content?
2
+ - tag :div, object.merge_html_attributes(:class => " dmessage") do
3
+ = tag :div, object.content, :class => ((object.type || 'dinfo') + " d#{object.type}")
@@ -0,0 +1,5 @@
1
+ - raise "you should provide unique id for b.more element (to allow it remember it's state in ajax requests')!" unless object.id?
2
+ - if object.content?
3
+ - tag :div, object.merge_html_attributes(:class => " dmore _more") do
4
+ %a{:href => '#', :class => '_button'}= object.name
5
+ ._content._hidden= object.content
@@ -0,0 +1 @@
1
+ = tag :div, object.content, object.merge_html_attributes(:class => " dnarrow") if object.content?
@@ -0,0 +1,9 @@
1
+ - if object.items?
2
+ - tag :div, object.merge_html_attributes(:class => " dnavigation dtabs") do
3
+ - object.items.each do |item|
4
+ - if item.hash? and item.active?
5
+ .dtab_item.dactive= item.content
6
+ - else
7
+ .dtab_item= item.content
8
+
9
+ ._clear
@@ -0,0 +1 @@
1
+ = tag :div, object.content, object.merge_html_attributes(:class => " dpopup _popup")
@@ -0,0 +1 @@
1
+ = tag :div, object.content, object.merge_html_attributes(:class => " dmarkup _markup") if object.content?
@@ -0,0 +1,3 @@
1
+ / = tag :div, object.content, object.merge_html_attributes(:class => " content_title") if object.content?
2
+ - if object.content?
3
+ %h1= object.content
@@ -0,0 +1,4 @@
1
+ - if object.content?
2
+ - tag :div, object.merge_html_attributes(:class => " dtool _tool") do
3
+ .dtitle= object.name if object.name?
4
+ .dcontent= object.content
@@ -0,0 +1,18 @@
1
+ - if object.logo? or object.left? or object.right?
2
+ .dtop_panel
3
+ .dmax_width
4
+ .dcontent.dleft_right
5
+
6
+ - if object.left? or object.logo?
7
+ .dleft
8
+ %b.dlogo= object.logo + (object.left? ? " | " : '') if object.logo?
9
+
10
+ - object.left.each do |item|
11
+ .dlr_item= item.blank? ? ' | ' : item
12
+
13
+ - if object.right?
14
+ .dright
15
+ - object.right.each do |item|
16
+ .dlr_item= item.blank? ? ' | ' : item
17
+
18
+ ._clear
@@ -0,0 +1 @@
1
+ = tag :div, object.content, object.merge_html_attributes(:class => " basic_list") if object.content?
@@ -0,0 +1,4 @@
1
+ - if object.content?
2
+ - tag :div, object.merge_html_attributes(:class => " dlist_item") do
3
+ .dcheck_box= object.check_box if object.check_box?
4
+ .dcontent= object.content
@@ -0,0 +1,12 @@
1
+ - if object.head? or object.rows?
2
+ - tag :div, object.merge_html_attributes(:class => " dtable _table") do
3
+ %table
4
+
5
+ - if object.head?
6
+ %thead
7
+ %tr
8
+ - object.head.each do |item|
9
+ %th
10
+ .dheadcell= item
11
+
12
+ %tbody._content= object.rows.to_a.join("\n")
@@ -0,0 +1,5 @@
1
+ - if object.content?
2
+ - tag :tr, object.merge_html_attributes(:class => " _row") do
3
+ - object.content.each do |cell|
4
+ %td
5
+ .dcell= cell.content
@@ -0,0 +1,4 @@
1
+ - if object.content?
2
+ - tag :div, object.merge_html_attributes(:class => " dtabs") do
3
+ = object.content.to_a.join("\n")
4
+ ._clear
@@ -0,0 +1,4 @@
1
+ - if object and object.active?
2
+ .dtab_item.dactive= object.content
3
+ - else
4
+ .dtab_item= object.content
@@ -0,0 +1,14 @@
1
+ - if object.left? or object.right?
2
+ - tag :div, object.merge_html_attributes(:class => " dpage_toolbar dleft_right") do
3
+
4
+ - if object.left?
5
+ .dleft
6
+ - object.left.each do |item|
7
+ .dlr_item= item.content
8
+
9
+ - if object.right?
10
+ .dright
11
+ - object.right.each do |item|
12
+ .dlr_item= item.content
13
+
14
+ ._clear
@@ -0,0 +1,5 @@
1
+ - unless object.empty?
2
+ .dcolumn.dspan-4
3
+ .dbase_errors
4
+ - object.each do |message|
5
+ .dbase_error= message
@@ -0,0 +1,19 @@
1
+ - errors = object.errors.collect{|msg| tag(:div, msg, :class => "derror")}.join("\n")
2
+ - if object.label?
3
+ .dcolumn
4
+ %div{:class => "dcontainer dform_item #{'requiredfield' if object.required?}"}= object.label
5
+ .delastic.dcolumn.dspan-3
6
+ .dform_item.dfield
7
+ .dinput= object.content
8
+ - unless errors.blank?
9
+ .derrors= errors
10
+ - if object.description?
11
+ .ddescription= object.description
12
+ - else
13
+ .dcolumn.dspan-4
14
+ .dform_item.dfield
15
+ .dinput= object.content
16
+ - unless errors.blank?
17
+ .derrors= errors
18
+ - if object.description?
19
+ .ddescription= object.description
@@ -0,0 +1,5 @@
1
+ - object.merge_html_attributes(:id => object.id) if object.id?
2
+ - tag :div, object.merge_html_attributes(:class => " dform") do
3
+ - tag :form, object.form_attributes do
4
+ .dcolumns.don-4
5
+ = object.content
@@ -0,0 +1,6 @@
1
+ - if object.items?
2
+ .dcolumn.dspan-4
3
+ .dform_item.line
4
+ - object.items.each_with_index do |item, index|
5
+ = (object.delimiter? ? " | " : "") if index != 0
6
+ .control= item
@@ -0,0 +1 @@
1
+ TODO Help page for Default Template
@@ -0,0 +1,19 @@
1
+ - tag :div, object.merge_html_attributes(:class => " dselectable_item dfile_item") do
2
+ .dhover_controls_container
3
+ .dhover_controls= object.controls.join(' ') if object.controls?
4
+
5
+ .dcolumns
6
+ .dfixed.dcolumn{:width => 50}
7
+ .dicon
8
+ %a{:href => object.url}
9
+ %img{:src => object.icon}
10
+ .delastic.dcolumn
11
+ .ddetails
12
+ %a{:href => object.url}
13
+ .dtitle= object.name? ? object.name : '&nbsp;'
14
+
15
+ - if object.tags?
16
+ .ditem_tags= object.tags.join("\n")
17
+ - if object.details?
18
+ .ditem_details= object.details.to_a.join(', ')
19
+ ._clear
@@ -0,0 +1,23 @@
1
+ - tag :div, object.merge_html_attributes(:class => " _folder dfolder dselectable_item") do
2
+ .dhover_controls_container
3
+ .dhover_controls= object.controls.join(' ') if object.controls?
4
+
5
+ - if object.name?
6
+ %h1.item_title= object.name? ? object.name : '&nbsp;'
7
+ - else
8
+ %h1.item_title.empty_title
9
+ &nbsp;
10
+
11
+ ._container
12
+ = object.content.to_a.join("\n")
13
+ ._clear
14
+
15
+ - unless object.name? or object.content?
16
+ .dtitle= "(#{t(:empty)})"
17
+
18
+ - if object.tags?
19
+ .ditem_tags= object.tags.join("\n")
20
+
21
+ - if object.details?
22
+ .ditem_details= object.details.to_a.join(', ')
23
+ ._clear
@@ -0,0 +1,34 @@
1
+ - tag :div, object.merge_html_attributes(:class => " dselectable_item dline_item") do
2
+ .dhover_controls_container
3
+ .dhover_controls= object.controls.join(' ') if object.controls?
4
+ - object_name = object.name? ? object.name : '&nbsp;'
5
+ - if object.icon? or object.text?
6
+ - if object.icon?
7
+ .dcolumns
8
+ .dfixed.dcolumn{:width => 50}
9
+ .dicon
10
+ %a{:href => object.url}
11
+ %img{:src => object.icon}
12
+ .delastic.dcolumn
13
+ .ddetails
14
+ - if object.name?
15
+ %a{:href => object.url}
16
+ .dpreview_title= object_name
17
+ .dtext= object.text if object.text?
18
+ - else
19
+ .ddetails
20
+ - if object.name?
21
+ %a{:href => object.url}
22
+ .dpreview_title= object_name
23
+ .dtext= object.text if object.text?
24
+
25
+ - else
26
+ .dsingle_line
27
+ %a{:href => object.url}
28
+ .dpreview_title= object_name
29
+
30
+ - if object.tags?
31
+ .ditem_tags= object.tags.join("\n")
32
+ - if object.details?
33
+ .ditem_details= object.details.to_a.join(', ')
34
+ ._clear
@@ -0,0 +1,35 @@
1
+ - tag :div, object.merge_html_attributes(:class => " _list dlist dselectable_item dbasic_list dlist_sortable_items") do
2
+ .dhover_controls_container
3
+ - unless object.controls.blank?
4
+ .dhover_controls
5
+ = object.controls.join(' ')
6
+
7
+ - if object.name?
8
+ %h1.item_title= object.name? ? object.name : '&nbsp;'
9
+ - else
10
+ %h1.item_title.empty_title
11
+ &nbsp;
12
+
13
+ ._container
14
+ = object.content.to_a.join("\n")
15
+ ._clear
16
+
17
+ - unless object.name? or object.content?
18
+ .dtitle= t(:empty_list)
19
+
20
+ / Show or Hide Finished tasks
21
+ .dcontrols
22
+ ._show_more._hidden
23
+ = tag :a, t(:show_more), :href => '#', :class => :_show_more
24
+ ._show_less._hidden
25
+ = tag :a, t(:show_less), :href => '#', :class => :_show_less
26
+ ._clear
27
+
28
+ ._hidden_tasks._hidden
29
+
30
+ - if object.tags?
31
+ .ditem_tags= object.tags.join("\n")
32
+ - if object.details?
33
+ .ditem_details= object.details.to_a.join(', ')
34
+ ._clear
35
+
@@ -0,0 +1,16 @@
1
+ - classes = " dlist_item dtask_list_item _list_item dselectable_item "
2
+ - classes << "dfinishedlist_item _finished" if object.finished
3
+ - tag :div, object.merge_html_attributes(:class => classes) do
4
+ .dhover_controls_container
5
+ - unless object.controls.blank?
6
+ .dhover_controls= object.controls.join(' ')
7
+
8
+ - unless object.check_box.blank?
9
+ .dcheck_box= object.check_box
10
+ .dcontent= object.content
11
+
12
+ / - if object.tags?
13
+ / .ditem_tags= object.tags.join(' ')
14
+ - if object.details?
15
+ .ditem_details= object.details.to_a.join(', ')
16
+ ._clear
@@ -0,0 +1,16 @@
1
+ - tag :div, object.merge_html_attributes(:class => " dnote _note dselectable_item") do
2
+ .dhover_controls_container
3
+ .dhover_controls= object.controls.join(' ') if object.controls?
4
+
5
+ - if object.name?
6
+ %h1.item_title= object.name
7
+
8
+ .dtext._markup.dmarkup= object.text
9
+ ._clear
10
+
11
+ - if object.tags?
12
+ .ditem_tags= object.tags.join(' ')
13
+ - if object.details?
14
+ .ditem_details= object.details.to_a.join(', ')
15
+
16
+ ._clear