kinbote 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,116 @@
1
+ /* Example SaSS
2
+ $blue: #3bbfce;
3
+ $margin: 16px;
4
+
5
+ .content-navigation {
6
+ border-color: $blue;
7
+ color:
8
+ darken($blue, 9%);
9
+ }
10
+
11
+ .border {
12
+ padding: $margin / 2;
13
+ margin: $margin / 2;
14
+ border-color: $blue;
15
+ }
16
+
17
+ */
18
+
19
+ /* For Backend Styles */
20
+
21
+ /* STRUCTURE */
22
+
23
+ $page-width: 95%;
24
+ $nav-width: 16.6667%; /* 160/960 = 0.16666 */
25
+ $col-margin: 1.0417%; /* 10/960 = 0.010417 */
26
+ $font-size: 16;
27
+
28
+ nav, #page, .main {
29
+ float: left;
30
+ margin-right: $col-margin;
31
+ }
32
+ .last {
33
+ margin-right: 0;
34
+ }
35
+ header {
36
+ margin-bottom: 1.0em;
37
+ }
38
+ nav {
39
+ width: $nav-width;
40
+ }
41
+ #page {
42
+ width: $page-width;
43
+ padding: 20px;
44
+ }
45
+ .main {
46
+ width: $page-width - $nav-width - $col-margin - 8.333%;
47
+ margin-left: 8.333% ; /* 80/960 = 0.08333 */
48
+ }
49
+
50
+ /* TYPOGRAPHY */
51
+ body {
52
+ font: normal 100% Georgia,'Times New Roman',serif;
53
+ line-height: 26/$font-size;
54
+ }
55
+
56
+ p {
57
+ margin: 0 0 0.5em 0;
58
+ }
59
+
60
+ /* Headers */
61
+ h1, h2, h3, h4 {
62
+ font-family:Helvetica,Arial,'Liberation Sans', FreeSans,sans-serif;
63
+ }
64
+
65
+ h1 {
66
+ font-size: 1.625em; /* 26px/16px = 1.625em */
67
+ line-height: 22/$font-size;
68
+ margin: 0 0 0.5em 0;
69
+ text-transform:uppercase;
70
+ }
71
+ header h1 {
72
+ margin-bottom: 0.1em;
73
+ }
74
+
75
+ nav h1 {
76
+ font-size: 1em;
77
+ }
78
+ .main h1 {
79
+ font-size: 2em;
80
+ margin: 0 0 0.5em 0;
81
+ text-transform:capitalize;
82
+ }
83
+
84
+ /* Navigation */
85
+ nav {
86
+
87
+ border-top:1px solid #ccc;
88
+ padding-top: 10px;
89
+ li {
90
+ border-bottom: 1px solid #ccc;
91
+ padding: 10px 0;
92
+ line-height: 1.375em; /* 22px/16px = */
93
+ }
94
+ }
95
+
96
+ li#link-to-real-site {
97
+ margin-top: 10px;
98
+ padding-top: 10px;
99
+ border-bottom: none;
100
+ background: #ccc;
101
+ }
102
+
103
+ /* STYLES */
104
+
105
+ /* Pages */
106
+
107
+ .has-sass {
108
+ display: block;
109
+ }
110
+
111
+ .has-sass .inner{
112
+ visibility: hidden;
113
+ }
114
+ tr.page:hover .has-sass .inner {
115
+ visibility: visible;
116
+ }
@@ -0,0 +1,53 @@
1
+ /* http://meyerweb.com/eric/tools/css/reset/ */
2
+ /* v1.0 | 20080212 */
3
+
4
+ html, body, div, span, applet, object, iframe,
5
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
6
+ a, abbr, acronym, address, big, cite, code,
7
+ del, dfn, em, font, img, ins, kbd, q, s, samp,
8
+ small, strike, strong, sub, sup, tt, var,
9
+ b, u, i, center,
10
+ dl, dt, dd, ol, ul, li,
11
+ fieldset, form, label, legend,
12
+ table, caption, tbody, tfoot, thead, tr, th, td {
13
+ margin: 0;
14
+ padding: 0;
15
+ border: 0;
16
+ outline: 0;
17
+ font-size: 100%;
18
+ vertical-align: baseline;
19
+ background: transparent;
20
+ }
21
+ body {
22
+ line-height: 1;
23
+ }
24
+ ol, ul {
25
+ list-style: none;
26
+ }
27
+ blockquote, q {
28
+ quotes: none;
29
+ }
30
+ blockquote:before, blockquote:after,
31
+ q:before, q:after {
32
+ content: '';
33
+ content: none;
34
+ }
35
+
36
+ /* remember to define focus styles! */
37
+ :focus {
38
+ outline: 0;
39
+ }
40
+
41
+ /* remember to highlight inserts somehow! */
42
+ ins {
43
+ text-decoration: none;
44
+ }
45
+ del {
46
+ text-decoration: line-through;
47
+ }
48
+
49
+ /* tables still need 'cellspacing="0"' in the markup */
50
+ table {
51
+ border-collapse: collapse;
52
+ border-spacing: 0;
53
+ }
@@ -3,4 +3,4 @@
3
3
  %h5 This page's attributes:
4
4
  %ul
5
5
  - @page.attributes.each do |attribute|
6
- %li= "#{attribute}: #{attribute.values.join(", ")}"
6
+ %li= "#{attribute}: #{attribute.values_for(@page).join(", ")}"
@@ -3,14 +3,31 @@
3
3
  %head
4
4
  %title Kinbote | #{@p ? @p.title : ""}
5
5
  %meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
6
+ %link{:href => "/kinbote/css/reset.css", :rel => "stylesheet", :type => "text/css"}
7
+ %link{:href => "/kinbote/css/core.css", :rel => "stylesheet", :type => "text/css"}
8
+ %script{:src => "/kinbote/js/jquery.js", :type => "text/javascript"}
9
+ %script{:src => "/kinbote/js/core.js", :type => "text/javascript"}
6
10
 
7
- %body
11
+ %body.management
12
+ #page
13
+ %header
14
+ %hgroup
15
+ %h1= $site.title
16
+ %h2 A Kinbote Commentary
17
+
18
+ %nav
19
+ %h1 Manage
20
+ %ul
21
+ %li
22
+ %a{:href => "/kinbote"} Site
23
+ %li
24
+ %a{:href => "/kinbote/pages"} Pages
25
+ %li
26
+ %a{:href => "/kinbote/attributes"} Attributes
27
+ %li#link-to-real-site
28
+ %a{:href => "/"} The real site
8
29
 
9
- %a{:href => "/kinbote"} site
10
- %a{:href => "/kinbote/pages"} pages
11
- %a{:href => "/kinbote/attributes"} attributes
12
- %a{:href => "/", :style => "margin-left:400px;"} The real site >>
13
-
14
- = haml :'../.kinbote/views/messages', :layout => false
15
-
16
- = yield
30
+ = haml :'../.kinbote/views/messages', :layout => false
31
+
32
+ %section.main.last
33
+ = yield
@@ -7,7 +7,7 @@
7
7
  %input{:type => "text", :name => "page[values][]", :value => @p.title}
8
8
  %br
9
9
  - @p.attributes.each do |attribute|
10
- - attribute.values.each do |value|
10
+ - attribute.values_for(@p).each do |value|
11
11
  %input{:type => "text", :name => "page[keys][]", :value => attribute.name}
12
12
  %input{:type => "text", :name => "page[values][]", :value => value.value}
13
13
  %br
