spiderfw 0.6.39 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +2 -0
  3. data/Rakefile +4 -3
  4. data/VERSION +1 -1
  5. data/apps/core/admin/public/css/sass/admin.css +61 -12
  6. data/apps/core/admin/public/sass/admin.scss +51 -0
  7. data/apps/core/admin/views/login.layout.shtml +1 -1
  8. data/apps/core/components/assets.rb +34 -2
  9. data/apps/core/components/po/it/spider_components.po +2 -2
  10. data/apps/core/components/public/bootstrap/scss/_aggiunte_bootstrap_3.scss +54 -0
  11. data/apps/core/components/public/bootstrap/scss/_pagination.scss +1 -1
  12. data/apps/core/components/public/bootstrap/scss/_variables.scss +2 -0
  13. data/apps/core/components/public/bootstrap/scss/bootstrap.css +48 -2
  14. data/apps/core/components/public/bootstrap/scss/bootstrap.scss +4 -1
  15. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.eot +0 -0
  16. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.svg +272 -213
  17. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.ttf +0 -0
  18. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.woff +0 -0
  19. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.woff2 +0 -0
  20. data/apps/core/components/public/bootstrap_3/js/affix.js +48 -26
  21. data/apps/core/components/public/bootstrap_3/js/alert.js +8 -6
  22. data/apps/core/components/public/bootstrap_3/js/button.js +27 -17
  23. data/apps/core/components/public/bootstrap_3/js/carousel.js +66 -39
  24. data/apps/core/components/public/bootstrap_3/js/collapse.js +73 -42
  25. data/apps/core/components/public/bootstrap_3/js/dropdown.js +54 -40
  26. data/apps/core/components/public/bootstrap_3/js/modal.js +102 -42
  27. data/apps/core/components/public/bootstrap_3/js/popover.js +6 -11
  28. data/apps/core/components/public/bootstrap_3/js/scrollspy.js +47 -33
  29. data/apps/core/components/public/bootstrap_3/js/tab.js +48 -21
  30. data/apps/core/components/public/bootstrap_3/js/tooltip.js +118 -60
  31. data/apps/core/components/public/bootstrap_3/js/transition.js +15 -4
  32. data/apps/core/components/public/bootstrap_3/scss/_alerts.scss +8 -2
  33. data/apps/core/components/public/bootstrap_3/scss/_badges.scss +14 -3
  34. data/apps/core/components/public/bootstrap_3/scss/_button-groups.scss +23 -19
  35. data/apps/core/components/public/bootstrap_3/scss/_buttons.scss +22 -13
  36. data/apps/core/components/public/bootstrap_3/scss/_carousel.scss +28 -2
  37. data/apps/core/components/public/bootstrap_3/scss/_close.scss +1 -0
  38. data/apps/core/components/public/bootstrap_3/scss/_code.scss +7 -0
  39. data/apps/core/components/public/bootstrap_3/scss/_component-animations.scss +3 -1
  40. data/apps/core/components/public/bootstrap_3/scss/_dropdowns.scss +11 -9
  41. data/apps/core/components/public/bootstrap_3/scss/_forms.scss +190 -68
  42. data/apps/core/components/public/bootstrap_3/scss/_glyphicons.scss +83 -13
  43. data/apps/core/components/public/bootstrap_3/scss/_grid.scss +4 -4
  44. data/apps/core/components/public/bootstrap_3/scss/_input-groups.scss +1 -0
  45. data/apps/core/components/public/bootstrap_3/scss/_jumbotron.scss +8 -4
  46. data/apps/core/components/public/bootstrap_3/scss/_list-group.scss +13 -12
  47. data/apps/core/components/public/bootstrap_3/scss/_media.scss +40 -30
  48. data/apps/core/components/public/bootstrap_3/scss/_mixins.scss +1 -0
  49. data/apps/core/components/public/bootstrap_3/scss/_modals.scss +7 -4
  50. data/apps/core/components/public/bootstrap_3/scss/_navbar.scss +36 -32
  51. data/apps/core/components/public/bootstrap_3/scss/_navs.scss +3 -3
  52. data/apps/core/components/public/bootstrap_3/scss/_normalize.scss +12 -13
  53. data/apps/core/components/public/bootstrap_3/scss/_pager.scss +2 -3
  54. data/apps/core/components/public/bootstrap_3/scss/_pagination.scss +4 -3
  55. data/apps/core/components/public/bootstrap_3/scss/_panels.scss +38 -7
  56. data/apps/core/components/public/bootstrap_3/scss/_popovers.scss +5 -7
  57. data/apps/core/components/public/bootstrap_3/scss/_print.scss +96 -96
  58. data/apps/core/components/public/bootstrap_3/scss/_progress-bars.scss +20 -22
  59. data/apps/core/components/public/bootstrap_3/scss/_responsive-embed.scss +10 -9
  60. data/apps/core/components/public/bootstrap_3/scss/_responsive-utilities.scss +8 -3
  61. data/apps/core/components/public/bootstrap_3/scss/_scaffolding.scss +15 -4
  62. data/apps/core/components/public/bootstrap_3/scss/_tables.scss +15 -14
  63. data/apps/core/components/public/bootstrap_3/scss/_theme.scss +57 -13
  64. data/apps/core/components/public/bootstrap_3/scss/_thumbnails.scss +2 -2
  65. data/apps/core/components/public/bootstrap_3/scss/_tooltip.scss +13 -7
  66. data/apps/core/components/public/bootstrap_3/scss/_type.scss +21 -21
  67. data/apps/core/components/public/bootstrap_3/scss/_utilities.scss +3 -4
  68. data/apps/core/components/public/bootstrap_3/scss/_variables.scss +54 -32
  69. data/apps/core/components/public/bootstrap_3/scss/bootstrap.css +8772 -0
  70. data/apps/core/components/public/bootstrap_3/scss/bootstrap.scss +6 -0
  71. data/apps/core/components/public/bootstrap_3/scss/mixins/_background-variant.scss +2 -1
  72. data/apps/core/components/public/bootstrap_3/scss/mixins/_buttons.scss +19 -1
  73. data/apps/core/components/public/bootstrap_3/scss/mixins/_forms.scss +5 -1
  74. data/apps/core/components/public/bootstrap_3/scss/mixins/_gradients.scss +1 -1
  75. data/apps/core/components/public/bootstrap_3/scss/mixins/_grid-framework.scss +4 -10
  76. data/apps/core/components/public/bootstrap_3/scss/mixins/_grid.scss +7 -7
  77. data/apps/core/components/public/bootstrap_3/scss/mixins/_hide-text.scss +3 -3
  78. data/apps/core/components/public/bootstrap_3/scss/mixins/_labels.scss +1 -1
  79. data/apps/core/components/public/bootstrap_3/scss/mixins/_list-group.scss +3 -2
  80. data/apps/core/components/public/bootstrap_3/scss/mixins/_opacity.scss +1 -1
  81. data/apps/core/components/public/bootstrap_3/scss/mixins/_pagination.scss +2 -1
  82. data/apps/core/components/public/bootstrap_3/scss/mixins/_panels.scss +4 -0
  83. data/apps/core/components/public/bootstrap_3/scss/mixins/_progress-bar.scss +3 -1
  84. data/apps/core/components/public/bootstrap_3/scss/mixins/_reset-text.scss +18 -0
  85. data/apps/core/components/public/bootstrap_3/scss/mixins/_responsive-visibility.scss +1 -1
  86. data/apps/core/components/public/bootstrap_3/scss/mixins/_text-emphasis.scss +2 -1
  87. data/apps/core/components/public/bootstrap_3/scss/mixins/_vendor-prefixes.scss +11 -13
  88. data/apps/core/components/public/css/table_base.css +46 -1
  89. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.eot +0 -0
  90. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.svg +565 -0
  91. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
  92. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.woff +0 -0
  93. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
  94. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome.css +2893 -0
  95. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_animated.scss +34 -0
  96. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_bordered-pulled.scss +16 -0
  97. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_core.scss +12 -0
  98. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_extras.scss +44 -0
  99. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_fixed-width.scss +6 -0
  100. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_icons.scss +596 -0
  101. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_larger.scss +13 -0
  102. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_list.scss +19 -0
  103. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_mixins.scss +26 -0
  104. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_path.scss +14 -0
  105. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_rotated-flipped.scss +20 -0
  106. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_stacked.scss +20 -0
  107. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_variables.scss +608 -0
  108. data/apps/core/components/public/fontawesome_4/stylesheets/font_awesome.css +2893 -0
  109. data/apps/core/components/public/fontawesome_4/stylesheets/font_awesome.scss +17 -0
  110. data/apps/core/components/public/js/paginatore.js +307 -0
  111. data/apps/core/components/public/js/spin.js +399 -0
  112. data/apps/core/components/public/mmenu/js/jquery.mmenu.js +133 -0
  113. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.borderstyle.scss +33 -0
  114. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.effects.scss +199 -0
  115. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.fullscreen.scss +24 -0
  116. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.iconbar.scss +26 -0
  117. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.multiline.scss +15 -0
  118. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.pagedim.scss +36 -0
  119. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.pageshadow.scss +36 -0
  120. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.positioning.scss +87 -0
  121. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.themes.scss +76 -0
  122. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.tileview.scss +98 -0
  123. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.widescreen.scss +61 -0
  124. data/apps/core/components/public/mmenu/scss/inc/_colors.scss +175 -0
  125. data/apps/core/components/public/mmenu/scss/inc/_mixins.scss +135 -0
  126. data/apps/core/components/public/mmenu/scss/inc/_sizing.scss +86 -0
  127. data/apps/core/components/public/mmenu/scss/inc/_variables.scss +61 -0
  128. data/apps/core/components/public/mmenu/scss/jquery.mmenu.scss +478 -0
  129. data/apps/core/components/widgets/table/table.rb +7 -0
  130. data/apps/core/components/widgets/table/table.shtml +50 -17
  131. data/apps/core/forms/tags/row.erb +1 -1
  132. data/lib/spiderfw/cmd/cmd.rb +2 -0
  133. data/lib/spiderfw/cmd/commands/assets.rb +12 -0
  134. data/lib/spiderfw/controller/mixins/visual.rb +1 -0
  135. data/lib/spiderfw/create.rb +0 -1
  136. data/lib/spiderfw/i18n/gettext.rb +33 -0
  137. data/lib/spiderfw/i18n/javascript_parser.rb +2 -2
  138. data/lib/spiderfw/i18n/shtml_parser.rb +2 -2
  139. data/lib/spiderfw/model/model.rb +2 -1
  140. data/lib/spiderfw/setup/app_manager.rb +8 -0
  141. data/lib/spiderfw/spider.rb +9 -1
  142. data/lib/spiderfw/templates/layout.rb +47 -39
  143. data/lib/spiderfw/templates/template.rb +12 -4
  144. metadata +46 -1
