Forráskód Böngészése

Cleanup unused code and prepare to open source the app

Markus Ochel 12 éve
szülő
commit
19a88aaa8e

+ 3 - 72
README.md

@@ -1,5 +1,5 @@
-Setup
------
+Setup & Deployment
+------------------
 
 For new setup, begin with installing dependencies as follows:
 
@@ -12,75 +12,6 @@ Push the current app (site or admin) to development CouchDB
 
     $ kanso push
 
-Once configure a `.kansorc` file with a production config named `live`
+Once a `.kansorc` file is created with a production config setting named `live` then we can deploy to prodcution using:
 
     $ kanso push live
-
-Fonts
------
-
-**Google Fonts URL** for some review fonts:
-
-    http://www.google.com/webfonts#ReviewPlace:refine/Collection:Dosis:200,400,700|Lato:300,400,700|Droid+Serif:400,700,400italic,700italic
-
-In CSS `.styl` file we are using the _Lato_ font:
-
-    @import url('http://fonts.googleapis.com/css?family=Lato:300,400,700')
-
-    body
-      font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif
-      font-weight: 300
-      font-size: 16px
-      letter-spacing: 0em
-      word-spacing: 0.2em
-      line-height: 1.5em
-
-Main Photos
------------
-
-Dimension must be **900 x 180** pixels saved as JPG at _70%_ or a PNG with trying to keep file size below 50K.
-
-
-Donation URL
-------------
-
-    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=N62XWCYGBQRQY
-
-Temp Stuff
-----------
-
-  select ID, post_date_gmt, post_content, post_title, post_modified_gmt, post_name, post_author, guid from wp_posts where post_type = 'post' and post_status = 'publish'
-
-
-  select "www.evolvingwellness.com" as site, "essay" as type, post_date_gmt as published_at, post_content as body, post_title as title, post_modified_gmt as updated_at, post_name as slug, case post_author when 2 then "2d9a5976ee3b7d7130154b708e03a517" else post_author end as author_id, ID as old_id, post_name as old_slug, guid as old_url from wp_posts where post_type = 'post' and post_status = 'publish' limit 10
-
-  kanso transform csv --indent=2 query_result.csv query_result.json
-
-  kanso transform add-ids -u http://localhost:80 query_result.json query_result_ids.json
-
-  kanso transform map --module=map.js query_result_ids.json query_result_final.json
-
-  kanso upload query_result_final.json
-
-
-{
-   "_id": "92655f6a1695d5c822d3c794e50074a5",
-   "site": "www.evolvingwellness.com",
-   "slug": "",
-   "title": "",
-   "intro": "",
-   "body": "",
-   "photo": "",
-   "published": true,
-   "published_at": "2012-08-20T18:30:00.000Z",
-   "updated_at": "2012-09-27T23:15:41.134Z",
-   "author_id": "56a80424639f9e4f5353bd01e20637c9",
-   "collections": [],
-   "type": "essay",
-   "_attachments": {}
-}
-
-Evolving Wellness = 569 docs
-Evolving Beings = 497 docs
-Evolving Scenes = 580 docs
-Healthytarian = 22 docs

+ 9 - 7
TASKS.todo

@@ -1,22 +1,24 @@
 New Admin Features:
  ☐ Rename a collection
- ✔ Arbitrary site redirects @done (13-01-05 20:22)
  ☐ Offline and crash recovery support
  ☐ Image insertion into content
- ✔ List sorting options @done (13-02-16 21:14)
  ☐ Option to remove dates from bottom of pages
  ☐ Create a layout selection feature
- ✔ Sponsor `include_default_ad_unit` flag option @done (13-02-16 21:22)
+ ☐ Rework the FileUpload feature - make clearer
 
  --- ✄ -----------------------
 
- Donuts:
+Bugs:
+ ☐ Fix fullscreen mode on iPad / mobile devices
 
 
-Crispies:
+Issues:
  ☐ Session timeout and recovery
  ☐ Large data sets rendering
 
- Nice To Have:
+
+Nice To Have:
  ☐ Cleaner mobile layout
- ☐ Brand logo for Kleks
+ ☐ Brand logo for Kleks
+ ☐ Documentation of the whole app
+ ☐ Release as open source on GitHub

+ 3 - 3
admin/kanso.json

