knitkit 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -111,6 +111,7 @@ module Knitkit
111
111
  begin
112
112
  current_user.with_capability(model, capability_type, capability_resource) do
113
113
  path = params[:node]
114
+ path = "#{path}/" if params[:leaf] == 'false' and path.match(/\/$/).nil?
114
115
  result = {}
115
116
  begin
116
117
  name = File.basename(path)
@@ -57,6 +57,7 @@ module Knitkit
57
57
  begin
58
58
  current_user.with_capability(model, capability_type, capability_resource) do
59
59
  path = params[:node]
60
+ path = "#{path}/" if params[:leaf] == 'false' and path.match(/\/$/).nil?
60
61
  result = {}
61
62
  begin
62
63
  name = File.basename(path)
@@ -4,7 +4,9 @@ module Widgets
4
4
  class Base < ErpApp::Widgets::Base
5
5
  def index
6
6
  @login_url = params[:login_url]
7
+ @user = User.new
7
8
  render
9
+
8
10
  end
9
11
 
10
12
  def new
@@ -32,8 +34,10 @@ module Widgets
32
34
  @user.party = individual.party
33
35
  @user.save
34
36
  render :update => {:id => "#{@uuid}_result", :view => :success}
37
+ render :update => {:id => "#{@uuid}_result_form", :view => :success}
35
38
  else
36
- render :update => {:id => "#{@uuid}_result", :view => :error}
39
+ render :update => {:id => "#{@uuid}_result_form", :view => :error}
40
+
37
41
  end
38
42
  rescue Exception=>ex
39
43
  logger.error ex.message
@@ -1,36 +1,8 @@
1
1
  <div id="<%=widget_result_id%>"></div>
2
- <div>
3
- <%= form_remote_tag build_widget_url(:new) do %>
4
- <div class="form_settings">
5
- <p>
6
- <span>First Name</span>
7
- <%= text_field_tag :first_name %>
8
- </p>
9
- <p>
10
- <span>Last Name</span>
11
- <%= text_field_tag :last_name %>
12
- </p>
13
- <p>
14
- <span>Email</span>
15
- <%= text_field_tag :email %>
16
- </p>
17
- <p>
18
- <span>Username</span>
19
- <%= text_field_tag :username %>
20
- </p>
21
- <p>
22
- <span>Password</span>
23
- <%= password_field_tag :password %>
24
- </p>
25
- <p>
26
- <span>Confirm Password</span>
27
- <%= password_field_tag :password_confirmation %>
28
- </p>
29
- <p style="padding-top: 15px">
30
- <span>&nbsp;</span>
31
- <%= submit_tag "Sign Up", :disable_with => "Please wait...", :class => "submit", :style => 'margin: 0 0 0 0px;' %>
32
- </p>
33
- </div>
34
- <input type="hidden" value="<%=@login_url%>" name="login_url" />
35
- <% end %>
36
- </div>
2
+
3
+ <div id="<%=widget_result_id%>_form">
4
+
5
+ <%= render "/signup_form_block" %>
6
+
7
+ </div>
8
+
@@ -0,0 +1,79 @@
1
+
2
+ <% @first_name_class=""
3
+ @last_name_class =""
4
+ @email_class =""
5
+ @username_class =""
6
+ @password_class = ""
7
+ %>
8
+
9
+
10
+
11
+ <% @user.errors.each do |attribute,error| %>
12
+
13
+ <%
14
+
15
+ case attribute
16
+
17
+ when :first_name
18
+
19
+ @first_name_class = "input_error"
20
+
21
+ when :last_name
22
+
23
+ @last_name_class = "input_error"
24
+
25
+ when :email
26
+
27
+ @email_class= "input_error"
28
+
29
+ when :username
30
+
31
+ @username_class = "input_error"
32
+
33
+ when :password
34
+
35
+
36
+ @password_class = "input_error"
37
+
38
+ end
39
+
40
+
41
+ %>
42
+
43
+
44
+ <% end %>
45
+
46
+ <%= form_remote_tag build_widget_url(:new), :success => "call_success" do %>
47
+ <div class="form_settings">
48
+ <p>
49
+ <span> <%= label_tag :first_name ,'First Name' %> </span>
50
+ <%= text_field_tag :first_name, nil, :class => @first_name_class %>
51
+ </p>
52
+ <p>
53
+ <span> <%= label_tag :last_name , 'Last Name' %> </span>
54
+ <%= text_field_tag :last_name , nil, :class => @last_name_class%>
55
+ </p>
56
+ <p>
57
+ <span> <%= label_tag :email , 'Email' %> </span>
58
+ <%= text_field_tag :email , @user.email , :class => @email_class %>
59
+ </p>
60
+ <p>
61
+ <span> <%= label_tag :username , 'Username' %> </span>
62
+ <%= text_field_tag :username , @user.username, :class => @username_class %>
63
+ </p>
64
+ <p>
65
+ <span> <%= label_tag :password , 'Password' %> </span>
66
+ <%= password_field_tag :password , nil, :class => @password_class%>
67
+ </p>
68
+ <p>
69
+ <span> <%= label_tag :password_confirmation , 'Confirm Password' %> </span>
70
+ <%= password_field_tag :password_confirmation ,nil , :class => @password_class %>
71
+ </p>
72
+ <p style="padding-top: 15px">
73
+ <span>&nbsp;</span>
74
+ <%= submit_tag "Sign Up", :disable_with => "Please wait...", :class => "submit", :style => 'margin: 0 0 0 0px;' %>
75
+ </p>
76
+ </div>
77
+ <input type="hidden" value="<%=@login_url%>" name="login_url" />
78
+ <% end %>
79
+
@@ -1,11 +1,25 @@
1
+
2
+
3
+
4
+
1
5
  <div class="sexyerror">