@@ -136,8 +136,15 @@ module Spider; module Components
136
136
  if @attributes[:paginate]
137
137
  @scene.pages = (@rows.total_rows.to_f / @attributes[:row_limit]).ceil
138
138
  @scene.paginate_last = [@scene.paginate_first + 9, @scene.pages].min
139
+ #passo un array con tutte le pagine
140
+ array_pag = []
141
+ 1.upto(@scene.pages) do |i|
142
+ array_pag << i
143
+ end
144
+ @scene.array_pag = array_pag
139
145
  end
140
146
  @scene.columns = @elements.size
147
+
141
148
  super
142
149
  end
143
150
 
@@ -1,7 +1,7 @@
1
1
  <div class="{ @widget[:css_class] }">
2
2
  <tpl:asset type="js" src="widgets/table.js" />
3
3
  <tpl:asset type="css" src="css/table_base.css" />
4
- <table sp:if="@rows && @rows.length > 0" class="table-bordered table-striped">
4
+ <table sp:if="@rows && @rows.length > 0" class="table table-bordered table-striped table-hover row_linked width_auto">
5
5
  <thead>
6
6
  <tr class="heading_row">
7
7
  <th sp:each="@elements |element|" class="{ @sortable[element] ? 'sortable' : '' } { (@sorted[element] ? 'sorted-'+@sorted[element].to_s : '') }">
