cortex-reaver 0.1.0 → 0.2.0

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.
Files changed (141) hide show
  1. data/README +1 -1
  2. data/bin/cortex_reaver +3 -4
  3. data/lib/cortex_reaver.rb +270 -110
  4. data/lib/cortex_reaver/cache.rb +23 -0
  5. data/lib/cortex_reaver/config.rb +178 -74
  6. data/lib/cortex_reaver/controller/admin.rb +64 -4
  7. data/lib/cortex_reaver/controller/comment.rb +4 -4
  8. data/lib/cortex_reaver/controller/controller.rb +3 -3
  9. data/lib/cortex_reaver/controller/journal.rb +4 -2
  10. data/lib/cortex_reaver/controller/main.rb +117 -26
  11. data/lib/cortex_reaver/controller/page.rb +7 -0
  12. data/lib/cortex_reaver/controller/photograph.rb +12 -10
  13. data/lib/cortex_reaver/controller/tag.rb +1 -1
  14. data/lib/cortex_reaver/controller/user.rb +7 -2
  15. data/lib/cortex_reaver/helper/attachments.rb +2 -2
  16. data/lib/cortex_reaver/helper/crud.rb +7 -7
  17. data/lib/cortex_reaver/helper/feeds.rb +56 -38
  18. data/lib/cortex_reaver/helper/form.rb +12 -16
  19. data/lib/cortex_reaver/helper/navigation.rb +35 -16
  20. data/lib/cortex_reaver/helper/photographs.rb +2 -2
  21. data/lib/cortex_reaver/helper/sidebar.rb +44 -0
  22. data/lib/cortex_reaver/helper/tags.rb +32 -9
  23. data/lib/cortex_reaver/helper/workflow.rb +2 -14
  24. data/lib/cortex_reaver/layout/blank.rhtml +27 -31
  25. data/lib/cortex_reaver/layout/text.rhtml +54 -67
  26. data/lib/cortex_reaver/migrations/014_convert_projects_to_pages.rb +79 -0
  27. data/lib/cortex_reaver/model/comment.rb +7 -8
  28. data/lib/cortex_reaver/model/page.rb +5 -3
  29. data/lib/cortex_reaver/model/photograph.rb +57 -13
  30. data/lib/cortex_reaver/model/tag.rb +1 -4
  31. data/lib/cortex_reaver/model/user.rb +6 -3
  32. data/lib/cortex_reaver/plugin.rb +1 -1
  33. data/lib/cortex_reaver/plugins/twitter.rb +185 -0
  34. data/lib/cortex_reaver/public/css/actions.css +31 -0
  35. data/lib/cortex_reaver/public/css/admin.css +50 -27
  36. data/lib/cortex_reaver/public/css/attachments.css +11 -0
  37. data/lib/cortex_reaver/public/css/autotags.css +38 -0
  38. data/lib/cortex_reaver/public/css/code.css +10 -2
  39. data/lib/cortex_reaver/public/css/colophon.css +10 -0
  40. data/lib/cortex_reaver/public/css/commments.css +7 -0
  41. data/lib/cortex_reaver/public/css/custom.css +1 -0
  42. data/lib/cortex_reaver/public/css/flash.css +17 -0
  43. data/lib/cortex_reaver/public/css/fonts.css +22 -0
  44. data/lib/cortex_reaver/public/css/form.css +15 -3
  45. data/lib/cortex_reaver/public/css/generics.css +39 -0
  46. data/lib/cortex_reaver/public/css/icons.css +4 -0
  47. data/lib/cortex_reaver/public/css/journals.css +3 -0
  48. data/lib/cortex_reaver/public/css/main.css +30 -312
  49. data/lib/cortex_reaver/public/css/pagination.css +50 -0
  50. data/lib/cortex_reaver/public/css/photo-show.css +87 -0
  51. data/lib/cortex_reaver/public/css/photo.css +28 -97
  52. data/lib/cortex_reaver/public/css/progress.css +35 -0
  53. data/lib/cortex_reaver/public/css/sidebar.css +83 -0
  54. data/lib/cortex_reaver/public/css/table-of-contents.css +26 -0
  55. data/lib/cortex_reaver/public/css/table.css +3 -0
  56. data/lib/cortex_reaver/public/css/tags.css +29 -0
  57. data/lib/cortex_reaver/public/css/text.css +19 -1
  58. data/lib/cortex_reaver/public/css/top_actions.css +50 -0
  59. data/lib/cortex_reaver/public/css/users.css +3 -0
  60. data/lib/cortex_reaver/public/images/admin/icons.png +0 -0
  61. data/lib/cortex_reaver/public/images/admin/icons.xcf +0 -0
  62. data/lib/cortex_reaver/public/images/background_tile.png +0 -0
  63. data/lib/cortex_reaver/public/images/edit_34.png +0 -0
  64. data/lib/cortex_reaver/public/images/edit_34_prelight.png +0 -0
  65. data/lib/cortex_reaver/public/images/elided.png +0 -0
  66. data/lib/cortex_reaver/public/images/grid_34.png +0 -0
  67. data/lib/cortex_reaver/public/images/grid_34_prelight.png +0 -0
  68. data/lib/cortex_reaver/public/images/next_11.png +0 -0
  69. data/lib/cortex_reaver/public/images/next_34.png +0 -0
  70. data/lib/cortex_reaver/public/images/next_34_prelight.png +0 -0
  71. data/lib/cortex_reaver/public/images/prev_11.png +0 -0
  72. data/lib/cortex_reaver/public/images/prev_34.png +0 -0
  73. data/lib/cortex_reaver/public/images/prev_34_prelight.png +0 -0
  74. data/lib/cortex_reaver/public/js/admin.js +15 -22
  75. data/lib/cortex_reaver/public/js/autotags.js +120 -0
  76. data/lib/cortex_reaver/public/js/jquery.autocomplete.js +135 -176
  77. data/lib/cortex_reaver/public/js/jquery.color.js +124 -0
  78. data/lib/cortex_reaver/public/js/jquery.corners.min.js +7 -0
  79. data/lib/cortex_reaver/public/js/jquery.hotkeys-0.7.9.js +244 -0
  80. data/lib/cortex_reaver/public/js/jquery.js +4361 -4
  81. data/lib/cortex_reaver/public/js/jquery.periodicalupdater.js +98 -0
  82. data/lib/cortex_reaver/public/js/photo.js +3 -32
  83. data/lib/cortex_reaver/public/robots.txt +3 -0
  84. data/lib/cortex_reaver/snippets/ramaze/cache/memcached.rb +13 -10
  85. data/lib/cortex_reaver/snippets/range.rb +9 -0
  86. data/lib/cortex_reaver/support/attachments.rb +12 -0
  87. data/lib/cortex_reaver/support/comments.rb +1 -3
  88. data/lib/cortex_reaver/support/renderer.rb +20 -17
  89. data/lib/cortex_reaver/support/sequenceable.rb +6 -6
  90. data/lib/cortex_reaver/support/tags.rb +15 -7
  91. data/lib/cortex_reaver/version.rb +1 -1
  92. data/lib/cortex_reaver/view/admin/configuration.rhtml +7 -0
  93. data/lib/cortex_reaver/view/admin/index.rhtml +3 -0
  94. data/lib/cortex_reaver/view/admin/regenerate_photo_sizes.rhtml +16 -0
  95. data/lib/cortex_reaver/view/adminbox.rhtml +34 -44
  96. data/lib/cortex_reaver/view/comments/comment.rhtml +1 -1
  97. data/lib/cortex_reaver/view/comments/form.rhtml +1 -2
  98. data/lib/cortex_reaver/view/comments/post_form.rhtml +2 -10
  99. data/lib/cortex_reaver/view/head.rhtml +11 -0
  100. data/lib/cortex_reaver/view/journals/journal.rhtml +3 -3
  101. data/lib/cortex_reaver/view/journals/show.rhtml +0 -4
  102. data/lib/cortex_reaver/view/js.rhtml +1 -0
  103. data/lib/cortex_reaver/view/pages/list.rhtml +3 -23
  104. data/lib/cortex_reaver/view/pages/row.rhtml +13 -0
  105. data/lib/cortex_reaver/view/photographs/grid.rhtml +30 -36
  106. data/lib/cortex_reaver/view/photographs/show.rhtml +42 -108
  107. data/lib/cortex_reaver/view/sidebar/explore_photos.rhtml +7 -0
  108. data/lib/cortex_reaver/view/sidebar/photographs.rhtml +15 -0
  109. data/lib/cortex_reaver/view/sidebar/sections.rhtml +4 -0
  110. data/lib/cortex_reaver/view/sidebar/twitter.rhtml +12 -0
  111. data/lib/cortex_reaver/view/tags/show.rhtml +0 -10
  112. data/lib/cortex_reaver/view/tracker.rhtml +0 -0
  113. data/lib/cortex_reaver/view/users/list.rhtml +1 -7
  114. data/lib/cortex_reaver/view/users/login.rhtml +1 -1
  115. metadata +103 -43
  116. data/lib/cortex_reaver/controller/project.rb +0 -53
  117. data/lib/cortex_reaver/helper/template.rb +0 -37
  118. data/lib/cortex_reaver/model/project.rb +0 -57
  119. data/lib/cortex_reaver/public/css/ramaze_error.css +0 -90
  120. data/lib/cortex_reaver/public/images/atom-xml-icon.png +0 -0
  121. data/lib/cortex_reaver/public/images/body.png +0 -0
  122. data/lib/cortex_reaver/public/images/border_bottom.png +0 -0
  123. data/lib/cortex_reaver/public/images/border_bottom_left.png +0 -0
  124. data/lib/cortex_reaver/public/images/border_bottom_right.png +0 -0
  125. data/lib/cortex_reaver/public/images/border_left.png +0 -0
  126. data/lib/cortex_reaver/public/images/border_right.png +0 -0
  127. data/lib/cortex_reaver/public/images/border_top.png +0 -0
  128. data/lib/cortex_reaver/public/images/border_top_left.png +0 -0
  129. data/lib/cortex_reaver/public/images/border_top_right.png +0 -0
  130. data/lib/cortex_reaver/public/images/header.png +0 -0
  131. data/lib/cortex_reaver/public/images/header.xcf +0 -0
  132. data/lib/cortex_reaver/public/images/indicator.gif +0 -0
  133. data/lib/cortex_reaver/public/images/rss-xml-icon.png +0 -0
  134. data/lib/cortex_reaver/public/images/sections.png +0 -0
  135. data/lib/cortex_reaver/public/images/sections_highlight.png +0 -0
  136. data/lib/cortex_reaver/public/js/jquery.autocompletefb.js +0 -125
  137. data/lib/cortex_reaver/view/photographs/sidebar.rhtml +0 -7
  138. data/lib/cortex_reaver/view/projects/form.rhtml +0 -14
  139. data/lib/cortex_reaver/view/projects/list.rhtml +0 -31
  140. data/lib/cortex_reaver/view/projects/show.rhtml +0 -42
  141. data/lib/proto/cortex_reaver.yaml +0 -47
