togo 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -263,7 +263,7 @@ AssociationManager.prototype.setToModifyState = function() {
263
263
 
264
264
  AssociationManager.prototype.addLinkToValue = function(id, value, linkIt) {
265
265
  if (!linkIt) { return value; }
266
- return '<a href="/edit/' + this.model + '/' + id + '">' + value + '</a>';
266
+ return '<a href="' + this.pathPrefix + '/edit/' + this.model + '/' + id + '">' + value + '</a>';
267
267
  };
268
268
 
269
269
  AssociationManager.prototype.appendRow = function(data) {
@@ -7,7 +7,7 @@
7
7
  <% if @errors %><div id="save_errors" class="errors"><%= @errors %></div><% end %>
8
8
  <% @model.get_form_properties.each do |p| %>
9
9
  <fieldset id="property-<%= p.name %>" class="<%= @model.field_class_for(p) %>">
10
- <%= @model.form_for(p,@content) %>
10
+ <%= @model.form_for(p,@content,:path_prefix => @path_prefix) %>
11
11
  </fieldset>
12
12
  <% end %>
13
13
  </div>
@@ -7,7 +7,7 @@
7
7
  <% if @errors %><div id="save_errors" class="errors"><%= @errors %></div><% end %>
8
8
  <% @model.get_form_properties.each do |p| %>
9
9
  <fieldset id="property-<%= p.name %>" class="<%= @model.field_class_for(p) %>">
10
- <%= @model.form_for(p,@content) %>
10
+ <%= @model.form_for(p,@content,:path_prefix => @path_prefix) %>
11
11
  </fieldset>
12
12
  <% end %>
13
13
  </div>
@@ -44,7 +44,7 @@ module Togo
44
44
  end
45
45
 
46
46
  # Display the form template for a property
47
- def form_for(property,content)
47
+ def form_for(property,content,opts = {})
48
48
  template = class_variable_get(:@@custom_form_templates)[property.name] || File.join(File.dirname(__FILE__),'types',"#{property.type}.erb")
49
49
  Erubis::TinyEruby.new(File.open(template).read).result(binding)
50
50
  end
@@ -115,7 +115,7 @@ module Togo
115
115
 
116
116
  def type_from_property(property)
117
117
  case property
118
- when ::DataMapper::Property::Text
118
+ when (defined?(::DataMapper::Property::Text) and ::DataMapper::Property::Text)
119
119
  'text'
120
120
  when (defined?(::DataMapper::Property::Enum) and ::DataMapper::Property::Enum)
121
121
  'string'
@@ -43,7 +43,7 @@
43
43
  <td class="checkbox"><input type="radio" name="selection[<%= c.id %>]" value="<%= c.id %>" id="selection_<%= related_model.name %>_<%= c.id %>" checked="checked" /></td>
44
44
  <% related_model.get_list_properties.each_with_index do |p,i| %>
45
45
  <% v = c.send(p.name) || '-' %>
46
- <td><% if i == 0 %><a href="/edit/<%= related_model.name %>/<%= c.id %>"><%= v || '-' %></a><% else %><%= v %><% end %></td>
46
+ <td><% if i == 0 %><a href="<%= [(opts[:path_prefix] || ''), '/edit/' + related_model.name + '/' + c.id.to_s].join %>"><%= v || '-' %></a><% else %><%= v %><% end %></td>
47
47
  <% end %>
48
48
  </tr>
49
49
  <% end %>
@@ -45,7 +45,7 @@
45
45
  <td class="checkbox"><input type="checkbox" name="selection[<%= c.id %>]" value="<%= c.id %>" id="selection_<%= related_model.name %>_<%= c.id %>" checked="checked" /></td>
46
46
  <% related_model.get_list_properties.each_with_index do |p,i| %>
47
47
  <% v = c.send(p.name) || '-' %>
48
- <td><% if i == 0 %><a href="/edit/<%= related_model.name %>/<%= c.id %>"><%= v %></a><% else %><%= v %><% end %></td>
48
+ <td><% if i == 0 %><a href="<%= [(opts[:path_prefix] || ''), '/edit/' + related_model.name + '/' + c.id.to_s].join %>"><%= v %></a><% else %><%= v %><% end %></td>
49
49
  <% end %>
50
50
  </tr>
51
51
  <% end %>
@@ -45,7 +45,7 @@
45
45
  <td class="checkbox"><input type="checkbox" name="selection[<%= c.id %>]" value="<%= c.id %>" id="selection_<%= related_model.name %>_<%= c.id %>" checked="checked" /></td>
46
46
  <% related_model.get_list_properties.each_with_index do |p,i| %>
47
47
  <% v = c.send(p.name) || '-' %>
48
- <td><% if i == 0 %><a href="/edit/<%= related_model.name %>/<%= c.id %>"><%= v %></a><% else %><%= v %><% end %></td>
48
+ <td><% if i == 0 %><a href="<%= [(opts[:path_prefix] || ''), '/edit/' + related_model.name + '/' + c.id.to_s].join %>"><%= v %></a><% else %><%= v %><% end %></td>
49
49
  <% end %>
50
50
  </tr>
51
51
  <% end %>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: togo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 3
10
- version: 0.6.3
9
+ - 4
10
+ version: 0.6.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt King