concen 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. data/Gemfile +0 -3
  2. data/Gemfile.lock +0 -9
  3. data/LICENSE +1 -1
  4. data/README.md +23 -1
  5. data/app/assets/stylesheets/concen/application.css.sass +14 -16
  6. data/app/assets/stylesheets/concen/compass/_css3.scss +17 -0
  7. data/app/assets/stylesheets/concen/compass/_layout.scss +3 -0
  8. data/app/assets/stylesheets/concen/compass/_reset-legacy.scss +3 -0
  9. data/app/assets/stylesheets/concen/compass/_reset.scss +3 -0
  10. data/app/assets/stylesheets/concen/compass/_support.scss +36 -0
  11. data/app/assets/stylesheets/concen/compass/_typography.scss +4 -0
  12. data/app/assets/stylesheets/concen/compass/_utilities.scss +9 -0
  13. data/app/assets/stylesheets/concen/compass/css3/_appearance.scss +13 -0
  14. data/app/assets/stylesheets/concen/compass/css3/_background-clip.scss +43 -0
  15. data/app/assets/stylesheets/concen/compass/css3/_background-origin.scss +42 -0
  16. data/app/assets/stylesheets/concen/compass/css3/_background-size.scss +26 -0
  17. data/app/assets/stylesheets/concen/compass/css3/_border-radius.scss +135 -0
  18. data/app/assets/stylesheets/concen/compass/css3/_box-shadow.scss +93 -0
  19. data/app/assets/stylesheets/concen/compass/css3/_box-sizing.scss +13 -0
  20. data/app/assets/stylesheets/concen/compass/css3/_box.scss +111 -0
  21. data/app/assets/stylesheets/concen/compass/css3/_columns.scss +60 -0
  22. data/app/assets/stylesheets/concen/compass/css3/_font-face.scss +63 -0
  23. data/app/assets/stylesheets/concen/compass/css3/_gradient.scss +99 -0
  24. data/app/assets/stylesheets/concen/compass/css3/_images.scss +132 -0
  25. data/app/assets/stylesheets/concen/compass/css3/_inline-block.scss +16 -0
  26. data/app/assets/stylesheets/concen/compass/css3/_opacity.scss +19 -0
  27. data/app/assets/stylesheets/concen/compass/css3/_pie.scss +73 -0
  28. data/app/assets/stylesheets/concen/compass/css3/_shared.scss +38 -0
  29. data/app/assets/stylesheets/concen/compass/css3/_text-shadow.scss +62 -0
  30. data/app/assets/stylesheets/concen/compass/css3/_transform-legacy.scss +87 -0
  31. data/app/assets/stylesheets/concen/compass/css3/_transform.scss +598 -0
  32. data/app/assets/stylesheets/concen/compass/css3/_transition.scss +119 -0
  33. data/app/assets/stylesheets/concen/compass/layout/_grid-background.scss +178 -0
  34. data/app/assets/stylesheets/concen/compass/layout/_sticky-footer.scss +23 -0
  35. data/app/assets/stylesheets/concen/compass/layout/_stretching.scss +24 -0
  36. data/app/assets/stylesheets/concen/compass/reset/_utilities-legacy.scss +135 -0
  37. data/app/assets/stylesheets/concen/compass/reset/_utilities.scss +140 -0
  38. data/app/assets/stylesheets/concen/compass/typography/_links.scss +3 -0
  39. data/app/assets/stylesheets/concen/compass/typography/_lists.scss +4 -0
  40. data/app/assets/stylesheets/concen/compass/typography/_text.scss +4 -0
  41. data/app/assets/stylesheets/concen/compass/typography/_vertical_rhythm.scss +193 -0
  42. data/app/assets/stylesheets/concen/compass/typography/links/_hover-link.scss +5 -0
  43. data/app/assets/stylesheets/concen/compass/typography/links/_link-colors.scss +28 -0
  44. data/app/assets/stylesheets/concen/compass/typography/links/_unstyled-link.scss +7 -0
  45. data/app/assets/stylesheets/concen/compass/typography/lists/_bullets.scss +34 -0
  46. data/app/assets/stylesheets/concen/compass/typography/lists/_horizontal-list.scss +61 -0
  47. data/app/assets/stylesheets/concen/compass/typography/lists/_inline-block-list.scss +47 -0
  48. data/app/assets/stylesheets/concen/compass/typography/lists/_inline-list.scss +44 -0
  49. data/app/assets/stylesheets/concen/compass/typography/text/_ellipsis.scss +25 -0
  50. data/app/assets/stylesheets/concen/compass/typography/text/_force-wrap.scss +12 -0
  51. data/app/assets/stylesheets/concen/compass/typography/text/_nowrap.scss +2 -0
  52. data/app/assets/stylesheets/concen/compass/typography/text/_replacement.scss +34 -0
  53. data/app/assets/stylesheets/concen/compass/utilities/_color.scss +1 -0
  54. data/app/assets/stylesheets/concen/compass/utilities/_general.scss +6 -0
  55. data/app/assets/stylesheets/concen/compass/utilities/_links.scss +5 -0
  56. data/app/assets/stylesheets/concen/compass/utilities/_lists.scss +6 -0
  57. data/app/assets/stylesheets/concen/compass/utilities/_print.scss +17 -0
  58. data/app/assets/stylesheets/concen/compass/utilities/_sprites.scss +1 -0
  59. data/app/assets/stylesheets/concen/compass/utilities/_tables.scss +3 -0
  60. data/app/assets/stylesheets/concen/compass/utilities/_text.scss +5 -0
  61. data/app/assets/stylesheets/concen/compass/utilities/color/_contrast.scss +28 -0
  62. data/app/assets/stylesheets/concen/compass/utilities/general/_clearfix.scss +44 -0
  63. data/app/assets/stylesheets/concen/compass/utilities/general/_float.scss +30 -0
  64. data/app/assets/stylesheets/concen/compass/utilities/general/_hacks.scss +46 -0
  65. data/app/assets/stylesheets/concen/compass/utilities/general/_min.scss +16 -0
  66. data/app/assets/stylesheets/concen/compass/utilities/general/_reset.scss +2 -0
  67. data/app/assets/stylesheets/concen/compass/utilities/general/_tabs.scss +1 -0
  68. data/app/assets/stylesheets/concen/compass/utilities/general/_tag-cloud.scss +18 -0
  69. data/app/assets/stylesheets/concen/compass/utilities/links/_hover-link.scss +3 -0
  70. data/app/assets/stylesheets/concen/compass/utilities/links/_link-colors.scss +3 -0
  71. data/app/assets/stylesheets/concen/compass/utilities/links/_unstyled-link.scss +3 -0
  72. data/app/assets/stylesheets/concen/compass/utilities/lists/_bullets.scss +3 -0
  73. data/app/assets/stylesheets/concen/compass/utilities/lists/_horizontal-list.scss +3 -0
  74. data/app/assets/stylesheets/concen/compass/utilities/lists/_inline-block-list.scss +3 -0
  75. data/app/assets/stylesheets/concen/compass/utilities/lists/_inline-list.scss +3 -0
  76. data/app/assets/stylesheets/concen/compass/utilities/sprites/_base.scss +66 -0
  77. data/app/assets/stylesheets/concen/compass/utilities/sprites/_sprite-img.scss +56 -0
  78. data/app/assets/stylesheets/concen/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
  79. data/app/assets/stylesheets/concen/compass/utilities/tables/_borders.scss +33 -0
  80. data/app/assets/stylesheets/concen/compass/utilities/tables/_scaffolding.scss +9 -0
  81. data/app/assets/stylesheets/concen/compass/utilities/text/_ellipsis.scss +3 -0
  82. data/app/assets/stylesheets/concen/compass/utilities/text/_nowrap.scss +3 -0
  83. data/app/assets/stylesheets/concen/compass/utilities/text/_replacement.scss +3 -0
  84. data/app/assets/stylesheets/concen/partials/_base.sass +4 -4
  85. data/app/assets/stylesheets/concen/partials/_variables.sass +5 -5
  86. data/app/helpers/concen/application_helper.rb +0 -6
  87. data/app/models/concen/page.rb +12 -3
  88. data/app/views/concen/grid_files/_form.html.erb +23 -0
  89. data/app/views/concen/grid_files/edit.html.erb +10 -0
  90. data/app/views/concen/pages/_file_list.erb +11 -0
  91. data/app/views/concen/pages/_files.erb +32 -0
  92. data/app/views/concen/pages/_form.html.erb +26 -0
  93. data/app/views/concen/pages/_nested_list.html.erb +22 -0
  94. data/app/views/concen/pages/edit.html.erb +19 -0
  95. data/app/views/concen/pages/index.html.erb +12 -0
  96. data/app/views/concen/pages/new.html.erb +10 -0
  97. data/app/views/concen/performances/_runtimes.html.erb +8 -0
  98. data/app/views/concen/performances/show.html.erb +40 -0
  99. data/app/views/concen/sessions/new.html.erb +17 -0
  100. data/app/views/concen/statuses/_server.html.erb +34 -0
  101. data/app/views/concen/statuses/show.html.erb +27 -0
  102. data/app/views/concen/traffics/_pages.html.erb +8 -0
  103. data/app/views/concen/traffics/_referrals.html.erb +12 -0
  104. data/app/views/concen/traffics/show.html.erb +40 -0
  105. data/app/views/concen/users/_form.html.erb +42 -0
  106. data/app/views/concen/users/{_password_reset.html.haml → _password_reset.html.erb} +0 -0
  107. data/app/views/concen/users/_settings.html.erb +23 -0
  108. data/app/views/concen/users/edit.html.erb +12 -0
  109. data/app/views/concen/users/index.html.erb +40 -0
  110. data/app/views/concen/users/new.html.erb +6 -0
  111. data/app/views/concen/users/new_invite.html.erb +24 -0
  112. data/app/views/concen/users/new_reset_password.html.erb +24 -0
  113. data/app/views/layouts/concen/{_additional_header_links.haml → _additional_header_links.html.erb} +0 -0
  114. data/app/views/layouts/concen/_header.html.erb +24 -0
  115. data/app/views/layouts/concen/{maintenance.html.haml → _iphone.html.erb} +0 -0
  116. data/app/views/layouts/concen/application.html.erb +42 -0
  117. data/app/views/layouts/concen/maintenance.html.erb +0 -0
  118. data/concen.gemspec +0 -2
  119. data/lib/concen/engine.rb +0 -1
  120. data/lib/concen/version.rb +1 -1
  121. data/test/support/raw_text/smartypants.html +1 -1
  122. data/test/support/raw_text/smartypants.txt +1 -1
  123. metadata +130 -74
  124. data/app/views/concen/grid_files/_form.html.haml +0 -15
  125. data/app/views/concen/grid_files/edit.html.haml +0 -7
  126. data/app/views/concen/pages/_file_list.haml +0 -7
  127. data/app/views/concen/pages/_files.haml +0 -24
  128. data/app/views/concen/pages/_form.html.haml +0 -17
  129. data/app/views/concen/pages/_nested_list.html.haml +0 -15
  130. data/app/views/concen/pages/edit.html.haml +0 -13
  131. data/app/views/concen/pages/index.html.haml +0 -12
  132. data/app/views/concen/pages/new.html.haml +0 -7
  133. data/app/views/concen/performances/_runtimes.html.haml +0 -5
  134. data/app/views/concen/performances/show.html.haml +0 -27
  135. data/app/views/concen/sessions/new.html.haml +0 -12
  136. data/app/views/concen/statuses/_server.html.haml +0 -19
  137. data/app/views/concen/statuses/show.html.haml +0 -18
  138. data/app/views/concen/traffics/_pages.html.haml +0 -5
  139. data/app/views/concen/traffics/_referrals.html.haml +0 -9
  140. data/app/views/concen/traffics/show.html.haml +0 -27
  141. data/app/views/concen/users/_form.html.haml +0 -29
  142. data/app/views/concen/users/_settings.html.haml +0 -15
  143. data/app/views/concen/users/edit.html.haml +0 -9
  144. data/app/views/concen/users/index.html.haml +0 -32
  145. data/app/views/concen/users/new.html.haml +0 -4
  146. data/app/views/concen/users/new_invite.html.haml +0 -15
  147. data/app/views/concen/users/new_reset_password.html.haml +0 -15
  148. data/app/views/layouts/concen/_header.html.haml +0 -18
  149. data/app/views/layouts/concen/_iphone.html.haml +0 -6
  150. data/app/views/layouts/concen/application.html.haml +0 -33