@@ -14,34 +14,45 @@
14
14
  <tbody>
15
15
  <tpl:pass sp:each_index="@rows |row_i|">
16
16
  <tr class="{ (row_i%2==0) ? 'odd' : 'even' }">
17
- <td sp:each="@elements |element|">
18
- <a sp:if="((!@link_el.blank? && element == @link_el) && @link.blank?)" href="{ Spider::HTTP.urlencode(@data[row_i][@link_id]) }?current_page={ @page }">
19
- { URI.decode(@rows[row_i][element]) }
20
- </a>
21
- <a sp:if="@link_el && element == @link_el && !@link.blank?" href="{ @link }{ Spider::HTTP.urlencode(@data[row_i][@link_id]) }&current_page={ @page }">
22
- { URI.decode(@rows[row_i][element]) }
23
- </a>
24
- <span sp:if="element != @link_el" >
25
- { URI.decode(@rows[row_i][element]) }
26
- </span>
27
- </td>
17
+ <td sp:each="@elements |element|">
18
+ <a sp:if="((!@link_el.blank? && element == @link_el) && @link.blank?)" href="{ Spider::HTTP.urlencode(@data[row_i][@link_id]) }?current_page={ @page }">
19
+ { URI.decode(@rows[row_i][element]) }
20
+ </a>
21
+ <a sp:if="@link_el && element == @link_el && !@link.blank?" href="{ @link }{ Spider::HTTP.urlencode(@data[row_i][@link_id]) }&current_page={ @page }">
22
+ { URI.decode(@rows[row_i][element]) }
23
+ </a>
24
+ <span sp:if="element != @link_el" >
25
+ { URI.decode(@rows[row_i][element]) }
26
+ </span>
27
+ </td>
28
28
  </tr>
