Skip to content
Browse files

adding gollum and /admin so we can edit wiki pages

  • Loading branch information...
1 parent 1a9285f commit e670f7b1aa38ea12c5bcb349279e78b954c4b98d @cv cv committed Mar 13, 2013
View
5 Gemfile
@@ -30,6 +30,11 @@ gem 'rdiscount'
gem 'jquery-rails'
gem 'd3-rails'
+# wiki
+gem 'gollum'
+gem 'github-markdown'
+gem 'wikicloth'
+
group :development do
gem 'better_errors'
gem 'binding_of_caller'
View
35 Gemfile.lock
@@ -66,9 +66,27 @@ GEM
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
+ expression_parser (0.9.0)
facter (1.6.17)
faraday (0.8.6)
multipart-post (~> 1.1)
+ github-markdown (0.5.3)
+ github-markup (0.7.5)
+ gollum (2.4.11)
+ github-markdown (~> 0.5.3)
+ github-markup (>= 0.7.4, < 1.0.0)
+ grit (~> 2.5.0)
+ mustache (>= 0.99.4, < 1.0.0)
+ nokogiri (~> 1.5.5)
+ pygments.rb (~> 0.3.2)
+ sanitize (~> 2.0.3)
+ sinatra (~> 1.3.3)
+ stringex (~> 1.5.1)
+ useragent (~> 0.4.15)
+ grit (2.5.0)
+ diff-lcs (~> 1.1)
+ mime-types (~> 1.15)
+ posix-spawn (~> 0.3.6)
hashie (1.2.0)
hike (1.2.1)
httpauth (0.2.0)
@@ -88,6 +106,7 @@ GEM
mime-types (1.21)
multi_json (1.6.1)
multipart-post (1.2.0)
+ mustache (0.99.4)
nokogiri (1.5.6)
oauth (0.4.7)
oauth2 (0.8.1)
@@ -114,6 +133,10 @@ GEM
pg (0.14.1)
pg-hstore (1.1.7)
polyglot (0.3.3)
+ posix-spawn (0.3.6)
+ pygments.rb (0.3.7)
+ posix-spawn (~> 0.3.6)
+ yajl-ruby (~> 1.1.0)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
@@ -157,6 +180,9 @@ GEM
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
+ sanitize (2.0.3)
+ nokogiri (>= 1.4.4, < 1.6)
+ nokogiri (>= 1.4.4, < 1.6)
sass (3.2.6)
sass-rails (3.2.6)
railties (~> 3.2.0)
@@ -183,6 +209,7 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
+ stringex (1.5.1)
temple (0.5.5)
therubyracer (0.11.3)
libv8 (~> 3.11.8.12)
@@ -197,11 +224,16 @@ GEM
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
+ useragent (0.4.16)
warden (1.2.1)
rack (>= 1.0)
whenever (0.8.2)
activesupport (>= 2.3.4)
chronic (>= 0.6.3)
+ wikicloth (0.8.0)
+ builder
+ expression_parser
+ yajl-ruby (1.1.0)
PLATFORMS
ruby
@@ -214,6 +246,8 @@ DEPENDENCIES
coffee-rails (~> 3.2.1)
d3-rails
devise
+ github-markdown
+ gollum
jquery-rails
libv8
nokogiri
@@ -233,3 +267,4 @@ DEPENDENCIES
therubyracer
uglifier (>= 1.0.3)
whenever
+ wikicloth
View
3 app/controllers/welcome_controller.rb
@@ -1,5 +1,8 @@
# -*- encoding : utf-8 -*-
class WelcomeController < ApplicationController
+
def index
+ @page = Wiki.page('Home') or render :file => "#{Rails.root}/public/404.html", :status => :not_found, :layout => false
end
+
end
View
9 app/views/layouts/application.html.slim
@@ -18,7 +18,7 @@ html
a href=welcome_path Voto Como Vamos
= content_for :nav
- #counter-area
+ #counter-area
p Estamos há
p.counter 56
p dias sem sessões na Câmara.
@@ -27,8 +27,13 @@ html
= yield
#footer
+ = content_for :footer
+ - if @page
+ | Última atualização em
+ = @page.versions.first.authored_date.strftime '%d/%m/%Y %H:%M'
+ | , por
+ = mail_to @page.versions.first.author.email
p
| &copy; 2013 Voto Como Vamos. Todos os direitos reservados.
p
a href="http://github.com/thoughtworks/voto-como-vamos-2" GitHub
- = content_for :footer
View
17 app/views/welcome/index.html.slim
@@ -16,21 +16,7 @@
li
a href="#" Acompanhe seu parlamentar
-h2 Bem-vindo ao Voto Como Vamos!
-
-p
- | Bacon ipsum dolor sit amet filet mignon turkey pastrami sausage.
- | Tenderloin tail <a href="#"> chuck tongue shoulder short</a> ribs. Rump venison meatball bresaola,
- | leberkas pork belly ham hock kielbasa tri-tip ground round frankfurter beef
- | salami pancetta. Tri-tip swine tenderloin leberkas short loin frankfurter.
-
-p
- | Leberkas chicken venison short loin, bresaola chuck filet mignon tri-tip shankle
- | spare ribs prosciutto. Ball tip cow t-bone ham hock leberkas pork belly bresaola
- | swine rump andouille. Pastrami bresaola sausage, turkey beef kielbasa sirloin
- | capicola spare ribs. Shankle andouille kielbasa, <a href="#">prosciutto chuck pork</a> chop
- | jowl t-bone shank swine. Jerky chicken andouille meatball ribeye, prosciutto
- | strip steak kielbasa pastrami shoulder ball tip shank leberkas.
+= @page.formatted_data.html_safe
h2 Hoje na Câmara
@@ -49,4 +35,3 @@ ul.boxes
h3 Pastrami burger
img src="/assets/graph1.png"/
p Jerky beef
-
View
7 config/initializers/wiki.rb
@@ -0,0 +1,7 @@
+# -*- encoding : utf-8 -*-
+unless Kernel.const_defined? :Wiki
+ Gollum::Wiki.default_committer_email = 'contato@votocomovamos.com.br'
+ Gollum::Wiki.default_committer_name = 'Anônimo'
+
+ Wiki = Gollum::Wiki.new(Rails.root.to_s, page_file_dir: 'wiki')
+end
View
6 config/routes.rb
@@ -6,6 +6,12 @@
require 'sidekiq/web'
mount Sidekiq::Web => '/jobs'
+ require 'gollum/frontend/app'
+ Precious::App.set(:gollum_path, Rails.root)
+ Precious::App.set(:default_markup, :markdown)
+ Precious::App.set(:wiki_options, page_file_dir: 'wiki', universal_toc: false)
+ mount Precious::App => '/admin'
+
# The priority is based upon order of creation:
# first created -> highest priority.
View
5 wiki/home.md
@@ -0,0 +1,5 @@
+## Bem-vindo ao Voto Como Vamos!
+
+Bacon ipsum dolor sit amet filet mignon turkey pastrami sausage.Tenderloin tail chuck tongue shoulder short ribs. Rump venison meatball bresaola,leberkas pork belly ham hock kielbasa tri-tip ground round frankfurter beefsalami pancetta. Tri-tip swine tenderloin leberkas short loin frankfurter.
+
+Leberkas chicken venison short loin, bresaola chuck filet mignon tri-tip shanklespare ribs prosciutto. Ball tip cow t-bone ham hock leberkas pork belly bresaolaswine rump andouille. Pastrami bresaola sausage, turkey beef kielbasa sirloincapicola spare ribs. Shankle andouille kielbasa, prosciutto chuck pork chopjowl t-bone shank swine. Jerky chicken andouille meatball ribeye, prosciuttostrip steak kielbasa pastrami shoulder ball tip shank leberkas.

0 comments on commit e670f7b

Please sign in to comment.
Something went wrong with that request. Please try again.