@@ -0,0 +1,3 @@
1
+ @warn "This import is deprecated. Use 'compass/typography/lists/horizontal-list' instead.";
2
+
3
+ @import "../../typography/lists/horizontal-list";
@@ -0,0 +1,3 @@
1
+ @warn "This import is deprecated. Use 'compass/typography/lists/inline-block-list' instead.";
2
+
3
+ @import "../../typography/lists/inline-block-link";
@@ -0,0 +1,3 @@
1
+ @warn "This import is deprecated. Use 'compass/typography/lists/inline-list' instead.";
2
+
3
+ @import "../../typography/lists/inline-list";
@@ -0,0 +1,66 @@
1
+ // Determines those states for which you want to enable magic sprite selectors
2
+ $sprite-selectors: hover, target, active !default;
3
+
4
+ // Set the width and height of an element to the original
5
+ // dimensions of an image before it was included in the sprite.
6
+ @mixin sprite-dimensions($map, $sprite) {
7
+ height: image-height(sprite-file($map, $sprite));
8
+ width: image-width(sprite-file($map, $sprite));
9
+ }
10
+
11
+ // Set the background position of the given sprite `$map` to display the
12
+ // sprite of the given `$sprite` name. You can move the image relative to its
13
+ // natural position by passing `$offset-x` and `$offset-y`.
14
+ @mixin sprite-background-position($map, $sprite, $offset-x: 0, $offset-y: 0) {
15
+ background-position: sprite-position($map, $sprite, $offset-x, $offset-y);
16
+ }
17
+
18
+
19
+ // Determines if you want to include magic selectors in your sprites
20
+ $disable-magic-sprite-selectors:false !default;
21
+
22
+ // Include the position and (optionally) dimensions of this `$sprite`
23
+ // in the given sprite `$map`. The sprite url should come from either a base
24
+ // class or you can specify the `sprite-url` explicitly like this:
25
+ //
26
+ // background: $map no-repeat;
27
+ @mixin sprite($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0) {
28
+ @include sprite-background-position($map, $sprite, $offset-x, $offset-y);
29
+ @if $dimensions {
30
+ @include sprite-dimensions($map, $sprite);
31
+ }
32
+ @if not $disable-magic-sprite-selectors {
33
+ @include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y);
34
+ }
35
+ }
36
+
37
+ // Include the selectors for the `$sprite` given the `$map` and the
38
+ // `$full-sprite-name`
39
+ // @private
40
+ @mixin sprite-selectors($map, $sprite-name, $full-sprite-name, $offset-x: 0, $offset-y: 0) {
41
+ @each $selector in $sprite-selectors {
42
+ @if sprite_has_selector($map, $sprite-name, $selector) {
43
+ &:#{$selector}, &.#{$full-sprite-name}_#{$selector}, &.#{$full-sprite-name}-#{$selector} {
44
+ @include sprite-background-position($map, "#{$sprite-name}_#{$selector}", $offset-x, $offset-y);
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ // Generates a class for each space separated name in `$sprite-names`.
51
+ // The class will be of the form .<map-name>-<sprite-name>.
52
+ //
53
+ // If a base class is provided, then each class will extend it.
54
+ //
55
+ // If `$dimensions` is `true`, the sprite dimensions will specified.
56
+ @mixin sprites($map, $sprite-names, $base-class: false, $dimensions: false, $prefix: sprite-map-name($map), $offset-x: 0, $offset-y: 0) {
57
+ @each $sprite-name in $sprite-names {
58
+ @if sprite_does_not_have_parent($map, $sprite-name) {
59
+ $full-sprite-name: "#{$prefix}-#{$sprite-name}";
60
+ .#{$full-sprite-name} {
61
+ @if $base-class { @extend #{$base-class}; }
62
+ @include sprite($map, $sprite-name, $dimensions, $offset-x, $offset-y);
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,56 @@
1
+ // @doc off
2
+ // Example 1:
3
+ //
4
+ // a.twitter
5
+ // +sprite-img("icons-32.png", 1)
6
+ // a.facebook
7
+ // +sprite-img("icons-32png", 2)
8
+ //
9
+ // Example 2:
10
+ //
11
+ // a
12
+ // +sprite-background("icons-32.png")
13
+ // a.twitter
14
+ // +sprite-column(1)
15
+ // a.facebook
16
+ // +sprite-row(2)
17
+ // @doc on
18
+
19
+ $sprite-default-size: 32px !default;
20
+
21
+ $sprite-default-margin: 0px !default;
22
+
23
+ $sprite-image-default-width: $sprite-default-size !default;
24
+
25
+ $sprite-image-default-height: $sprite-default-size !default;
26
+
27
+ // Sets all the rules for a sprite from a given sprite image to show just one of the sprites.
28
+ // To reduce duplication use a sprite-bg mixin for common properties and a sprite-select mixin for positioning.
29
+ @mixin sprite-img($img, $col, $row: 1, $width: $sprite-image-default-width, $height: $sprite-image-default-height, $margin: $sprite-default-margin) {
30
+ @include sprite-background($img, $width, $height);
31
+ @include sprite-position($col, $row, $width, $height, $margin); }
32
+
33
+ // Sets rules common for all sprites, assumes you want a square, but allows a rectangular region.
34
+ @mixin sprite-background($img, $width: $sprite-default-size, $height: $width) {
35
+ @include sprite-background-rectangle($img, $width, $height); }
36
+
37
+ // Sets rules common for all sprites, assumes a rectangular region.
38
+ @mixin sprite-background-rectangle($img, $width: $sprite-image-default-width, $height: $sprite-image-default-height) {
39
+ background: image-url($img) no-repeat;
40
+ width: $width;
41
+ height: $height;
42
+ overflow: hidden; }
43
+
44
+ // Allows horizontal sprite positioning optimized for a single row of sprites.
45
+ @mixin sprite-column($col, $width: $sprite-image-default-width, $margin: $sprite-default-margin) {
46
+ @include sprite-position($col, 1, $width, 0px, $margin); }
47
+
48
+ // Allows vertical sprite positioning optimized for a single column of sprites.
49
+ @mixin sprite-row($row, $height: $sprite-image-default-height, $margin: $sprite-default-margin) {
50
+ @include sprite-position(1, $row, 0px, $height, $margin); }
51
+
52
+ // Allows vertical and horizontal sprite positioning from a grid of equal dimensioned sprites.
53
+ @mixin sprite-position($col, $row: 1, $width: $sprite-image-default-width, $height: $sprite-image-default-height, $margin: $sprite-default-margin) {
54
+ $x: ($col - 1) * -$width - ($col - 1) * $margin;
55
+ $y: ($row - 1) * -$height - ($row - 1) * $margin;
56
+ background-position: $x $y; }
@@ -0,0 +1,20 @@
1
+ @mixin alternating-rows-and-columns($even-row-color, $odd-row-color, $dark-intersection, $header-color: white, $footer-color: white) {
2
+ th {
3
+ background-color: $header-color;
4
+ &.even, &:nth-child(2n) {
5
+ background-color: $header-color - $dark-intersection; } }
6
+ tr.odd {
7
+ td {
8
+ background-color: $odd-row-color;
9
+ &.even, &:nth-child(2n) {
10
+ background-color: $odd-row-color - $dark-intersection; } } }
11
+ tr.even {
12
+ td {
13
+ background-color: $even-row-color;
14
+ &.even, &:nth-child(2n) {
15
+ background-color: $even-row-color - $dark-intersection; } } }
16
+ tfoot {
17
+ th, td {
18
+ background-color: $footer-color;
19
+ &.even, &:nth-child(2n) {
20
+ background-color: $footer-color - $dark-intersection; } } } }
@@ -0,0 +1,33 @@
1
+ @mixin outer-table-borders($width: 2px, $color: black) {
2
+ border: $width solid $color;
3
+ thead {
4
+ th {
5
+ border-bottom: $width solid $color; } }
6
+ tfoot {
7
+ th, td {
8
+ border-top: $width solid $color; } }
9
+ th {
10
+ &:first-child {
11
+ border-right: $width solid $color; } } }
12
+
13
+ @mixin inner-table-borders($width: 2px, $color: black) {
14
+ th, td {
15
+ border: {
16
+ right: $width solid $color;
17
+ bottom: $width solid $color;
18
+ left-width: 0px;
19
+ top-width: 0px; };
20
+ &:last-child,
21
+ &.last {
22
+ border-right-width: 0px; } }
23
+
24
+ // IE8 ignores rules that are included on the same line as :last-child
25
+ // see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details
26
+
27
+ tbody, tfoot {
28
+ tr:last-child {
29
+ th, td {
30
+ border-bottom-width: 0px; } }
31
+ tr.last {
32
+ th, td {
33
+ border-bottom-width: 0px; } } } }
@@ -0,0 +1,9 @@
1
+ @mixin table-scaffolding {
2
+ th {
3
+ text-align: center;
4
+ font-weight: bold; }
5
+ td,
6
+ th {
7
+ padding: 2px;
8
+ &.numeric {
9
+ text-align: right; } } }
@@ -0,0 +1,3 @@
1
+ @warn "This import is deprecated. Use 'compass/typography/text/ellipsis' instead.";
2
+
3
+ @import "../../typography/text/ellipsis";
@@ -0,0 +1,3 @@
1
+ @warn "This import is deprecated. Use 'compass/typography/text/nowrap' instead.";
2
+
3
+ @import "../../typography/text/nowrap";
@@ -0,0 +1,3 @@
1
+ @warn "This import is deprecated. Use 'compass/typography/text/replacement' instead.";
2
+
3
+ @import "../../typography/text/replacement";
@@ -44,17 +44,17 @@ a.link-button
44
44
  border: 1px solid $color-2
45
45
  padding: 2px 8px
46
46
  font-weight: bold
47
- color: $color-2
47
+ color: $color-2 !important
48
48
  width: auto
49
49
  +border-radius(30px)
50
50
  vertical-align: middle
51
51
  background: $color-4
52
- +background(linear-gradient(white, $color-3))
53
- +text-shadow(rgba(white, 1) 0 1px 0)
52
+ +background-image(linear-gradient(white, $color-3))
53
+ text-shadow: white 0px 1px 0px
54
54
  &:hover
55
55
  text-decoration: none
56
56
  &:active
57
- +background(linear-gradient($color-3, white))
57
+ +background-image(linear-gradient($color-3, white))
58
58
 
59
59
  img.visit-recorder
60
60
  position: absolute
@@ -1,10 +1,10 @@
1
1
  // Colors.
2
2
 
3
- $color-1: hsl(220, 100%, 20%) // #002266
4
- $color-2: hsl(220, 16%, 45%) // #606D85
5
- $color-3: hsl(220, 16%, 90%) // #E1E4EA
6
- $color-4: hsl(220, 16%, 95%) // #F0F2F4
7
- $color-5: hsl(220, 16%, 88%) // #DCDFE5
3
+ $color-1: hsl(215, 100%, 20%) // #002A66
4
+ $color-2: hsl(215, 16%, 45%) // #607085
5
+ $color-3: hsl(215, 16%, 90%) // #E1E5EA
6
+ $color-4: hsl(215, 16%, 95%) // #F0F2F4
7
+ $color-5: hsl(215, 16%, 86%) // #D6DAE1
8
8
  $gray-20: hsl(0, 0%, 20%)
9
9
  $gray-60: hsl(0, 0%, 60%)
10
10
  $gray-80: hsl(0, 0%, 80%)
@@ -1,10 +1,4 @@
1
1
  module Concen
2
2
  module ApplicationHelper
3
- # Remove all the new lines from the output.
4
- # This is very useful when used for inline-block elements, because
5
- # white spaces will transform into extra gaps between element.
6
- def one_line(&block)
7
- (capture_haml(&block).gsub("\n", '')).html_safe
8
- end
9
3
  end
10
4
  end
@@ -71,17 +71,26 @@ module Concen
71
71
  PROTECTED_FIELDS = [:_id, :parent_id, :level, :created_at, :updated_at, :content, :raw_text, :position, :grid_files, :ancestor_slugs]
72
72
 
73
73
  def content_in_html(key = "main", data={})
74
+ html = nil
75
+
74
76
  if content = self.content.try(:[], key)
77
+ # Parse mustache first.
75
78
  content = Mustache.render(content, data)
79
+
80
+ # Parse markdown.
76
81
  markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, Concen.markdown_extensions)
77
82
  html = markdown.render content
83
+
84
+ # Parse smartypants.
78
85
  if Concen.parse_markdown_with_smartypants
86
+ # Temporary hack to fix smartypants bug in Redcarpet 2.0.0b5.
87
+ html.gsub!("&#39;", "'")
88
+
79
89
  html = Redcarpet::Render::SmartyPants.render html
80
90
  end
81
- return html
82
- else
83
- return nil
84
91
  end
92
+
93
+ return html
85
94
  end
86
95
 
87
96
  def images(filename=nil)
@@ -0,0 +1,23 @@
1
+ <%= form_for [@page, @grid_file], :url => concen_page_grid_file_path(@page, @grid_file), :html => {:class => "with-text-editor wide"} do |f| %>
2
+ <% if @grid_file.errors.any? %>
3
+ <div id="errorExplanation">
4
+ <h3><%= "#{pluralize(@page.errors.count, "error")} prohibited this parent from being saved:" %></h3>
5
+ <ul>
6
+ <% @page.errors.full_messages.each do |msg| %>
7
+ <li><%= msg %></li>
8
+ <% end %>
9
+ </ul>
10
+ </div>
11
+ <% end %>
12
+ <div class="field text-editor">
13
+ <div class="border">
14
+ <div id="text-editor" class="wide"></div>
15
+ </div>
16
+ </div>
17
+ <%= text_area_tag :concen_grid_file_page, @grid_file.read.force_encoding("utf-8"), :class => "text-editor-content hidden" %>
18
+ <div class="actions flush">
19
+ <%= f.submit "Save" %>
20
+ <%= link_to "Delete", concen_page_grid_file_path(@page, @grid_file), :method => :delete %>
21
+ <%= link_to "Cancel", edit_concen_page_path(@page) %>
22
+ </div>
23
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <% content_for :head_javascripts do %>
2
+ <%= javascript_include_tag "concen/pages" %>
3
+ <% end %>
4
+
5
+ <div id="content">
6
+ <h1><%= "Edit #{@grid_file.original_filename}" %></h1>
7
+ <div class="clearfix">
8
+ <%= render "form" %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,11 @@
1
+ <ul>
2
+ <% files.each_with_index do |file, index| %>
3
+ <li>
4
+ <%= link_to "#{file.original_filename} (#{number_to_human_size(file.size)})", file.url(root_url), :class => "filename", "data-path" => file.path %>
5
+ <% if file.text? %>
6
+ <%= link_to "Edit", edit_concen_page_grid_file_path(file.page, file) %>
7
+ <% end %>
8
+ <%= link_to "Delete", concen_page_grid_file_path(file.page, file), :class => "delete" %>
9
+ </li>
10
+ <% end %>
11
+ </ul>
@@ -0,0 +1,32 @@
1
+ <div class="files">
2
+ <div class="stylesheets">
3
+ <h3>
4
+ <span>Stylesheets</span>
5
+ <%= link_to "New", concen_page_grid_files_path(@page, :file_type => "css"), :class => "link-button new-file" %>
6
+ </h3>
7
+ <% if @page.stylesheets.any? %>
8
+ <%= render :partial => "concen/pages/file_list", :locals => {:files => @page.stylesheets} %>
9
+ <% end %>
10
+ </div>
11
+ <div class="javascripts">
12
+ <h3>
13
+ <span>JavaScripts</span>
14
+ <%= link_to "New", concen_page_grid_files_path(@page, :file_type => "js"), :class => "link-button new-file" %>
15
+ </h3>
16
+ <% if @page.javascripts.any? %>
17
+ <%= render :partial => "concen/pages/file_list", :locals => {:files => @page.javascripts} %>
18
+ <% end %>
19
+ </div>
20
+ <% if @page.images.any? %>
21
+ <div class="images">
22
+ <h3>Images</h3>
23
+ <%= render :partial => "concen/pages/file_list", :locals => {:files => @page.images} %>
24
+ </div>
25
+ <% end %>
26
+ <% if @page.others.any? %>
27
+ <div class="others">
28
+ <h3>Others</h3>
29
+ <%= render :partial => "concen/pages/file_list", :locals => {:files => @page.others} %>
30
+ </div>
31
+ <% end %>
32
+ </div>
@@ -0,0 +1,26 @@
1
+ <%= form_for @page, {:html => {:class => "with-text-editor #{'wide' if !@page.persisted?}"}} do |f| %>
2
+ <% if @page.errors.any? %>
3
+ <div id="errorExplanation">
4
+ <h3><%= "#{pluralize(@page.errors.count, "error")} prohibited this parent from being saved:" %></h3>
5
+ <ul>
6
+ <% @page.errors.full_messages.each do |msg| %>
7
+ <li><%= msg %></li>
8
+ <% end %>
9
+ </ul>
10
+ </div>
11
+ <% end %>
12
+ <div class="field text-editor">
13
+ <div class="border">
14
+ <div id="text-editor"></div>
15
+ </div>
16
+ </div>
17
+ <%= f.text_area :raw_text, :class => "text-editor-content hidden" %>
18
+ <%= f.hidden_field :parent_id %>
19
+ <div class="actions flush">
20
+ <%= f.submit "Save" %>
21
+ <% if @page.persisted? %>
22
+ <%= link_to "Delete", concen_page_path(@page), :method => :delete %>
23
+ <% end %>
24
+ <%= link_to "Cancel", concen_pages_path %>
25
+ </div>
26
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <% if root && page.level == 0 %>
2
+ <% children = [page] %>
3
+ <% else %>
4
+ <% children = Concen::Page.where(:parent_id => page.id).asc(:position) %>
5
+ <% end %>
6
+
7
+ <ul class="<%= 'pages' if children.first.level == 0 %>" data-level="<%= children.first.level %>">
8
+ <% for child in children %>
9
+ <li data-id="<%= "page-" + child.id.to_s %>">
10
+ <p class="<%= 'author' if child.authors_as_user.map(&:_id).include? current_concen_user.id %>">
11
+ <span class="handle"></span>
12
+ <%= link_to child.title, edit_concen_page_path(child), :class => "title" %>
13
+ <%= link_to "Add", new_concen_page_path(:parent_id => child.id), :class => "link-button hidden" %>
14
+ <%= link_to "Edit", edit_concen_page_path(child), :class => "link-button hidden" %>
15
+ <%= link_to "Delete", concen_page_path(child), :method => :delete, :confirm => "Are you sure?", :class => "link-button hidden" %>
16
+ </p>
17
+ <% if Concen::Page.where(:parent_id => child.id).count > 0 %>
18
+ <%= render :partial => "nested_list", :locals => {:page => child, :root => false} %>
19
+ <% end %>
20
+ </li>
21
+ <% end %>
22
+ </ul>
@@ -0,0 +1,19 @@
1
+ <% content_for :head_javascripts do %>
2
+ <%= javascript_include_tag "concen/pages" %>
3
+ <% end %>
4
+
5
+ <div id="content">
6
+ <h1>Edit Page</h1>
7
+ <%= render "form" %>
8
+ <div id="file-manager">
9
+ <div class="border">
10
+ <div id="file-uploader" data-upload-path="<%= upload_concen_page_grid_files_path(@page) %>">
11
+ <noscript>
12
+ <p>Please enable JavaScript to use file uploader.</p>
13
+ </noscript>
14
+ </div>
15
+ <%= render "files" %>
16
+ </div>
17
+ </div>
18
+ <div class="clear"></div>
19
+ </div>