stiki 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,10 +29,10 @@
29
29
  }
30
30
 
31
31
  .title {
32
- h1 {
32
+ a {
33
33
  .icon-chevron-left {
34
34
  position: relative;
35
- top: 13px;
35
+ top: 9px;
36
36
  }
37
37
  }
38
38
  }
@@ -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
@@ -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 = true", :as => :authorable
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
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  </div>
23
23
  <div class="form-actions">
24
- <div class="span2">
24
+ <div class="span4">
25
25
  <%= submit_tag "Save", :class => "btn btn-primary btn-large" %>
26
26
  </div>
27
27
  <div class="span2">
@@ -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 class="row-fluid">
5
- <div class="hero-unit">
6
- <h2><%= link_to space.name, stiki_routes.space_pages_path(space) %></h2>
7
- <h4 style="float:left">Created by <%= user_name( space.creator ) %></h4>
8
- <%- if has_access( :update, @page ) %>
9
- <%= button_to "X", stiki_routes.space_path( space ), :method => :delete,
10
- :class => 'close', :confirm => 'Are you sure you want to delete this Wiki Space?' %>
11
- <% end -%>
12
- </div>
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.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.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: -3907906137424960963
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: -3907906137424960963
274
+ hash: -4343939876870482060
275
275
  requirements: []
276
276
  rubyforge_project:
277
277
  rubygems_version: 1.8.24