29
29
  </tpl:pass>
30
30
  </tbody>
31
31
  </table>
32
- <div sp:if="!@pages.blank? && @pages > 1" class="pagination">
33
- <ul>
32
+ <ul sp:if="!@pages.blank? && @pages > 1" class="pagination">
33
+
34
+ <!-- versione con file po, da ricreare file per traduzioni
34
35
  <li sp:if="@page > 1">
35
36
  <a class="prev" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page-1 }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }">&larr; _(Previous)</a>
36
37
  </li>
37
38
  <li sp:if="@page == 1" class="disabled">
38
39
  <a class="prev disabled">&larr; _(Previous)</a>
39
40
  </li>
41
+ -->
42
+ <li sp:if="@page > 1">
43
+ <a class="prev" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ 1 }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }"> << </a>
44
+ <a class="page" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page-1 }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }"> < </a>
45
+ </li>
46
+ <li sp:if="@page == 1" class="disabled">
47
+ <a class="prev disabled"> << </a>
48
+ <a class="page disabled"> < </a>
49
+ </li>
50
+
40
51
  <sp:pass sp:if="@paginate_first > 1">
41
52
  <li>
42
53
  <a href="{ @request[:path] }?_w{ @widget[:param] }[page]=1{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }" class="page">1</a>
43
54
  </li>
44
- <li class="disabled"><a>...</a></li>
55
+ <li><a href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @paginate_first-1 }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }" class="page">...</a></li>
45
56
  </sp:pass>
46
57
  <sp:pass sp:each="(@paginate_first..@paginate_last) |i|" >
47
58
  <li sp:if="i != @page">
@@ -54,19 +65,41 @@
54
65
  </li>
55
66
  </sp:pass>
56
67
  <sp:pass sp:if="@paginate_last < @pages-1">
57
- <li class="disabled">
58
- <a>...</a>
68
+ <li>
69
+ <a href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @paginate_last+1 }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }" class="page">...</a>
59
70
  </li>
60
71
  <li>
61
72
  <a href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @pages }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }" class="page">{ @pages }</a>
62
73
  </li>
63
74
  </sp:pass>
75
+ <!-- versione con traduzioni
64
76
  <li sp:if="@has_more">
65
77
  <a href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page+1 }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }">_(Next) &rarr;</a>
66
78
  </li>
67
79
  <li sp:if="!@has_more" class="disabled">
68
80
  <a class="next disabled">_(Next) &rarr;</a>
69
81
  </li>
