beef-admin_area 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/admin_area.gemspec +2 -2
- data/app/controllers/admin/settings_controller.rb +1 -17
- data/app/helpers/admin/base_helper.rb +0 -18
- data/config/routes.rb +0 -1
- data/generators/admin_area_files/admin_area_files_generator.rb +7 -0
- data/generators/admin_area_files/templates/app/views/admin/settings/show.html.erb +1 -6
- data/generators/admin_area_files/templates/migration.rb +1 -0
- data/generators/admin_area_files/templates/public/stylesheets/admin/screen.css +0 -5
- data/generators/admin_scaffold/templates/admin_index.html.erb +4 -3
- data/generators/admin_scaffold/templates/admin_show.html.erb +1 -1
- data/generators/admin_scaffold/templates/view_index.html.erb +1 -1
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/admin_area.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{admin_area}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Steve England"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-09-07}
|
10
10
|
s.email = %q{steve@wearebeef.co.uk}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
@@ -1,33 +1,18 @@
|
|
1
1
|
class Admin::SettingsController < Admin::BaseController
|
2
2
|
|
3
|
-
# rescue_from Flickr::APIError, :with => :flickr_error
|
4
|
-
|
5
3
|
def show
|
6
4
|
unless current_user.admin?
|
7
5
|
flash.now[:notice] = 'You may view settings but editing is only available to Adminstrators.'
|
8
6
|
end
|
9
|
-
|
10
7
|
@settings = Settings
|
11
|
-
|
12
|
-
# unless Settings.flickr_api_key.blank? or Settings.flickr_api_secret.blank?
|
13
|
-
# Flickr::API.connect Settings.flickr_api_key, Settings.flickr_api_secret, Settings.flickr_auth_token
|
14
|
-
# if @unauthorised = Flickr::API.unauthorised?
|
15
|
-
# @login_url = Flickr::API.login_url
|
16
|
-
# end
|
17
|
-
# end
|
18
8
|
end
|
19
9
|
|
20
10
|
def update
|
21
11
|
unless current_user.admin?
|
22
12
|
flash[:notice] = 'You may view settings but editing is only available to Adminstrators.'
|
23
13
|
else
|
24
|
-
|
25
14
|
params[:settings].each_pair do |key,value|
|
26
|
-
|
27
|
-
value.strip!
|
28
|
-
end
|
29
|
-
|
30
|
-
Settings[key] = value.gsub(/^http\:\/\//i,'')
|
15
|
+
Settings[key] = value.strip
|
31
16
|
end
|
32
17
|
|
33
18
|
flash.now[:notice] = "Setting#{params[:settings].length>1?'s':''} #{params[:settings].collect{|s,v| s.humanize}.join(', ')} was successfully updated."
|
@@ -37,7 +22,6 @@ class Admin::SettingsController < Admin::BaseController
|
|
37
22
|
format.html { redirect_to admin_setting_path}
|
38
23
|
format.js
|
39
24
|
end
|
40
|
-
|
41
25
|
end
|
42
26
|
|
43
27
|
end
|
@@ -33,24 +33,6 @@ module Admin::BaseHelper
|
|
33
33
|
page << 'init_flash_messages();'
|
34
34
|
end
|
35
35
|
|
36
|
-
def lastest_flickr
|
37
|
-
return if Settings.flickr_api_key.blank? or Settings.flickr_user_id.blank?
|
38
|
-
Flickr::API.connect Settings.flickr_api_key, Settings.flickr_api_secret, Settings.flickr_auth_token
|
39
|
-
flickr_params = { :per_page => '5', :page => params[:page], :user_id => Settings.flickr_user_id, :sort => 'date-taken-desc', :tag_mode => 'all' }
|
40
|
-
flickr_params[:tags] = params[:tags] unless params[:tags].blank?
|
41
|
-
flickr_result = Flickr::Photo.find(:all, flickr_params)
|
42
|
-
render :partial => 'admin/shared/flickr_latest.html.erb', :locals => { :flickr_images => flickr_result }
|
43
|
-
end
|
44
|
-
|
45
|
-
def flickr_select
|
46
|
-
return if Settings.flickr_api_key.blank? or Settings.flickr_user_id.blank?
|
47
|
-
Flickr::API.connect Settings.flickr_api_key, Settings.flickr_api_secret, Settings.flickr_auth_token
|
48
|
-
flickr_params = { :per_page => '12', :page => params[:page], :user_id => Settings.flickr_user_id, :sort => 'date-taken-desc', :tag_mode => 'all' }
|
49
|
-
flickr_params[:tags] = params[:tags] unless params[:tags].blank?
|
50
|
-
flickr_result = Flickr::Photo.find(:all, flickr_params)
|
51
|
-
render :partial => 'admin/shared/flickr.html.erb', :locals => { :flickr_images => flickr_result }
|
52
|
-
end
|
53
|
-
|
54
36
|
def preview_link(object)
|
55
37
|
url = url_for([:preview, :admin, object ])
|
56
38
|
link_to_function 'Preview', "new Ajax.Updater('page_preview', '#{url}', {asynchronous:true, evalScripts:true, parameters: this.up('form').serialize() + '&assets=' + getAssetIDs('asset-list')})", :class => 'button'
|
data/config/routes.rb
CHANGED
@@ -23,12 +23,7 @@
|
|
23
23
|
</fieldset>
|
24
24
|
|
25
25
|
<fieldset id="flickrsettings"><legend>Flickr Settings</legend>
|
26
|
-
|
27
|
-
<p>You are currently unauthorised because <%= @unauthorised %>, please <%= link_to 'login to flickr', @login_url %>
|
28
|
-
<% end -%>
|
29
|
-
<%= setting_form [['flickr_user_id','text'],
|
30
|
-
['flickr_api_key','text'],
|
31
|
-
['flickr_api_secret','text']] %>
|
26
|
+
<%= setting_form :flickr_user_id %>
|
32
27
|
</fieldset>
|
33
28
|
|
34
29
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<h1>Listing <%= plural_name %></h1>
|
1
|
+
<h1>Listing <%= plural_name.titleize %></h1>
|
2
2
|
|
3
3
|
<ul class="choices">
|
4
|
-
<li><%%= link_to 'New <%= singular_name %>', new_admin_<%= singular_name %>_path %></li>
|
4
|
+
<li><%%= link_to 'New <%= singular_name.titleize %>', new_admin_<%= singular_name %>_path %></li>
|
5
5
|
</ul>
|
6
6
|
|
7
7
|
<table>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<% for attribute in attributes -%>
|
11
11
|
<%%= sortable_table_header :name => "<%= attribute.column.human_name %>", :sort => "<%= attribute.name %>" %>
|
12
12
|
<% end -%>
|
13
|
+
<th colspan="2">Actions</th>
|
13
14
|
</tr>
|
14
|
-
<th colspan="2">Actions</th>
|
15
15
|
</thead>
|
16
16
|
<tbody>
|
17
17
|
<%% @<%= plural_name %>.each do |<%= singular_name %>| %>
|
@@ -33,6 +33,7 @@
|
|
33
33
|
<% for attribute in attributes -%>
|
34
34
|
<%%= sortable_table_header :name => "<%= attribute.column.human_name %>", :sort => "<%= attribute.name %>" %>
|
35
35
|
<% end -%>
|
36
|
+
<th colspan="2">Actions</th>
|
36
37
|
</tr>
|
37
38
|
</tfoot>
|
38
39
|
</table>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h1><%%= @<%= singular_name %>.new_record? ? 'New' : 'Editing' %> <%= singular_name %></h1>
|
1
|
+
<h1><%%= @<%= singular_name %>.new_record? ? 'New' : 'Editing' %> <%= singular_name.titleize %></h1>
|
2
2
|
|
3
3
|
<%% form_for([:admin, @<%= singular_name %>]) do |f| %>
|
4
4
|
<%%= f.error_messages %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beef-admin_area
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve England
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-07 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- test/test_helper.rb
|
183
183
|
has_rdoc: false
|
184
184
|
homepage: http://github.com/beef/admin
|
185
|
+
licenses:
|
185
186
|
post_install_message:
|
186
187
|
rdoc_options:
|
187
188
|
- --charset=UTF-8
|
@@ -202,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
203
|
requirements: []
|
203
204
|
|
204
205
|
rubyforge_project:
|
205
|
-
rubygems_version: 1.
|
206
|
+
rubygems_version: 1.3.5
|
206
207
|
signing_key:
|
207
208
|
specification_version: 3
|
208
209
|
summary: Rails engine that provides a standard admin area with user managament
|