@@ -1,7 +1,7 @@
 {
-  "name": "admin",
-  "version": "0.0.1",
-  "description": "Kleks admin application that allows writers to manage content.",
+  "name": "kleks-admin",
+  "version": "0.5.1",
+  "description": "Kleks admin application that allows management of sites and content.",
   "load": "server/setup",
   "modules": ["server","controllers","models","lib"],
   "handlebars": {

+ 1 - 1
admin/server/lists.coffee

@@ -20,4 +20,4 @@ exports.docs = (head, req) ->
 
     rows.push({id: doc._id, doc: doc})
 
-  return JSON.stringify({ count: rows.length, rows: rows })
+  return JSON.stringify({ count: rows.length, rows: rows })

+ 2 - 2
admin/server/rewrites.coffee

@@ -51,8 +51,8 @@ module.exports = [
   { from: '/file/:id/:filename', to: '../../:id/:filename' }
 
   # show color page
-  { from: "/_colors", to: "_show/colors" }
+  { from: "/_color_samples", to: "_show/color_samples" }
 
   # catch all
   { from: "*", to: "_show/not_found" }
-]
+]

+ 1 - 1
admin/server/setup.coffee

@@ -4,4 +4,4 @@ module.exports =
   lists: require("./lists")
   rewrites: require("./rewrites")
   updates: require("./updates")
-  validate_doc_update: require('./validate').validate_doc_update
+  validate_doc_update: require('./validate').validate_doc_update

+ 3 - 3
admin/server/shows.coffee

@@ -8,8 +8,8 @@ exports.not_found = (doc, req) ->
   title: "404 Not Found"
   content: templates.render("404.html", req, {})
 
-exports.colors = (doc, req) ->
+exports.color_samples = (doc, req) ->
   title: "Color Samples"
-  content: templates.render("colors.html", req, {
+  content: templates.render("colors_samples.html", req, {
     colors: ['#BAD0EF', '#9EDFB5', '#DFA57C', '#E6BC7E', '#D5D298', '#98D5A7', '#98D5BA', '#91D6DF', '#8FB1DD', '#A8B5E7', '#AF9EDA', '#DA9EC7', '#DA9EAF', '#DA9EA1', '#DAA39E', '#DAAF9E', '#DABB9E', '#DAC79E', '#A5DA9E', '#9EDAB1', '#9EC4DA', '#B6B4EB', '#DD9DAC', '#BAA8E6', '#B5E6A8', '#E6D4A8', '#E6CBA8', '#E6B7A8', '#97BEAD']
-  })
+  })

+ 1 - 1
admin/server/updates.coffee

@@ -32,4 +32,4 @@ destroy = (doc, req) ->
   resp =
     ok: yes
     body: JSON.stringify({})
-  [doc, resp]
+  [doc, resp]

+ 1 - 1
admin/templates/colors.html → admin/templates/color_samples.html

@@ -11,7 +11,7 @@
   <div style="width: 960px;" class="clearfix">
     <div style="background: {{.}}; width: 100px; height: 80px; float: right; color: #fff; text-align: center;">{{.}}</div>
     <div class="site-name" style="font-size: 5.25em; float: left;">
-      Evolving <b style="color: {{.}};">Something</b>
+      Great <b style="color: {{.}};">Something</b>
     </div>
     <div>The color code is {{.}}</div>
   </div>

+ 2 - 2
site/kanso.json

@@ -1,6 +1,6 @@
 {
-  "name": "site",
-  "version": "0.0.1",
+  "name": "kleks-site",
+  "version": "0.5.1",
   "description": "Kleks site application that renders each site.",
   "load": "server/setup",
   "modules": ["server","lib"],

+ 1 - 37
site/lib/app.coffee

@@ -91,23 +91,6 @@ setupNavMenus = ->
         site = $inputField.attr('data-site')
         query = encodeURIComponent("site:#{site} AND (#{term})")
         
-        # TEMP FOR TESTING
-        # data = {
-        #   total_rows: 3,
-        #   rows: [
-        #     {fields: {type: 'essay', title: 'Title 1 Goes Here', slug: 'title-1'}},
-        #     {fields: {type: 'essay', title: 'Title 2 Goes Here', slug: 'title-2'}},
-        #     {fields: {type: 'essay', title: 'Title 3 Goes Here', slug: 'title-3'}}
-        #   ]
-        # }
-        # $searchResultsList.html("<li><strong>#{data.total_rows}</strong> matches found.</li>")
-        # for row in data.rows
-        #   if row.fields.slug
-        #     $item = $("<li><h3><a href=\"/#{row.fields.type}/#{row.fields.slug}\"><i class=\"icon icon-#{row.fields.type}\"></i>#{row.fields.title}</a></h3></li>")
-        #   else
-        #     $item = $("<li><h3><a href=\"/\"><i class=\"icon icon-essay\"></i>Home</a></h3></li>")
-        #   $searchResultsList.append($item)
-        
         $.ajax
           type: 'GET'
           url: "/json/search?q=#{query}"
@@ -123,7 +106,7 @@ setupNavMenus = ->
                   $item = $("<li><h3><a href=\"/\"><i class=\"icon icon-essay\"></i>Home</a></h3></li>")
                 $searchResultsList.append($item)
             else
-              $searchResultsList.html("<li>Server didn't respond with any data.</li>")
+              $searchResultsList.html("<li>Server didn\'t respond with any data.</li>")
 
   $mainNavSearchInput.on 'keydown', performSearch
   $searchResultsInput.on 'keydown', performSearch
@@ -232,25 +215,6 @@ setupCollectionDocsNav = (docs, $collectionNavList) ->
         _gaq?.push(['_trackEvent', 'Site Navigation', 'Click', 'Doc Nav Next'])
 
       $(document).on 'keydown', (e) ->
-        # if Modernizr.history
-        #   currentId = $collectionNavList.find('.active').attr('data-id')
-        #   if currentId
-        #     currentIndex = $.grep(docs, (d, i) -> if d._id is currentId then i)
-        #     if e.which is 37
-        #       # console.log docs[currentIndex-1]?._id
-        #       doc = docs[currentIndex-1]
-        #     else if e.which is 39
-        #       # console.log docs[currentIndex+1]?.title
-        #       doc = docs[currentIndex+1]
-
-        #     if doc
-        #       $('article.view > .title').html(doc.title)
-        #       $('article.view > .photo img')
-        #         .attr('src', "/file/{{doc._id}}/{{doc.photo}}")
-        #         .attr('alt', "#{doc.title}")
-        #       $('article.view > .intro').html(doc.intro_html)
-        #       $('article.view > .body').html(doc.body_html)
-        # else
         if e.which is 37
           $docNavPrev.click()
         else if e.which is 39

+ 0 - 1
site/server/indexes.coffee

@@ -1,4 +1,3 @@
-
 exports.site_docs =
   index: (doc) ->
     blocks = ['site_intro','site_home']

+ 1 - 1
site/server/lists.coffee

@@ -407,5 +407,5 @@ exports.sitemap = (head, req) ->
         url: "#{siteLink}/#{type}/#{slug}"
         date: date
 
-  return templates.render 'sitemap.html', req,
+  return templates.render 'sitemap.xml', req,
     docs: docs

+ 1 - 1
site/server/rewrites.coffee

@@ -10,7 +10,7 @@ module.exports = [
   { from: '/static/*', to: 'static/*' }
 
   # Dynamic site rendering used with a virtual host like:
-  # www.evitaochel.com = /kleks/_design/site/_rewrite/render/evitaochel
+  # www.somesite.com = /kleks/_design/site/_rewrite/render/www.somesite.com
   {
     from: '/render/:site',
     to: '_list/home/docs_for_home',

+ 1 - 1
site/server/setup.coffee

@@ -4,4 +4,4 @@ module.exports =
   lists: require("./lists")
   rewrites: require("./rewrites")
   filters: require('./filters')
-  indexes: require("./indexes")
+  indexes: require("./indexes")

+ 2 - 2
site/server/shows.coffee

@@ -21,7 +21,7 @@ exports.moved = (doc, req) ->
 exports.moved_pattern = (doc, req) ->
   loc = req.query.loc
   switch req.query.site
-    when 'www.evitaochel.com'
+    when 'some_site_id' # Example: www.markuso.com
       type = 'essay'
     else
       type = 'essay'
@@ -31,4 +31,4 @@ exports.moved_pattern = (doc, req) ->
   return {
     code: 301
     headers: { 'Location': loc }
-  }
+  }

+ 0 - 2
site/server/views.coffee

@@ -1,4 +1,3 @@
-
 exports.docs_for_home =
   map: (doc) ->
     # List of collections sorted by `pinned` then `updated_at`,
@@ -107,4 +106,3 @@ exports.redirects_by_slug =
   map: (doc) ->
     if doc.site and doc.type and doc.type is 'redirect' and doc.slug and doc.location
       emit [doc.site, doc.slug], doc.location
-    

+ 1 - 1
site/templates/base.html

@@ -114,7 +114,7 @@
   </script>
 
   {{#unless on_dev}}
-    {{! Do the following on production }}
+    {{! Do the following on production only }}
     {{#if site.google_analytics_code}}
     <script type="text/javascript">
       var _gaq = [];

+ 0 - 0
site/templates/sitemap.html → site/templates/sitemap.xml


+ 0 - 1
site/templates/test.html

@@ -1 +0,0 @@
-<h1>SITE TEST PAGE</h1>