82
+ -->
83
+ <li sp:if="@has_more">
84
+ <a href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page+1 }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }"> > </a>
85
+ <a class="next" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @pages }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }"> >> </a>
86
+
87
+ </li>
88
+ <li sp:if="!@has_more" class="disabled">
89
+ <a class="disabled"> > </a>
90
+ <a class="next disabled"> >> </a>
91
+ </li>
92
+ </ul>
93
+
94
+ <!-- select con pagine per navigatore -->
95
+ <div class="btn-group dropup sel_pagine" sp:if="!@page.blank? && @pages > 1">
96
+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
97
+ Pag <strong>{ @page }</strong> <span class="caret"></span>
98
+ </button>
99
+ <ul class="dropdown-menu lista_pagine">
100
+ <li sp:each="@array_pag |pag_corrente|">
101
+ <a href="{ @request[:path] }?_w{ @widget[:param] }[page]={ pag_corrente }{ ( @query.blank? ? nil : '&_w'+@widget[:param]+'[q]='+@query ) }">{ pag_corrente }</a>
102
+ </li>
70
103
  </ul>
71
104
  </div>
72
105
  <div sp:if="!@rows || @rows.length < 1" class="no_result">
@@ -10,6 +10,6 @@ else
10
10
  el_class = @attributes['class'] || ''
11
11
  end
12
12
  %>
13
- <div class="control-group <%=el_class%> { (<%=error_condition%>) ? ' error' : '' }{ (<%=required%>) ? ' required' : '' }">
13
+ <div class="control-group <%=el_class%> { (<%=error_condition%>) ? ' error has-error' : '' }{ (<%=required%>) ? ' required' : '' }">
14
14
  <%=@content%>
15
15
  </div>
@@ -10,6 +10,7 @@ require 'spiderfw/cmd/commands/model'
10
10
  require 'spiderfw/cmd/commands/config'
11
11
  require 'spiderfw/cmd/commands/content'
12
12
  require 'spiderfw/cmd/commands/app'
13
+ require 'spiderfw/cmd/commands/assets'
13
14
 
14
15
  module Spider; module CommandLine
15
16
 
@@ -57,6 +58,7 @@ module Spider; module CommandLine
57
58
  @cmd.add_command(ContentCommand.new)
58
59
  @cmd.add_command(AppCommand.new)
59
60
  # @cmd.add_command(ScaffoldCommand.new)
61
+ @cmd.add_command(AssetsCommand.new)
60
62
  end
61
63
 
62
64
  def parse
@@ -0,0 +1,12 @@
1
+ module Spider::CommandLine
2
+
3
+ class AssetsCommand < CmdParse::Command
4
+
5
+
6
+ def initialize
7
+ super('assets', true, true )
8
+ @short_desc = "Gestisci assets"
9
+ end
10
+ end
11
+
12
+ end
@@ -609,6 +609,7 @@ module Spider; module ControllerMixins
609
609
  layout.asset_set = params[:assets] if params[:assets]
610
610
  layout.no_asset_profiles(*params[:no_asset_profiles]) if params[:no_asset_profiles]
611
611
  layout.only_asset_profiles(params[:only_asset_profiles]) if params[:only_asset_profiles]
612
+ layout.single_layout = params[:single_layout] if params[:single_layout]
612
613
  layout
613
614
  end
614
615
 
@@ -32,7 +32,6 @@ module Spider
32
32
  dest_path = path+'/'+name
33
33
  source_path = $SPIDER_PATH+'/blueprints/home'
34
34
  create(source_path, dest_path)
35
-
36
35
  begin
37
36
  require 'git'
38
37
 
@@ -34,6 +34,39 @@ module Spider
34
34
  FastGettext.text_domain = domain
35
35
  end
36
36
 