2
6
  <h2>There was an error.</h2>
3
7
  <%if !@user.errors.empty?%>
4
8
  <h3>Please address the following issues</h3>
9
+
10
+ <hr>
11
+
5
12
  <ul>
6
- <% @user.errors.messages.collect{|k,v| v}.flatten.each do |msg| %>
7
- <li><%=msg%></li>
8
- <% end %>
13
+ <% @user.errors.each do |attribute,error| %>
14
+ <li class="error_text"><%= attribute.to_s.capitalize %> : <%= error %> </li>
15
+ <%end%>
9
16
  </ul>
10
- <%end%>
11
- </div>
17
+
18
+ <%end%>
19
+ </div>
20
+
21
+ <div id="<%=widget_result_id%>_form">
22
+
23
+ <%= render "/signup_form_block" %>
24
+
25
+ </div>
@@ -1,5 +1,5 @@
1
- ErpApp::Widgets::Base.instance_eval do
2
- def render_template(view, website=nil, locals={})
1
+ ::ErpApp::Widgets::Base.instance_eval do
2
+ def render_template(view, locals={}, website=nil)
3
3
  widget = Rails.application.config.erp_app.widgets.find{|item| item[:name] == self.widget_name}
4
4
  paths = widget[:view_paths]
5
5
 
@@ -2,7 +2,7 @@ module Knitkit
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
@@ -171,7 +171,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.FileAssetsPanel = function(module) {
171
171
  },
172
172
  {
173
173
  nodeType:'leaf',
174
- text:'Insert link at cursor (inline)',
174
+ text:'Insert link at cursor',
175
175
  iconCls:'icon-add',
176
176
  listeners:{
177
177
  scope:self,
@@ -185,6 +185,22 @@ Compass.ErpApp.Desktop.Applications.Knitkit.FileAssetsPanel = function(module) {
185
185
  }
186
186
  }
187
187
  },
188
+ {
189
+ nodeType:'leaf',
190
+ text:'Insert link at cursor (inline)',
191
+ iconCls:'icon-add',
192
+ listeners:{
193
+ scope:self,
194
+ 'click':function(){
195
+ var node = this.websiteFileAssetsTreePanel.selectedNode;
196
+ Ext.MessageBox.prompt('Display Name', 'Please enter display name:', function(btn, text){
197
+ if(btn == 'ok'){
198
+ self.module.centerRegion.insertHtmlIntoActiveCkEditor('<a href="/download/'+node.data.text+'?path='+node.data.downloadPath+'&disposition=inline">'+text+'</a>');
199
+ }
200
+ });
201
+ }
202
+ }
203
+ },
188
204
  {
189
205
  nodeType:'leaf',
190
206
  text:'Insert link at cursor (prompt)',
@@ -153,7 +153,7 @@ Compass.ErpApp.Desktop.Applications.Knitkit.ImageAssetsPanel = function(module)
153
153
  },
154
154
  {
155
155
  nodeType:'leaf',
156
- text:'Insert link at cursor (prompt)',
156
+ text:'Insert link at cursor',
157
157
  iconCls:'icon-add',
158
158
  listeners:{
159
159
  scope:self,
@@ -167,6 +167,22 @@ Compass.ErpApp.Desktop.Applications.Knitkit.ImageAssetsPanel = function(module)
167
167
  }
168
168
  }
169
169
  },
