junebug 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -5,7 +5,7 @@ Junebug is a minimalist wiki, running on Camping.
5
5
 
6
6
  == Status
7
7
 
8
- Junebug v0.0.4 release, 2006-11-05
8
+ Junebug v0.0.7 release, 2006-11-07
9
9
 
10
10
  This is an alpha release. Use at your own risk. Please do not use this for anything important.
11
11
 
@@ -137,33 +137,35 @@ body {
137
137
  font-size: 100%;
138
138
  }
139
139
 
140
- .content h2, .content h3, .content h4 {
141
- margin-top: 25px;
142
- margin-bottom: 10px;
143
- }
144
140
 
145
141
  .content h2, .content h3, .content h4 {
146
142
  color: 04766f;
147
143
  }
148
144
 
149
145
  .content h1 {
150
- margin-bottom: 10px;
151
146
  font-size: 182%;
147
+ margin-bottom: 10px;
152
148
  }
153
149
 
154
150
  .content h2 {
155
151
  font-size: 152%;
156
152
  border-bottom: 1px dotted #bbb;
153
+ margin-top: 25px;
154
+ margin-bottom: 10px;
157
155
  /* background-color: #d6fbf4;*/
158
156
  }
159
157
 
160
158
  .content h3 {
161
159
  font-size: 129%;
160
+ margin-top: 25px;
161
+ margin-bottom: 10px;
162
162
  /* border-bottom: 1px dotted #bbb;*/
163
163
  }
164
164
 
165
165
  .content h4 {
166
166
  font-size: 107%;
167
+ margin-top: 10px;
168
+ margin-bottom: 10px;
167
169
  }
168
170
 
169
171
  .content ul {
@@ -1,16 +1,19 @@
1
1
  require 'junebug/diff'
2
2
 
3
3
  module Junebug::Controllers
4
+
5
+
4
6
  class Index < R '/'
5
7
  def get
6
- redirect Show, Junebug.config['startpage']
8
+ redirect Junebug.startpage
7
9
  end
8
10
  end
9
11
 
10
12
  class Show < R '/(\w+)', '/(\w+)/(\d+)'
11
13
  def get page_name, version = nil
12
14
  @page_title = page_name
13
- redirect(Edit, page_name, 1) and return unless @page = Page.find_by_title(page_name)
15
+ #redirect(Edit, page_name, 1) and return unless @page = Page.find_by_title(page_name)
16
+ redirect("#{Junebug.config['url']}/#{page_name}/1/edit") and return unless @page = Page.find_by_title(page_name)
14
17
  @version = (version.nil? or version == @page.version.to_s) ? @page : @page.versions.find_by_version(version)
15
18
  render :show
16
19
  end
@@ -18,7 +21,7 @@ module Junebug::Controllers
18
21
 
19
22
  class Edit < R '/(\w+)/edit', '/(\w+)/(\d+)/edit'
20
23
  def get page_name, version = nil
21
- redirect(Login) and return if @state.user_id.blank?
24
+ redirect("#{Junebug.config['url']}/login") and return if @state.user_id.blank?
22
25
  @page_title = "Edit #{page_name}"
23
26
  @page = Page.find(:first, :conditions=>['title = ?', page_name])
24
27
  @page = Page.create(:title => page_name, :user_id=>@state.user_id) unless @page
@@ -27,15 +30,16 @@ module Junebug::Controllers
27
30
  end
28
31
 
29
32
  def post page_name
30
- redirect(Login) and return if @state.user_id.blank?
33
+ redirect("#{Junebug.config['url']}/login") and return if @state.user_id.blank?
31
34
  if input.submit == 'delete'
32
35
  Page.find_by_title(page_name).destroy() if @state.user_id == 1
33
- redirect Index
36
+ redirect Junebug.startpage
34
37
  else
35
38
  attrs = { :body => input.post_body, :title => input.post_title }
36
39
  attrs[:readonly] = input.post_readonly if @state.user_id == 1
37
40
  if Page.find_or_create_by_title(page_name).update_attributes( attrs )
38
- redirect Show, input.post_title
41
+ # redirect Show, input.post_title
42
+ redirect "#{Junebug.config['url']}/#{input.post_title}"
39
43
  end
40
44
  end
41
45
  end
@@ -127,7 +131,7 @@ module Junebug::Controllers
127
131
  if @user.password == input.password
128
132
  @state.user_id = @user.id
129
133
  @state.user_username = @user.username
130
- redirect(Index); return
134
+ redirect(Junebug.startpage); return
131
135
  else
132
136
  @notice = 'Authentication failed'
133
137
  end
@@ -136,7 +140,7 @@ module Junebug::Controllers
136
140
  if @user.errors.empty?
137
141
  @state.user_id = @user.id
138
142
  @state.user_username = @user.username
139
- redirect(Index); return
143
+ redirect(Junebug.startpage); return
140
144
  else
141
145
  @notice = @user.errors.full_messages[0]
142
146
  end
@@ -149,7 +153,7 @@ module Junebug::Controllers
149
153
  def get
150
154
  @state.user_id = nil
151
155
  @state.user_username = nil
152
- redirect(Index)
156
+ redirect(Junebug.startpage)
153
157
  end
154
158
  end
155
159
  end
data/lib/junebug.rb CHANGED
@@ -32,6 +32,10 @@ module Junebug
32
32
  def self.config
33
33
  @config ||= YAML.load(File.read('config.yml'))
34
34
  end
35
+
36
+ def self.startpage
37
+ "#{Junebug.config['url']}/#{Junebug.config['startpage']}"
38
+ end
35
39
  end
36
40
 
37
41
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: junebug
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.6
7
- date: 2006-11-07 00:00:00 -08:00
6
+ version: 0.0.7
7
+ date: 2006-11-08 00:00:00 -08:00
8
8
  summary: Junebug is a minimalist ruby wiki.
9
9
  require_paths:
10
10
  - lib