37
+ def self.update_pofiles(textdomain, files, app_version, options = {})
38
+ require 'debugger'
39
+ debugger
40
+ puts options.inspect if options[:verbose]
41
+
42
+ #write found messages to tmp.pot
43
+ temp_pot = "tmp.pot"
44
+ ::GetText::Tools::XGetText.run("-o", temp_pot, *files)
45
+
46
+ #merge tmp.pot and existing pot
47
+ po_root = options.delete(:po_root) || "po"
48
+ FileUtils.mkdir_p(po_root)
49
+ ::GetText::Tools::MsgMerge.run("#{po_root}/#{textdomain}.pot", temp_pot, app_version, options.dup)
50
+
51
+ #update local po-files
52
+ only_one_language = options.delete(:lang)
53
+ if only_one_language
54
+ ::GetText::Tools::MsgMerge.run("#{po_root}/#{only_one_language}/#{textdomain}.po", temp_pot, app_version, options.dup)
55
+ else
56
+ Dir.glob("#{po_root}/*/#{textdomain}.po") do |po_file|
57
+ ::GetText::Tools::MsgMerge.run(po_file, temp_pot, app_version, options.dup)
58
+ end
59
+ end
60
+
61
+ File.delete(temp_pot)
62
+ end
63
+
64
+
65
+
66
+
67
+
68
+
69
+
37
70
  end
38
71
 
39
72
  end
@@ -49,7 +49,7 @@ module Spider; module I18n
49
49
  end
50
50
 
51
51
  end
52
-
53
- ::GetText::RGetText.add_parser(JavascriptParser)
52
+ #::GetText::RGetText.add_parser(JavascriptParser)
53
+ ::GetText::Tools::XGetText.add_parser(JavascriptParser)
54
54
 
55
55
  end; end
@@ -35,7 +35,7 @@ module Spider; module I18n
35
35
  end
36
36
 
37
37
  end
38
-
39
- ::GetText::RGetText.add_parser(SHTMLParser)
38
+ #::GetText::RGetText.add_parser(SHTMLParser)
39
+ ::GetText::Tools::XGetText.add_parser(SHTMLParser)
40
40
 
41
41
  end; end
@@ -346,7 +346,7 @@ module Spider
346
346
  # @param [String] message The error message
347
347
  def initialize(element, value, message)
348
348
  @element = element
349
- @message = message
349
+ @message = message+" (valore: #{value})"
350
350
  @value = value
351
351
  super(message)
352
352
  end
@@ -357,6 +357,7 @@ module Spider
357
357
  Spider::GetText.in_domain('spider'){
358
358
  _(@message) % label
359
359
  }
360
+
360
361
  end
361
362
 
362
363
  end
@@ -118,6 +118,14 @@ module Spider
118
118
  else
119
119
  pack_install(spec, options)
120
120
  end
121
+ #alla fine dell'installazione, se sto installando il portal creo la cartella 'portal' dentro a 'views'
122
+ if spec.app_id == 'portal'
123
+ #Spider.output "Copio layout del portale"
124
+ dest_layout = File.join(Spider.paths[:personalized_views],spec.app_id)
125
+ source_layout_file = File.join(Spider.paths[:apps],spec.app_id,'views','portal.layout.shtml')
126
+ FileUtils.mkdir_p(dest_layout)
127
+ FileUtils.cp(source_layout_file,dest_layout)
128
+ end
121
129
  end
122
130
 
123
131
 
@@ -184,7 +184,13 @@ module Spider
184
184
  #nuove cartelle aggiunte
185
185
  FileUtils.mkdir_p(Spider.paths[:data])
186
186
  FileUtils.mkdir_p(File.join(Spider.paths[:var], 'sessions'))
187
-
187
+ #creo le cartelle per i file scss
188
+ FileUtils.mkdir_p(Spider.paths[:public])
189
+ FileUtils.mkdir_p(File.join(Spider.paths[:public],'sass')) unless File.exist?(File.join(Spider.paths[:public],'sass'))
190
+ FileUtils.mkdir_p(File.join(Spider.paths[:public],'img')) unless File.exist?(File.join(Spider.paths[:public],'img'))
191
+ if File.exist?(File.join(Spider.paths[:public],'sass')) && !File.exists?(File.join(Spider.paths[:public],'sass','custom_stile.scss'))
192
+ File.new(File.join(Spider.paths[:public],'sass','custom_stile.scss'), "w+")
193
+ end
188
194
  end
189
195
 
190
196
 
@@ -538,6 +544,8 @@ module Spider
538
544
  @paths[:log] = File.join(@paths[:var], 'log')
539
545
  @paths[:restart_file] = File.join(@paths[:tmp], 'restart.txt')
540
546
  @paths[:clear_file] = File.join(@paths[:tmp], 'clear.txt')
547
+ @paths[:public] = File.join(root, 'public')
548
+ @paths[:personalized_views] = File.join(root, 'views')
541
549
  @paths.each do |k, path|
542
550
  @paths[k] = File.expand_path(File.readlink(path)) if File.symlink?(path)
543
551
  end
@@ -6,7 +6,9 @@ module Spider
6
6
  # allow_blocks :HTML, :Text, :Render, :Yield, :If, :TagIf, :Each, :Pass, :Widget
7
7
  attr_accessor :template
8
8
  attr_accessor :asset_set
9
+ attr_accessor :single_layout
9
10
 
11
+
10
12
  def init(scene)
11
13
  super
12
14
  @template = @template.is_a?(Template) ? @template : Template.new(@template)
@@ -40,52 +42,58 @@ module Spider
40
42
  cname += "-#{@asset_set}" if @asset_set
41
43
  @cname = cname
42
44
 
43
- all_assets.each do |ass|
44
- seen_check = ass[:runtime] || ass[:src]
45
- next if ass[:src].blank? && !ass[:runtime]
46
- next if seen[seen_check]
47
- seen[seen_check] = true
48
- ass[:app] = Spider.home if ass[:app] == :home
49
-
50
- ass = compile_asset(ass)
51
-
52
- res = prepare_asset(ass, compress_assets, js_translations)
53
- assets[:css] += res[:css]
54
- assets[:js] += res[:js]
55
-
56
- end
57
-
45
+ @content[:yield_to] = @template
46
+ #se sono nel layout del portale ho il :single_layout, se sono in un layout di un app faccio scaricare gli assets solo se ho single_layout a true
47
+ if !/(admin|login|error|portal|simple|generic|cms|stampa)/.match(cname).blank? || self.single_layout
48
+ all_assets.each do |ass|
49
+ seen_check = ass[:runtime] || ass[:src]
50
+ next if ass[:src].blank? && !ass[:runtime]
51
+ next if seen[seen_check]
52
+ seen[seen_check] = true
53
+ ass[:app] = Spider.home if ass[:app] == :home
54
+
55
+ ass = compile_asset(ass)
58
56
 
59
- if @compile_less == false
60
- less = Spider::Template.get_named_asset('less')
61
- less.each do |ass|
62
- res = prepare_asset(parse_asset(ass[:type], ass[:src], ass).first)
57
+ res = prepare_asset(ass, compress_assets, js_translations)
63
58
  assets[:css] += res[:css]
64
59
  assets[:js] += res[:js]
60
+
65
61
  end
66
- end
67
- assets[:js].each do |ass|
68
- if ass[:cpr]
69
- compressed = compress_javascript(ass)
70
- @template_assets[:js] << Spider.home.controller.pub_url+'/'+COMPILED_FOLDER+'/'+compressed
71
- else
72
- ass[:src] = ass[:cdn] if ass[:cdn] && use_cdn
73
- @template_assets[:js] << ass[:src]
62
+ #ordino gli assets in base al parametro order
63
+ assets[:css] = assets[:css].sort_by { |hsh| hsh[:order].to_i }
64
+ assets[:js] = assets[:js].sort_by { |hsh| hsh[:order].to_i }
65
+
66
+ if @compile_less == false
67
+ less = Spider::Template.get_named_asset('less')
68
+ less.each do |ass|
69
+ res = prepare_asset(parse_asset(ass[:type], ass[:src], ass).first)
70
+ assets[:css] += res[:css]
71
+ assets[:js] += res[:js]
72
+ end
74
73
  end