@@ -1,90 +0,0 @@
1
- body {
2
- font-family: sans-serif;
3
- }
4
-
5
- h1.main {
6
- text-align: center;
7
- }
8
-
9
- td {
10
- padding: 4px;
11
- }
12
-
13
- table.main {
14
- background: #444;
15
- margin-left: 2em;
16
- }
17
-
18
- div.additional h3 {
19
- cursor: pointer;
20
- }
21
-
22
- div.additional pre {
23
- margin-left: 2em;
24
- }
25
-
26
- table.main tr.head {
27
- background: #fee;
28
- width: 100%;
29
- }
30
-
31
- table.main tr {
32
- background: #fff;
33
- }
34
-
35
- table.main tr.source_container {
36
- display: none;
37
- }
38
-
39
- tr.source td {
40
- padding: 0;
41
- }
42
-
43
- tr.source_container div {
44
- width: 100%;
45
- overflow: auto;
46
- }
47
-
48
- tr.source_container div table {
49
- background: #ddd;
50
- width: 100%;
51
- }
52
-
53
- tr.source_container div table tr {
54
- text-align:center;
55
- }
56
-
57
- tr.source_container div table tr.source {
58
- text-align:left;
59
- }
60
-
61
- div.source {
62
- background: #fff;
63
- padding: 6px;
64
- }
65
-
66
- div.source td.editor {
67
- font-size: 0.8em;
68
- }
69
-
70
- tr.source {
71
- font-size: 1.0em;
72
- }
73
-
74
- tr.source td.lineno {
75
- font-size: 0.9em;
76
- font-family: monospace;
77
- }
78
-
79
- tr.source td.lineno, tr.line td.lineno {
80
- text-align: right;
81
- }
82
-
83
- tr.line td {
84
- cursor: pointer;
85
- }
86
-
87
- tr.source td.code pre {
88
- margin: 0;
89
- font-family: monospace;
90
- }
@@ -1,125 +0,0 @@
1
- /*
2
- * jQuery plugin: autoCompletefb(AutoComplete Facebook)
3
- * @requires jQuery v1.2.2 or later
4
- * using plugin:jquery.autocomplete.js
5
- *
6
- * Credits:
7
- * - Idea: Facebook
8
- * - Guillermo Rauch: Original MooTools script
9
- * - InteRiders <http://interiders.com/>
10
- *
11
- * Modified by Michael 'manveru' Fellinger <m.fellinger@gmail.com>
12
- *
13
- * Copyright (c) 2008 Widi Harsojo <wharsojo@gmail.com>, http://wharsojo.wordpress.com/
14
- * Dual licensed under the MIT and GPL licenses:
15
- * http://www.opensource.org/licenses/mit-license.php
16
- * http://www.gnu.org/licenses/gpl.html
17
- */
18
-
19
- jQuery.fn.autoCompletefb = function(options) {
20
- var tmp = this;
21
- var root = tmp[0];
22
- if(!root){ return; } // fail fast if this is called on empty jquery collection
23
-
24
- var settings = {
25
- ul : tmp,
26
- urlLookup : [""],
27
- foundClass : ".acfb-data",
28
- inputClass : ".acfb-input",
29
- removeImg : "/images/delete.gif"
30
- }
31
-
32
- if(options){ jQuery.extend(settings, options); }
33
-
34
- var acfb = {
35
- params : settings,
36
- getData : function(){
37
- var result = '';
38
- $(settings.foundClass, tmp).each(
39
- function(i) {
40
- if(i > 0){ result += ','; }
41
- result += $('span', this).html();
42
- result += $('input', this).html();
43
- });
44
- return result;
45
- },
46
- clearData : function(){
47
- $(settings.foundClass, tmp).remove();
48
- $(settings.inputClass, tmp).focus();
49
- return tmp.acfb;
50
- },
51
- removeFind : function(o, d){
52
- var without = [];
53
-
54
- for(i in root.acfb_data){
55
- var val = root.acfb_data[i];
56
- if(val !== d){ without.push(val); }
57
- }
58
-
59
- root.acfb_data = without;
60
- acfb.updateStore([]);
61
-
62
- $(o).unbind('click').parent().remove();
63
- $(settings.inputClass, tmp).focus();
64
- return tmp.acfb;
65
- },
66
- updateStore : function(d){
67
- for(i in d){ root.acfb_data.push(d[i]); }
68
- var input = $('.acfb-store', root);
69
- input.val(root.acfb_data.join(","));
70
- },
71
- addLi : function(data, value){
72
- if(value.length == 0){ return; }
73
- for(i in root.acfb_data){ if(root.acfb_data[i] == value){ return } }
74
- acfb.updateStore(data);
75
-
76
- var klass = settings.foundClass.replace(/\./,'');
77
- var li_tag = '<li class="' + klass + '"><span>' + data + '</span> <img class="p" src="' + settings.removeImg + '"/></li>';
78
- var li = $(settings.inputClass, tmp).before(li_tag);
79
-
80
- $('.p', li[0].previousSibling).click(function(){
81
- acfb.removeFind(this, data[0]);
82
- });
83
- },
84
- addLis : function(arr){
85
- for(i in arr){ acfb.addLi([arr[i]], arr[i]); }
86
- }
87
- }
88
-
89
- // using an array so we can easily join
90
- root.acfb_data = [];
91
-
92
- // add hidden input tag in the ul
93
- var orig_input = $(settings.inputClass, tmp)[0];
94
- var input_name = orig_input.name;
95
- var input_tag = '<input type="hidden" class="acfb-store" name="' + input_name + '" />';
96
- var input = $(settings.inputClass, tmp).before(input_tag)[0];
97
-
98
- var orig_values = orig_input.value.split(",");
99
- acfb.addLis(orig_values);
100
-
101
- // remove name from original input tag so it won't show up in the request and
102
- // reset the value so it is ready to take further input
103
- $(orig_input).removeAttr("name");
104
- orig_input.value = '';
105
-
106
- // add an add button... enter doesn't seem to work?
107
- var add_tag = '<span class="acfb-add">+</a>'
108
- $(settings.inputClass, tmp).after(add_tag);
109
- var add = $('.acfb-add', tmp);
110
- add.click(function(){
111
- var words = orig_input.value.split(/,+/);
112
- acfb.addLis(words);
113
- $(settings.inputClass, tmp).val('').focus();
114
- return false;
115
- });
116
-
117
- // $(settings.foundClass + " img.p").click(function(){ acfb.removeFind(this); });
118
- $(settings.inputClass, tmp).autocomplete(settings.urlLookup, {multiple: true});
119
- $(settings.inputClass, tmp).result(function(ev, data, value) {
120
- acfb.addLi(data, value);
121
- $(settings.inputClass, tmp).val('').focus();
122
- });
123
- return acfb;
124
- }
125
-
@@ -1,7 +0,0 @@
1
- <% @photographs.all.each do |photograph| %>
2
- <div class="box" id="photograph_<%= photograph.name %>">
3
- <a href="<%= photograph.url %>">
4
- <img src="<%= photograph.thumbnail_public_path %>" class="grid thumbnail" alt="<%=h photograph.title %>" />
5
- </a>
6
- </div>
7
- <% end %>
@@ -1,14 +0,0 @@
1
- <h2><%= @form_action[/\/new$/] ? 'New' : 'Edit' %> Project</h2>
2
-
3
- <%= errors_on @project %>
4
-
5
- <form class="edit-form" action="<%= Rs(@form_action) %>" method="post" enctype="multipart/form-data">
6
- <%= form_p 'title', :model => @project %>
7
- <%= live_name_field @project %>
8
- <%= live_tags_field @project %>
9
- <%= form_p :description, :model => @project %>
10
- <%= form_p :body, :model => @project, :type => 'textarea' %>
11
- <%= attachment_form @project %>
12
- <%= form_p :draft, :model => @project, :type => 'checkbox', :description => 'This is a draft' %>
13
- <input type="submit" name="submit" />
14
- </form>
@@ -1,31 +0,0 @@
1
- <div class="projects">
2
- <h2>Projects</h2>
3
- <table>
4
- <thead>
5
- <tr>
6
- <th>Title</th>
7
- <th>Description</th>
8
- <% if user.can_edit? CortexReaver::Project.new %>
9
- <th></th>
10
- <% end %>
11
- <% if user.can_delete? CortexReaver::Project.new %>
12
- <th></th>
13
- <% end %>
14
- </tr>
15
- </thead>
16
- <tbody>
17
- <% @projects.each do |project| %>
18
- <tr>
19
- <td><%= CortexReaver::ProjectController.a(project.title, project.name) %></td>
20
- <td><%= project.description %></td>
21
- <% if user.can_edit? project %>
22
- <td><a href="<%= CortexReaver::ProjectController.r(:edit, project.id) %>">Edit</a></td>
23
- <% end %>
24
- <% if user.can_delete? project %>
25
- <td><a href="<%= CortexReaver::ProjectController.r(:delete, project.id) %>" onclick="return confirm('Are you sure you want to delete this project?');" >Delete</a></td>
26
- <% end %>
27
- </tr>
28
- <% end %>
29
- </tbody>
30
- </table>
31
- </div>
@@ -1,42 +0,0 @@
1
- <div class="project text-entry">
2
- <h2><a id="project_<%= @project.name %>" href="<%= @project.url %>"><%=h @project.title %></a></h2>
3
- <div class="byline">
4
- <%= author_info @project %>
5
- <%= tags_on @project %>
6
- </div>
7
- <div class="body">
8
- <%= @project.body_cache %>
9
- <div class="clear"></div>
10
- </div>
11
- <%= attachment_list @project %>
12
- <div class="footer">
13
- <ul class="actions">
14
- <li><a href="<%= @project.url %>#comments">
15
- <img src="/images/comment.gif" class="icon" alt="comment" />
16
- <%= @project.comment_count %> <%= @project.comment_count == 1 ? 'comment' : 'comments' %>
17
- </a></li>
18
- <% if user.can_edit? @project %>
19
- <li><a href="/projects/edit/<%= @project.id %>">
20
- <img src="/images/edit.gif" class="icon" alt="edit" /> Edit
21
- </a></li>
22
- <% end %>
23
- <% if user.can_delete? @project %>
24
- <li>
25
- <a href="<%= CortexReaver::ProjectController.r(:delete, @project.id) %>" onclick="return confirm('Are you sure you want to delete this project?');" >
26
- <img src="/images/delete.gif" class="icon" alt="delete" /> Delete
27
- </a>
28
- <% end %>
29
- </ul>
30
- </div>
31
-
32
- <% unless @hide_comments %>
33
- <div class="comments">
34
- <a id="comments" />
35
- <% @project.comments_dataset.order(:created_on).all.each do |comment| %>
36
- <%= render_template '../comments/comment.rhtml', 'comment' => comment %>
37
- <% end %>
38
- </div>
39
-
40
- <%= CortexReaver::CommentController.render_view 'post_form', 'comment' => @new_comment %>
41
- <% end %>
42
- </div>
@@ -1,47 +0,0 @@
1
- ---
2
- # Database connection. You can also just use a Sequel connect() string.
3
- # :database:
4
- # :driver: 'mysql'
5
- # :host: 'localhost'
6
- # :user: 'cortex_reaver'
7
- # :password: 'some-password'
8
- # :database: 'cortex_reaver'
9
- #
10
- # Or something like...
11
- # :database: 'sqlite:////tmp/cortex_reaver.db'
12
-
13
- # Site-specific configuration parameters
14
- :site:
15
- :name: 'Cortex Reaver Site'
16
- :description: 'A dangerous Ruby blog engine, with a photographic memory.'
17
- :keywords: 'Cortex Reaver, Citadel Station'
18
- :author: 'Shodan'
19
-
20
- # The static files overlay of your site. You need to own this directory if you
21
- # want to use attachments. It will be created for you, if it does not exist.
22
- # :public_root: '/var/www/public'
23
-
24
- # The directory that contains Cortex Reaver templates. You can copy this from
25
- # the lib/cortex_reaver directory and customize to your liking, then reference
26
- # that directory here.
27
- # :view_root: '/var/www/view'
28
-
29
- # The directory for CortexReaver log files. Defaults to HOME_DIR/log.
30
- # :log_root: '/var/www/log'
31
-
32
- # Cortex Reaver has two modes: production and development. Production disables debugging
33
- # error messages (returning 404 and 500 errors instead), daemonizes by default, and logs
34
- # less.
35
- # :mode: :production
36
-
37
- # Whether to daemonize (detach from console and lurk silently, awaiting innocent hackers).
38
- # Defaults to true in production mode, false in development mode.
39
- # :daemon: true
40
-
41
- # Ramaze host, port, and adapter. Defaults to nil (listens on all interfaces), htin, and port 7000.
42
- # :host: 127.0.0.1
43
- # :adapter: 'thin'
44
- # :port: 7000
45
-
46
- # Process ID file: stores each Cortex Reaver's process ID, so you can control it later.
47
- # :pidfile: /var/www/cortex_reaver.pid