stiki 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/stiki/pages.css +2 -2
- data/app/models/stiki/page.rb +7 -1
- data/app/models/stiki/space.rb +7 -1
- data/app/views/stiki/pages/_form.html.erb +1 -1
- data/app/views/stiki/pages/index.html.erb +1 -0
- data/app/views/stiki/pages/show.html.erb +1 -1
- data/app/views/stiki/spaces/index.html.erb +12 -10
- data/lib/stiki/version.rb +2 -2
- metadata +3 -3
data/app/models/stiki/page.rb
CHANGED
@@ -20,7 +20,8 @@ module Stiki
|
|
20
20
|
|
21
21
|
validates :title, :uniqueness => {:scope => :space_id}, :presence => true
|
22
22
|
validates :body, :presence => true
|
23
|
-
|
23
|
+
after_validation :move_friendly_id_error_to_name
|
24
|
+
|
24
25
|
def mark_badges
|
25
26
|
if authors.size > 1
|
26
27
|
# XXX: need revisions to determine last edit and most edits
|
@@ -29,5 +30,10 @@ module Stiki
|
|
29
30
|
#authors.where( ["#{Stiki::Author.table_name}.id = ?", last.id] ).update_all( :last_edit => true );
|
30
31
|
end
|
31
32
|
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
def move_friendly_id_error_to_name
|
36
|
+
errors.add :title, *errors.delete(:friendly_id) if errors[:friendly_id].present?
|
37
|
+
end
|
32
38
|
end
|
33
39
|
end
|
data/app/models/stiki/space.rb
CHANGED
@@ -7,10 +7,16 @@ module Stiki
|
|
7
7
|
|
8
8
|
has_many :pages
|
9
9
|
has_many :authors, :as => :authorable
|
10
|
-
has_one :creator, :class_name => 'Author', :conditions => "creator =
|
10
|
+
has_one :creator, :class_name => 'Author', :conditions => ["creator = ?", true], :as => :authorable
|
11
11
|
|
12
12
|
attr_accessible :name
|
13
13
|
|
14
14
|
validates :name, :uniqueness => true, :presence => true
|
15
|
+
after_validation :move_friendly_id_error_to_name
|
16
|
+
|
17
|
+
protected
|
18
|
+
def move_friendly_id_error_to_name
|
19
|
+
errors.add :name, *errors.delete(:friendly) if errors[:friendly].present?
|
20
|
+
end
|
15
21
|
end
|
16
22
|
end
|
@@ -12,6 +12,7 @@
|
|
12
12
|
<button class="btn dropdown-toggle" data-toggle="dropdown">Change Space<span class="caret"></span></button>
|
13
13
|
<ul class="dropdown-menu">
|
14
14
|
<li><a href="<%= stiki_routes.spaces_path %>">All Spaces</a></li>
|
15
|
+
<li class="divider"></li>
|
15
16
|
<%- @spaces.each do |space| %>
|
16
17
|
<li><a href="<%= stiki_routes.space_pages_path(space) %>"><%= space.name %></a></li>
|
17
18
|
<% end -%>
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<div class="span12 well">
|
4
4
|
<div class="row-fluid">
|
5
5
|
<div class="span7 title">
|
6
|
+
<%= link_to '<i class="icon-chevron-left"></i>'.html_safe, stiki_routes.space_pages_path(@space), :style => "float:left" %>
|
6
7
|
<h1>
|
7
|
-
<%= link_to '<i class="icon-chevron-left"></i>'.html_safe, stiki_routes.space_pages_path(@space) %>
|
8
8
|
<%= @page.title %>
|
9
9
|
</h1>
|
10
10
|
</div>
|
@@ -1,15 +1,17 @@
|
|
1
1
|
<%- @spaces.each do |space| %>
|
2
2
|
<div class="row-fluid">
|
3
|
-
<div class="span8">
|
4
|
-
<div
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
<div class="span8 well">
|
4
|
+
<div style="float:right">
|
5
|
+
<%- if has_access( :update, @page ) %>
|
6
|
+
<%= button_to "X", stiki_routes.space_path( space ), :method => :delete,
|
7
|
+
:class => 'close', :confirm => 'Are you sure you want to delete this Wiki Space?' %>
|
8
|
+
<% end -%>
|
9
|
+
</div>
|
10
|
+
<div style="float:left">
|
11
|
+
<h2 ><%= link_to space.name, stiki_routes.space_pages_path(space) %></h2>
|
12
|
+
<% if space.creator %>
|
13
|
+
<h4 >Created by <%= user_name( space.creator ) %></h4>
|
14
|
+
<% end %>
|
13
15
|
</div>
|
14
16
|
</div>
|
15
17
|
</div>
|
data/lib/stiki/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Stiki
|
2
|
-
VERSION = "0.1.
|
3
|
-
end
|
2
|
+
VERSION = "0.1.2"
|
3
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -262,7 +262,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
262
|
version: '0'
|
263
263
|
segments:
|
264
264
|
- 0
|
265
|
-
hash: -
|
265
|
+
hash: -4343939876870482060
|
266
266
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
267
|
none: false
|
268
268
|
requirements:
|
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
271
|
version: '0'
|
272
272
|
segments:
|
273
273
|
- 0
|
274
|
-
hash: -
|
274
|
+
hash: -4343939876870482060
|
275
275
|
requirements: []
|
276
276
|
rubyforge_project:
|
277
277
|
rubygems_version: 1.8.24
|