75
- end
76
- assets[:css].each do |ass|
77
- if ass[:cpr]
78
- compressed = compress_css(ass)
79
- @template_assets[:css] << Spider.home.controller.pub_url+'/'+COMPILED_FOLDER+'/'+compressed
80
- else
81
- ass[:src] = ass[:cdn] if ass[:cdn] && use_cdn
82
- is_dyn = ass[:if_ie_lte] || ass[:media] || ass[:rel]
83
- @template_assets[:css] << (is_dyn ? ass : ass[:src])
74
+ assets[:js].each do |ass|
75
+ if ass[:cpr]
76
+ compressed = compress_javascript(ass)
77
+ @template_assets[:js] << Spider.home.controller.pub_url+'/'+COMPILED_FOLDER+'/'+compressed
78
+ else
79
+ ass[:src] = ass[:cdn] if ass[:cdn] && use_cdn
80
+ @template_assets[:js] << ass[:src]
81
+ end
82
+ end
83
+ assets[:css].each do |ass|
84
+ if ass[:cpr]
85
+ compressed = compress_css(ass)
86
+ @template_assets[:css] << Spider.home.controller.pub_url+'/'+COMPILED_FOLDER+'/'+compressed
87
+ else
88
+ ass[:src] = ass[:cdn] if ass[:cdn] && use_cdn
89
+ is_dyn = ass[:if_ie_lte] || ass[:media] || ass[:rel]
90
+ @template_assets[:css] << (is_dyn ? ass : ass[:src])
91
+ end
84
92
  end
85
- end
86
93
 
87
- @content[:yield_to] = @template
88
- @scene.assets = @template_assets
94
+ @scene.assets = @template_assets
95
+ end
96
+
89
97
  @scene.extend(LayoutScene)
90
98
  if js_translations.empty?
91
99
  @scene.js_translations = ""
@@ -286,13 +286,14 @@ module Spider
286
286
  res = root.children ? root.children_of_type('tpl:asset') : []
287
287
  res_init = ""
288
288
  res.each do |r|
289
- @assets << Spider::Template.parse_asset_element(r)
289
+ #se ho l'attributo runtime carico il file se il runtime coincide o non viene specificato
290
+ @assets << Spider::Template.parse_asset_element(r) if (r.get_attribute("runmode") == Spider.runmode || r.get_attribute("runmode").nil?)
290
291
  r.set_attribute('class', 'to_delete')
291
292
  end
292
293
  new_assets = []
293
294
  @assets.each do |ass|
294
295
  a = parse_asset(ass[:type], ass[:src], ass)
295
- new_assets += a
296
+ new_assets += a unless new_assets.include?(a) #non inserisco duplicati
296
297
  end
297
298
  @assets = new_assets
298
299
  root.search('.to_delete').remove
@@ -323,6 +324,7 @@ module Spider
323
324
  s_template.load(s)
324
325
  @assets = s_template.assets + @assets
325
326
  end
327
+
326
328
  end
327
329
  end
328
330
  root.search('tpl:assets').remove
@@ -351,12 +353,15 @@ module Spider
351
353
  # sub_c = sub.compile(options.merge({:mode => :widget}))
352
354
  @assets = wt.compiled.assets + @assets
353
355
  end
354
-
355
356
  seen = {}
356
357
  # @assets.each_index do |i|
357
358
  # ass = @assets[i]
358
359
  # if ass[:name]
359
360
  # end
361
+ #
362
+ #rendo univoco all'inizio l'array per non caricare piu' volte lo stesso asset
363
+ assets_univoci = @assets.uniq!
364
+ @assets = ( assets_univoci.nil? ? @assets : assets_univoci )
360
365
  @assets.each do |ass|
361
366
  ass[:profiles] = ((ass[:profiles] || []) + @asset_profiles).uniq if @asset_profiles
362
367
  next if seen[ass.inspect]
@@ -372,7 +377,7 @@ module Spider
372
377
  end
373
378
  compiled.block.init_code = res_init + compiled.block.init_code
374
379
  compiled.devel_info["source.xml"] = root.to_html
375
- compiled.assets = (@assets + assets).uniq
380
+ compiled.assets = @assets #(@assets + assets).uniq sono univoci e assets == @assets
376
381
  return compiled
377
382
  end
378
383
 
@@ -446,6 +451,7 @@ module Spider
446
451
  else
447
452
  base_url = ''
448
453
  end
454
+
449
455
  ass[:rel_path] = src
450
456
  ass[:src] = base_url + src
451
457
  ass_info = self.class.asset_types[type]
@@ -470,6 +476,8 @@ module Spider
470
476
  [:gettext, :media, :if_ie_lte, :cdn].each do |key|
471
477
  ass[key] = attributes[key] if attributes.key?(key)
472
478
  end
479
+
480
+ ass[:order] = attributes[:order]
473
481
  return [ass]
474
482
  end
475
483