170
+ {
171
+ nodeType:'leaf',
172
+ text:'Insert link at cursor (inline)',
173
+ iconCls:'icon-add',
174
+ listeners:{
175
+ scope:self,
176
+ 'click':function(){
177
+ var node = this.websiteImageAssetsTreePanel.selectedNode;
178
+ Ext.MessageBox.prompt('Display Name', 'Please enter display name:', function(btn, text){
179
+ if(btn == 'ok'){
180
+ self.module.centerRegion.insertHtmlIntoActiveCkEditor('<a href="/download/'+node.data.text+'?path='+node.data.downloadPath+'&disposition=inline">'+text+'</a>');
181
+ }
182
+ });
183
+ }
184
+ }
185
+ },
170
186
  {
171
187
  nodeType:'leaf',
172
188
  text:'Insert link at cursor (prompt)',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knitkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-31 00:00:00.000000000 Z
12
+ date: 2012-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erp_forms
16
- requirement: &2156037480 !ruby/object:Gem::Requirement
16
+ requirement: &70148233293340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156037480
24
+ version_requirements: *70148233293340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: erp_dev_svcs
27
- requirement: &2156036640 !ruby/object:Gem::Requirement
27
+ requirement: &70148233291540 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2156036640
35
+ version_requirements: *70148233291540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: routing-filter
38
- requirement: &2156035960 !ruby/object:Gem::Requirement
38
+ requirement: &70148233288900 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,21 +43,21 @@ dependencies:
43
43
  version: 0.2.4
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2156035960
46
+ version_requirements: *70148233288900
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: nokogiri
49
- requirement: &2156034880 !ruby/object:Gem::Requirement
49
+ requirement: &70148233302420 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
- - - =
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.5.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2156034880
57
+ version_requirements: *70148233302420
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rubyzip
60
- requirement: &2156034420 !ruby/object:Gem::Requirement
60
+ requirement: &70148233300180 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - =
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.9.4
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2156034420
68
+ version_requirements: *70148233300180
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: permalink_fu
71
- requirement: &2156033900 !ruby/object:Gem::Requirement
71
+ requirement: &70148233295800 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - =
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.0.0
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2156033900
79
+ version_requirements: *70148233295800
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: railties
82
- requirement: &2156033180 !ruby/object:Gem::Requirement
82
+ requirement: &70148233310860 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 3.1.0
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2156033180
90
+ version_requirements: *70148233310860
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: actionmailer
93
- requirement: &2156433200 !ruby/object:Gem::Requirement
93
+ requirement: &70148233308980 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 3.1.0
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2156433200
101
+ version_requirements: *70148233308980
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: actionpack
104
- requirement: &2156432740 !ruby/object:Gem::Requirement
104
+ requirement: &70148233308180 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 3.1.0
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *2156432740
112
+ version_requirements: *70148233308180
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: activerecord
115
- requirement: &2156432260 !ruby/object:Gem::Requirement
115
+ requirement: &70148233305740 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 3.1.0
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *2156432260
123
+ version_requirements: *70148233305740
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: activeresource
126
- requirement: &2156431780 !ruby/object:Gem::Requirement
126
+ requirement: &70148233304340 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 3.1.0
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *2156431780
134
+ version_requirements: *70148233304340
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: activesupport
137
- requirement: &2156431320 !ruby/object:Gem::Requirement
137
+ requirement: &70148233318680 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ~>
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: 3.1.0
143
143
  type: :runtime
144
144
  prerelease: false
145
- version_requirements: *2156431320
145
+ version_requirements: *70148233318680
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: rails
148
- requirement: &2156430860 !ruby/object:Gem::Requirement
148
+ requirement: &70148233316800 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ~>
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: 3.1.0
154
154
  type: :runtime
155
155
  prerelease: false
156
- version_requirements: *2156430860
156
+ version_requirements: *70148233316800
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: acts-as-taggable-on
159
- requirement: &2156430400 !ruby/object:Gem::Requirement
159
+ requirement: &70148233314200 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - =
@@ -164,7 +164,7 @@ dependencies:
164
164
  version: 2.1.1
165
165
  type: :runtime
166
166
  prerelease: false
167
- version_requirements: *2156430400
167
+ version_requirements: *70148233314200
168
168
  description: Knitkit is CompassAE's content and digital asset management application.
169
169
  It is based on ideas and code adapted from Mephisto and adva_cms, with significant
170
170
  changes to integrate with the CompassAE object-relational layer and to harmonize
@@ -324,6 +324,7 @@ files:
324
324
  - app/widgets/signup/base.rb
325
325
  - app/widgets/signup/javascript/signup.js
326
326
  - app/widgets/signup/views/_signup_form.html.erb
327
+ - app/widgets/signup/views/_signup_form_block.html.erb
327
328
  - app/widgets/signup/views/error.html.erb
328
329
  - app/widgets/signup/views/index.html.erb
329
330
  - app/widgets/signup/views/layouts/base.html.erb
@@ -457,7 +458,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
457
458
  version: '0'
458
459
  requirements: []
459
460
  rubyforge_project:
460
- rubygems_version: 1.8.15
461
+ rubygems_version: 1.8.11
461
462
  signing_key:
462
463
  specification_version: 3
463
464
  summary: CMS built for the Compass AE framework