@@ -1,26 +1,64 @@
1
- %h1 Manage the pages on my website
1
+ %h1 Manage the Pages on my website
2
+
3
+ .bordered{:style => "border: 1px solid black"}
4
+ %h3 Filter the displayed pages
5
+ %form{:action => "/kinbote/pages", :method => "get"}
6
+ %select{:name => "attribute"}
7
+ %option{:selected => (!params.has_key?("attribute") || params["attribute"].strip.size == 0) ? "true" : nil}
8
+ - $site.attributes.each do |attribute|
9
+ %option{:selected => (attribute.name == params["attribute"]) ? "true" : nil}= attribute.name
10
+ %input{:type => "text", :name => "value", :value => params["value"]}
11
+ %input{:type => "submit", :value => "Filter"}
12
+
13
+ .bordered{:style => "border: 1px solid black"}
14
+ %h3 Apply an action to checked pages (don't forget to check off pages to make these work)
15
+
16
+ %h4 Add attribute/value
17
+ %form{:class => "bulk", :action => "/kinbote/pages/bulk_update", :method => "post"}
18
+ %input{:type => "hidden", :name => "action[type]", :value => "add_attribute"}
19
+ %input{:type => "text", :name => "action[attribute]"}
20
+ %input{:type => "text", :name => "action[value]"}
21
+ %input{:type => "submit", :value => "Add"}
22
+
23
+ %h4 Remove attribute/value
24
+ %form{:class => "bulk", :action => "/kinbote/pages/bulk_update", :method => "post"}
25
+ %input{:type => "hidden", :name => "action[type]", :value => "rem_attribute"}
26
+ %select{:name => "action[attribute]"}
27
+ - $site.attributes.each do |attribute|
28
+ %option= attribute.name
29
+ %input{:type => "text", :name => "action[value]"}
30
+ %input{:type => "submit", :value => "Remove"}
31
+
32
+ .bordered{:style => "border: 1px solid black"}
33
+ %h3 Make a new page
34
+ %form{:action => "/kinbote/pages/new", :method => "post"}
35
+ %input{:type => "text", :name => "page[title]"}
36
+ %input{:type => "submit", :value => "Create new page"}
2
37
 
3
38
  - if $site.pages.size > 0
4
- %table
39
+ %table#pages
5
40
  %tr
41
+ %th
42
+ %a{:id => "chk1", :href => "#"} Check all
43
+ %br
44
+ %a{:id => "chk0", :href => "#"} Check none
6
45
  %th Title
7
46
  %th Attributes
8
- %th Create SASS
9
- %th Delete
10
47
  - $site.pages.each do |page|
11
- %tr
12
- %td
13
- %a{:href => "/kinbote/pages/#{page.slug}"}= page.title
14
- %td= "[#{page.attributes.map{|a| "#{a}: #{a.values.map{|v| v.to_s}.join(', ')}"}.join('] [')}]"
15
- %td
16
- - if !page.has_file?(:css)
17
- %form{:action => "/kinbote/pages/#{page.slug}/css", :method => "post"}
18
- %input{:type => "submit", :value => "Create SASS"}
19
- %td
20
- %form{:action => "/kinbote/pages/#{page.slug}/delete", :method => "post"}
21
- %input{:type => "submit", :value => "Delete page"}
48
+ - if !page.filtered_by?(params["attribute"], params["value"])
49
+ %tr.page
50
+ %td
51
+ %input{:type => "checkbox", :name => "page_slugs[]", :value => page.slug}
52
+ %td
53
+ %a{:href => "/kinbote/pages/#{page.slug}"}= page.title
54
+ %div.has-sass
55
+ .inner
56
+ - if !page.has_file?(:css)
57
+ %form{:action => "/kinbote/pages/#{page.slug}/css", :method => "post"}
58
+ %input{:type => "submit", :value => "Create SASS"}
59
+ - else
60
+ Already has a css file
61
+ %form{:action => "/kinbote/pages/#{page.slug}/delete", :method => "post"}
62
+ %input{:type => "submit", :value => "Delete page"}
63
+ %td= "[#{page.attributes.map{|a| "#{a}: #{a.values_for(page).map{|v| v.to_s}.join(', ')}"}.join('] [')}]"
22
64
 
23
- %h3 Make a new page
24
- %form{:action => "/kinbote/pages/new", :method => "post"}
25
- %input{:type => "text", :name => "page[title]"}
26
- %input{:type => "submit", :value => "Create new page"}
@@ -1,4 +1,15 @@
1
- %h1 Manage my website
1
+ %h1 Publish the Site
2
+
3
+ %p Your publishing settings are controlled in config.yml
2
4
 
3
5
  %form{:action => "/kinbote/publish", :method => "post"}
4
- %input{:type => "submit", :value => "Publish"}
6
+ %input{:type => "submit", :value => "Publish"}
7
+
8
+ - if @updated_files
9
+ %h2 Updated Files:
10
+ %ul
11
+ - if @updated_files.size == 0
12
+ %li None!
13
+ - else
14
+ - @updated_files.each do |file|
15
+ %li= file
@@ -0,0 +1,13 @@
1
+ title: Kinbote Site
2
+
3
+ # How you want to Kinbote to indent your haml files (good options: ' ' or '\t')
4
+ haml_indentation: ' '
5
+
6
+ # Whether or not you want sample Kinbote code generated for each of your pages
7
+ print_sample_code: true
8
+
9
+ # SSH credentials used to publish your site
10
+ #remote_host: yoursite.com
11
+ #remote_path: /home/www/
12
+ #remote_user: username
13
+ #remote_pw: password
@@ -1 +1 @@
1
- User-agent: *
1
+ User-agent: *
@@ -17,4 +17,4 @@
17
17
  - if @page
18
18
  %a{:href => "/"} < Back to the home page
19
19
 
20
- = yield
20
+ = yield
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kinbote
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jay Boice
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-11 00:00:00 -04:00
18
+ date: 2010-08-03 00:00:00 -04:00
19
19
  default_executable: kinbote
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -77,6 +77,7 @@ files:
77
77
  - LICENSE
78
78
  - README.rdoc
79
79
  - Rakefile
80
+ - TODO
80
81
  - bin/kinbote
81
82
  - kinbote.gemspec
82
83
  - lib/kinbote.rb
@@ -90,6 +91,10 @@ files:
90
91
  - lib/kinbote/value.rb
91
92
  - lib/sinatra/kinbote.rb
92
93
  - lib/sinatra/kinbote_helpers.rb
94
+ - site/.kinbote/js/core.js
95
+ - site/.kinbote/js/jquery.js
96
+ - site/.kinbote/sass/core.sass
97
+ - site/.kinbote/sass/reset.sass
93
98
  - site/.kinbote/views/attributes.haml
94
99
  - site/.kinbote/views/examples/header.haml
95
100
  - site/.kinbote/views/examples/home.haml
@@ -104,7 +109,7 @@ files:
104
109
  - site/.kinbote/views/page.haml
105
110
  - site/.kinbote/views/pages.haml
106
111
  - site/.kinbote/views/site.haml
107
- - site/config/site.yml
112
+ - site/config.yml.sample
108
113
  - site/kinbote-server
109
114
  - site/public/favicon.ico
110
115
  - site/public/js/core.js
@@ -1 +0,0 @@
1
- title: Kinbote Site