"
ret << (link_to node.name, dest)
- ret << ' | ' << (link_to t('admin.code'), eval("edit_admin_#{node._type.downcase}_path(node, :code => true)")) if node._type.eql?('Page')
+ ret << ' | ' << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page')
ret << ' | ' << (link_to t(:delete), eval("delete_admin_#{node._type.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete')
diff --git a/app/helpers/admin/user_helper.rb b/app/helpers/admin/user_helper.rb
new file mode 100644
index 00000000..6ebd056f
--- /dev/null
+++ b/app/helpers/admin/user_helper.rb
@@ -0,0 +1,16 @@
+module Admin::UserHelper
+
+ def show_user_attribute(object, key, locale = '')
+ attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) } rescue nil
+ if attribute
+ if locale.to_s.blank?
+ attribute['key']
+ else
+ attribute[locale.to_s]
+ end
+ else
+ ''
+ end
+ end
+
+end
diff --git a/app/helpers/design_helper.rb b/app/helpers/design_helper.rb
new file mode 100644
index 00000000..c55eb2a0
--- /dev/null
+++ b/app/helpers/design_helper.rb
@@ -0,0 +1,4 @@
+module DesignHelper
+
+
+end
diff --git a/app/models/.user.rb.swp b/app/models/.user.rb.swp
new file mode 100644
index 00000000..7149c0ea
Binary files /dev/null and b/app/models/.user.rb.swp differ
diff --git a/app/models/design/design.rb b/app/models/design/design.rb
new file mode 100644
index 00000000..f1f676b6
--- /dev/null
+++ b/app/models/design/design.rb
@@ -0,0 +1,108 @@
+class Design
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ field :title
+ field :author
+ field :intro
+ field :version
+
+ has_many :pages
+
+ embeds_one :layout
+ embeds_one :default_css, :class_name => "Stylesheet"
+ embeds_one :reset_css, :class_name => "Stylesheet"
+ embeds_many :stylesheets
+ embeds_many :themes
+ embeds_many :javascripts
+ embeds_many :images
+ embeds_many :custom_images, as: :design_image
+
+ validates_presence_of :title
+ validates_presence_of :author
+
+ after_save :procs_embedded_objects
+ # after_destroy :del_embedded_objects
+
+ def javascripts=(*attrs)
+ self.files = (attrs << 'javascripts')
+ end
+
+ def themes=(*attrs)
+ self.files = (attrs << 'themes')
+ end
+
+ def images=(*attrs)
+ self.files = (attrs << 'images')
+ end
+
+ # Update or create the attribute_model records
+ def files=(attrs)
+ case attrs.last
+ when 'layout'
+ files = self.layout.build
+ else
+ files = eval(attrs.last)
+ end
+ attrs[0].each do |a|
+ if a[:id].blank? && !a[:file].blank?
+ files.build(:file => a[:file], :to_save => true)
+ else
+ files.each do |file|
+ if file.id.to_s == a[:id]
+ file.to_destroy = a[:to_destroy]
+ end
+ end
+ end
+ end
+ end
+
+ protected
+
+ def del_embedded_objects
+ [[self.layout],self.themes, self.javascripts, self.images].each do |objects|
+ objects.each do |object|
+ object.destroy
+ end
+ end
+ end
+
+ def procs_embedded_objects
+ [self.javascripts, self.images].each do |objects|
+ objects.each do |object|
+ process_object(object)
+ end
+ end
+ if self.layout.to_save
+ self.layout.to_save = false
+ self.layout.save
+ end
+ [[self.default_css], [self.reset_css], self.themes].each do |objects|
+ objects.each do |object|
+ if object
+ to_parse_url = object.to_save ? true : false
+ process_object(object)
+ object.parse_urls if to_parse_url
+ end
+ end
+ end
+ end
+
+ def process_object(object)
+ if object.to_save
+ if object.file_filename.nil?
+ new_object = self.send(object._type.downcase.pluralize).build(object)
+ object.destroy
+ new_object.to_save = false
+ new_object.save
+ else
+ object.to_save = false
+ object.save
+ end
+ end
+ if object.to_destroy
+ object.destroy
+ end
+ end
+
+end
diff --git a/app/models/design/design_file.rb b/app/models/design/design_file.rb
new file mode 100644
index 00000000..3aec9a0c
--- /dev/null
+++ b/app/models/design/design_file.rb
@@ -0,0 +1,10 @@
+class DesignFile
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ mount_uploader :file, AssetUploader
+
+ field :to_save, :type => Boolean
+ field :to_destroy, :type => Boolean
+
+end
diff --git a/app/models/design/image.rb b/app/models/design/image.rb
new file mode 100644
index 00000000..939095e8
--- /dev/null
+++ b/app/models/design/image.rb
@@ -0,0 +1,11 @@
+class Image < DesignFile
+
+ field :in_css, :type => Boolean
+ field :name
+ field :html_id
+ field :html_class
+
+ embedded_in :design_image, polymorphic: true
+
+ mount_uploader :file, ImageUploader
+end
diff --git a/app/models/design/javascript.rb b/app/models/design/javascript.rb
new file mode 100644
index 00000000..7bfd2c5a
--- /dev/null
+++ b/app/models/design/javascript.rb
@@ -0,0 +1,3 @@
+class Javascript < DesignFile
+ embedded_in :design
+end
diff --git a/app/models/design/layout.rb b/app/models/design/layout.rb
new file mode 100644
index 00000000..7ae4ceef
--- /dev/null
+++ b/app/models/design/layout.rb
@@ -0,0 +1,24 @@
+class Layout < DesignFile
+ include Parser
+
+ attr_reader :content
+
+ embeds_one :menu
+ embedded_in :design
+ embeds_many :layout_parts
+
+ after_save :parse_layout
+
+ def content
+ self.file.read.force_encoding("UTF-8") rescue ''
+ end
+
+ def self.exist_one?
+ Layout.count > 0
+ end
+
+ def parse_layout
+ parse_layout_contents(self)
+ end
+
+end
diff --git a/app/models/design/layout_part.rb b/app/models/design/layout_part.rb
new file mode 100644
index 00000000..3b870908
--- /dev/null
+++ b/app/models/design/layout_part.rb
@@ -0,0 +1,18 @@
+class LayoutPart
+
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ field :name
+ field :id_tag
+ field :editable, :type => Boolean
+ field :class_tag
+ field :content
+
+ embedded_in :layout
+
+ def editable?
+ self.editable
+ end
+
+end
diff --git a/app/models/design/menu.rb b/app/models/design/menu.rb
new file mode 100644
index 00000000..47fbc0d9
--- /dev/null
+++ b/app/models/design/menu.rb
@@ -0,0 +1,10 @@
+class Menu
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ field :levels, :type => Integer
+ field :values, :type => Hash
+
+ embedded_in :layout
+
+end
diff --git a/app/models/design/stylesheet.rb b/app/models/design/stylesheet.rb
new file mode 100644
index 00000000..f26f1558
--- /dev/null
+++ b/app/models/design/stylesheet.rb
@@ -0,0 +1,35 @@
+class Stylesheet < DesignFile
+ embedded_in :design
+ mount_uploader :file_orig, AssetUploader
+
+ def parse_urls
+ orig_content = content = self.file.read.force_encoding("UTF-8")
+ self.remove_file!
+ self.remove_file_orig!
+ names = []
+ images = self.design.images
+ content.scan(/(?<=url)(.*?)(?=\))/){
+ css_name = $1.gsub(' ','').gsub('(','')
+ name = File.basename(css_name).gsub(/[\\\"]/, '')
+ file_name = images.detect{ |i| i.file_filename.eql?(name) }.file_url rescue nil
+ names << [css_name, file_name]
+ }
+ names.each do |name|
+ content.gsub!(name[0], name[1]) if name[1]
+ end
+ Dir.mktmpdir('f_path') { |dir|
+ orig_file_name = self.file_filename
+
+ temp_file = File.new(dir + '/' + orig_file_name, 'w+')
+ temp_file.write orig_content.force_encoding("UTF-8")
+ self.file_orig = temp_file
+
+ temp_file = File.new(dir + '/' + orig_file_name, 'w+')
+ temp_file.write content.force_encoding("UTF-8")
+ self.file = temp_file
+
+ self.save
+ }
+ end
+
+end
diff --git a/app/models/design/theme.rb b/app/models/design/theme.rb
new file mode 100644
index 00000000..e6974181
--- /dev/null
+++ b/app/models/design/theme.rb
@@ -0,0 +1,13 @@
+class Theme < Stylesheet
+ embedded_in :design
+ field :name
+
+ before_save :set_name
+
+ protected
+
+ def set_name
+ self.name = File.basename(self.file_filename,".css")
+ end
+
+end
diff --git a/app/models/layout.rb b/app/models/layout.rb
deleted file mode 100644
index 53da1f35..00000000
--- a/app/models/layout.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class Layout
-
- include Mongoid::Document
- include Mongoid::Timestamps
-
- field :name, :index => true
- field :description
- field :content
-
- references_many :children, :class_name => "Item"
- has_many :layout_parts
-
- validates_presence_of :name
- validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
- validates_uniqueness_of :name
-
- def self.exist_one?
- Layout.count > 0
- end
-
-end
diff --git a/app/models/layout_part.rb b/app/models/layout_part.rb
deleted file mode 100644
index 063e1b38..00000000
--- a/app/models/layout_part.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class LayoutPart
-
- include Mongoid::Document
- include Mongoid::Timestamps
-
- field :name
- field :content
-
- belongs_to :layout
-
-end
\ No newline at end of file
diff --git a/app/models/module_app.rb b/app/models/module_app.rb
new file mode 100644
index 00000000..f692fb21
--- /dev/null
+++ b/app/models/module_app.rb
@@ -0,0 +1,13 @@
+class ModuleApp
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ field :name_of_app
+ field :version
+ field :organization
+ field :author
+ field :intro
+ field :update_info
+ field :create_date
+
+end
diff --git a/app/models/page.rb b/app/models/page.rb
index 726809f5..dad89219 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -1,20 +1,17 @@
class Page < Item
-
- #include LayoutSupport
field :content
- field :layout_name
- field :layout_id
+ field :theme_id, :type => BSON::ObjectId, :default => nil
- validates_presence_of :layout_name, :layout_id
-
- referenced_in :layout
+ belongs_to :design
has_many :page_parts
+ embeds_many :custom_images, as: :design_image
+
def create_parts
- page_layout = self.get_layout
- page_layout.layout_parts.each do |p|
- self.page_parts.create( :name => p.name, :i18n_variable_id => I18nVariable.create.id, :kind => 'text' ) if p['editable']
+ page_design = self.design
+ page_design.layout.layout_parts.each do |p|
+ self.page_parts.create( :name => p.name, :i18n_variable_id => I18nVariable.create.id, :kind => 'text' ) if p.editable?
end
end
@@ -26,19 +23,8 @@ class Page < Item
end
end
- def get_layout
- Layout.find(layout_id)
- end
-
- protected
-
- def setup_default_value
- super
-
- if self.layout_id
- self.layout_name = get_layout.name
- end
-
+ def is_home?
+ self.parent ? false : true
end
end
diff --git a/app/models/purchase/p_design.rb b/app/models/purchase/p_design.rb
new file mode 100644
index 00000000..427fe4f5
--- /dev/null
+++ b/app/models/purchase/p_design.rb
@@ -0,0 +1,3 @@
+class PDesign < Purchase
+
+end
\ No newline at end of file
diff --git a/app/models/purchase/p_module_app.rb b/app/models/purchase/p_module_app.rb
new file mode 100644
index 00000000..18598b2a
--- /dev/null
+++ b/app/models/purchase/p_module_app.rb
@@ -0,0 +1,3 @@
+class PModuleApp < Purchase
+
+end
\ No newline at end of file
diff --git a/app/models/purchase/purchase.rb b/app/models/purchase/purchase.rb
new file mode 100644
index 00000000..a8a9bcfd
--- /dev/null
+++ b/app/models/purchase/purchase.rb
@@ -0,0 +1,12 @@
+class Purchase
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ field :purchase_id
+ field :title
+ field :author
+ field :intro
+ field :downloaded, :type => Boolean
+ field :download_date, :type => Date
+
+end
diff --git a/app/models/site.rb b/app/models/site.rb
index 6cd490da..065a6f79 100644
--- a/app/models/site.rb
+++ b/app/models/site.rb
@@ -6,4 +6,27 @@ class Site
field :in_use_locales, :type => Array
field :valid_locales, :type => Array
+ field :roaming_id
+ field :private_key, :type => Binary
+ field :public_key, :type => Binary
+
+ field :school
+ field :department
+
+ def generate_keys
+ private_key = OpenSSL::PKey::RSA.generate(2048)
+ self.public_key = private_key.public_key.to_s
+ self.private_key = private_key.to_s
+ end
+
+ def registered?
+ !self.roaming_id.blank?
+ end
+
+ def up_to_date?
+ p res = %x(git remote show origin)
+ res = res.split('rails_3_1').pop.gsub('(', '').gsub(')','').strip rescue nil
+ res.eql?('local out of date') ? false : true
+ end
+
end
diff --git a/app/models/attribute_model.rb b/app/models/user/attribute_model.rb
similarity index 86%
rename from app/models/attribute_model.rb
rename to app/models/user/attribute_model.rb
index 5cc11aa2..d2cb8a1a 100644
--- a/app/models/attribute_model.rb
+++ b/app/models/user/attribute_model.rb
@@ -11,7 +11,7 @@ class AttributeModel
field :built_in, :type => Boolean, :default => false
field :disabled, :type => Boolean, :default => false
- embedded_in :user_attribute_model, :inverse_of => :attribute_models
+ embedded_in :user_attribute_model
validates_uniqueness_of :key
# Destroy the i18n_variable
@@ -29,7 +29,8 @@ class AttributeModel
if self.i18n_variable_id
self.i18n_variable.update_attributes(attr)
else
- var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class, :parent_id => self.user_attribute_model.i18n_variable_id}))
+ # var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class, :parent_id => self.user_attribute_model.i18n_variable_id}))
+ var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class}))
var.save
self.i18n_variable_id = var.id
end
diff --git a/app/models/attribute_value.rb b/app/models/user/attribute_value.rb
similarity index 100%
rename from app/models/attribute_value.rb
rename to app/models/user/attribute_value.rb
diff --git a/app/models/user.rb b/app/models/user/user.rb
similarity index 63%
rename from app/models/user.rb
rename to app/models/user/user.rb
index f7171723..f582dc04 100644
--- a/app/models/user.rb
+++ b/app/models/user/user.rb
@@ -8,12 +8,11 @@ class User
mount_uploader :avatar, AvatarUploader
field :admin, :type => Boolean, :default => true
- field :active_roles, :type => Array
+ field :active_role
has_many :user_attributes
has_many :user_roles
has_many :user_infos
- before_save :clean_active_roles
# Update or create the user_role records
def user_roles=(*attrs)
@@ -49,26 +48,15 @@ class User
self.user_roles.detect {|a| a.key.to_s == key.to_s }
end
- # Get the active user_role_models
- def get_active_role_models
- self.active_roles.map{ |role| get_role_model(role) } rescue []
- end
-
- # Get an user_role_model from key
- def get_role_model(key)
- UserRoleModel.first(:conditions => {:key => key})
- end
-
- # Get the active roles names or default to '-'
- def get_roles
- (self.active_roles.nil? || self.active_roles.empty?) ? '-' : self.active_roles.map{|role| I18nVariable.first(:conditions => {:key => role})[I18n.locale] rescue role}.join(' / ')
- end
-
- protected
-
- # Remove empty values
- def clean_active_roles
- self.active_roles.delete('') if self.active_roles
+ def name
+ infos = self.user_infos.detect {|info| info.key.to_s.eql?('profile') }
+ if infos
+ first_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
+ last_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
+ return "#{first_name} #{last_name}"
+ else
+ return nil
+ end
end
end
diff --git a/app/models/user_attribute.rb b/app/models/user/user_attribute.rb
similarity index 93%
rename from app/models/user_attribute.rb
rename to app/models/user/user_attribute.rb
index 002ec4be..ddf04cc1 100644
--- a/app/models/user_attribute.rb
+++ b/app/models/user/user_attribute.rb
@@ -7,7 +7,7 @@ class UserAttribute
has_many :attribute_values
# Update or create the attribute_value records
- def attributes=(*args)
+ def attribute_values=(*args)
args[0].each do |value|
if value[:id].blank?
attribute_values.build(value)
diff --git a/app/models/user_attribute_model.rb b/app/models/user/user_attribute_model.rb
similarity index 97%
rename from app/models/user_attribute_model.rb
rename to app/models/user/user_attribute_model.rb
index a70c9f85..c8aea4b2 100644
--- a/app/models/user_attribute_model.rb
+++ b/app/models/user/user_attribute_model.rb
@@ -53,7 +53,7 @@ class UserAttributeModel
end
def is_disabled?
- self.disabled
+ self.disabled.blank? ? false : self.disabled
end
def get_enabled_attribute_models
diff --git a/app/models/user_info.rb b/app/models/user/user_info.rb
similarity index 100%
rename from app/models/user_info.rb
rename to app/models/user/user_info.rb
diff --git a/app/models/user_info_model.rb b/app/models/user/user_info_model.rb
similarity index 100%
rename from app/models/user_info_model.rb
rename to app/models/user/user_info_model.rb
diff --git a/app/models/user_role.rb b/app/models/user/user_role.rb
similarity index 100%
rename from app/models/user_role.rb
rename to app/models/user/user_role.rb
diff --git a/app/models/user/user_role_model.rb b/app/models/user/user_role_model.rb
new file mode 100644
index 00000000..d5271edd
--- /dev/null
+++ b/app/models/user/user_role_model.rb
@@ -0,0 +1,8 @@
+class UserRoleModel < UserAttributeModel
+
+ # Get an user_role_model from key
+ def self.get_role_model_from_key(key)
+ self.first(:conditions => {:key => key})
+ end
+
+end
diff --git a/app/models/user_role_model.rb b/app/models/user_role_model.rb
deleted file mode 100644
index b35fce32..00000000
--- a/app/models/user_role_model.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class UserRoleModel < UserAttributeModel
-
-end
diff --git a/app/uploaders/asset_uploader.rb b/app/uploaders/asset_uploader.rb
index 32b14a93..1e07bca6 100644
--- a/app/uploaders/asset_uploader.rb
+++ b/app/uploaders/asset_uploader.rb
@@ -1,6 +1,14 @@
# encoding: utf-8
class AssetUploader < CarrierWave::Uploader::Base
+ require 'mime/types'
+
+ process :set_content_type
+
+ def set_content_type(*args)
+ content_type = file.content_type == ('binary/octet-stream' || 'application/octet-stream') || file.content_type.blank? ? MIME::Types.type_for(original_filename).first.to_s : file.content_type
+ self.file.instance_variable_set(:@content_type, content_type)
+ end
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb
new file mode 100644
index 00000000..29a4d92b
--- /dev/null
+++ b/app/uploaders/image_uploader.rb
@@ -0,0 +1,71 @@
+# encoding: utf-8
+
+class ImageUploader < CarrierWave::Uploader::Base
+
+ require 'mime/types'
+
+ process :set_content_type
+
+ # Include RMagick or ImageScience support:
+ # include CarrierWave::RMagick
+ # include CarrierWave::ImageScience
+ include CarrierWave::MiniMagick
+
+ def set_content_type(*args)
+ content_type = file.content_type == ('binary/octet-stream' || 'application/octet-stream') || file.content_type.blank? ? MIME::Types.type_for(original_filename).first.to_s : file.content_type
+ self.file.instance_variable_set(:@content_type, content_type)
+ end
+
+ # Choose what kind of storage to use for this uploader:
+ # storage :file
+ # storage :s3
+
+ # Override the directory where uploaded files will be stored.
+ # This is a sensible default for uploaders that are meant to be mounted:
+ def store_dir
+ "image/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
+ end
+
+ # Provide a default URL as a default if there hasn't been a file uploaded:
+ # def default_url
+ # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
+ # end
+
+ # Process files as they are uploaded:
+ # process :scale => [200, 300]
+ #
+ # def scale(width, height)
+ # # do something
+ # end
+
+ # Create different versions of your uploaded files:
+ # version :thumb do
+ # process :scale => [50, 50]
+ # end
+
+ version :thumb do
+ process :resize_to_fit => [200, 200]
+ end
+
+ # Add a white list of extensions which are allowed to be uploaded.
+ # For images you might use something like this:
+ # def extension_white_list
+ # %w(jpg jpeg gif png)
+ # end
+
+ # Override the filename of the uploaded files:
+ # def filename
+ # "something.jpg" if original_filename
+ # end
+
+ def manipulate!
+ cache_stored_file! if !cached?
+ image = ::MiniMagick::Image.open(current_path)
+ image = yield(image)
+ image.write(current_path)
+ ::MiniMagick::Image.open(current_path)
+ rescue
+ nil
+ end
+
+end
diff --git a/app/views/.swp b/app/views/.swp
new file mode 100644
index 00000000..a9dcf2b1
Binary files /dev/null and b/app/views/.swp differ
diff --git a/app/views/admin/designs/_design_file.html.erb b/app/views/admin/designs/_design_file.html.erb
new file mode 100644
index 00000000..205b5350
--- /dev/null
+++ b/app/views/admin/designs/_design_file.html.erb
@@ -0,0 +1,24 @@
+<%= f.label "field_name", t('admin.' + field_name) %>
+
+ <% object.send(field_name).each do |t| %>
+ >
+ <%= t.file_filename %>
+ <% if classes.include?('r_destroy') %>
+ <%= fields_for "design[" + field_name + "][]", t, :index => nil do |f| %>
+ <%= f.hidden_field :id %>
+ <%= f.hidden_field :file %>
+ <%= f.hidden_field :to_destroy %>
+ <% end %>
+ <%= t('Delete') %>
+ <% end %>
+ <% if classes.include?('r_edit') %>
+ <%= t('Edit') %>
+ <% end %>
+
+ <% end %>
+
+
+<%= fields_for "design[" + field_name + "][]", object.send(field_name).build, :index => nil do |f| %>
+ <%= f.file_field :file, :class => "multi_files" %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/designs/_form.html.erb b/app/views/admin/designs/_form.html.erb
new file mode 100644
index 00000000..2711faa0
--- /dev/null
+++ b/app/views/admin/designs/_form.html.erb
@@ -0,0 +1,51 @@
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "design_temp" %>
+<% end %>
+
+
+ <%= f.label :title, t('admin.title') %>
+ <%= f.text_field :title, :class => 'text' %>
+
+
+ <%= f.label :author, t('admin.author') %>
+ <%= f.text_field :author, :class => 'text' %>
+
+
+
+ <%= f.label :intro, t('admin.intro') %>
+ <%= f.text_field :intro, :class => 'text' %>
+
+
+
+ <%= f.label "layout", t('admin.layout') %>
+ <% if @design.layout.blank? %>
+ <%= fields_for 'design[layout]' do |f| %>
+ <%= f.file_field :file %>
+ <%= f.hidden_field :to_save, :value => true %>
+ <% end %>
+ <% else %>
+ <%= File.basename (@design.layout.file.url) %>
+ <% end %>
+
+
+ <%= f.label "default_css", t('admin.default_css') %>
+ <% if @design.default_css.blank? %>
+ <%= fields_for 'design[default_css]' do |f| %>
+ <%= f.file_field :file %>
+ <%= f.hidden_field :to_save, :value => true %>
+ <% end %>
+ <% else %>
+ <%= File.basename (@design.default_css.file.url) %>
+ <% end %>
+
+
+ <%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "themes", :f => f, :classes => "r_destroy, r_edit" } %>
+
+
+
+ <%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "javascripts", :f => f, :classes => "r_destroy, r_edit" } %>
+
+
+
+ <%= render :partial => 'design_file', :locals => { :object => @design, :field_name => "images", :f => f, :classes => "r_destroy, r_snapshot" } %>
+
diff --git a/app/views/admin/designs/_stylesheet_field.html.erb b/app/views/admin/designs/_stylesheet_field.html.erb
new file mode 100644
index 00000000..e69de29b
diff --git a/app/views/admin/layouts/edit.html.erb b/app/views/admin/designs/edit.html.erb
similarity index 60%
rename from app/views/admin/layouts/edit.html.erb
rename to app/views/admin/designs/edit.html.erb
index 6785d1c5..5e7e705a 100644
--- a/app/views/admin/layouts/edit.html.erb
+++ b/app/views/admin/designs/edit.html.erb
@@ -1,6 +1,6 @@
-<%= t('admin.editing_layout') %>
+<%= t('admin.editing_design') %>
-<%= form_for @layout, :url => admin_layout_path(@layout) do |f| %>
+<%= form_for @design, :url => admin_design_path(@design) do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
diff --git a/app/views/admin/designs/edit_file.js.erb b/app/views/admin/designs/edit_file.js.erb
new file mode 100644
index 00000000..96746b39
--- /dev/null
+++ b/app/views/admin/designs/edit_file.js.erb
@@ -0,0 +1 @@
+$('#file_editor').remove();
\ No newline at end of file
diff --git a/app/views/admin/designs/index.html.erb b/app/views/admin/designs/index.html.erb
new file mode 100644
index 00000000..76ebecf4
--- /dev/null
+++ b/app/views/admin/designs/index.html.erb
@@ -0,0 +1,31 @@
+<% content_for :secondary do %>
+
+ <%= link_to t('admin.new_design'), new_admin_design_path, :class => 'seclink1' %>
+ <%= link_to t('admin.upload_design'), upload_package_admin_designs_path, :class => 'seclink2' %>
+
+<% end -%>
+
+<%= flash_messages %>
+
+<%= t('admin.list_designs') %>
+
+
+
+ <%= t('admin.title') %>
+ <%= t('admin.author') %>
+ <%= t('admin.intro') %>
+ <%= t('admin.action') %>
+
+
+<% @designs.each do |design| %>
+
+ <%= design.title %>
+ <%= design.author %>
+ <%= design.intro %>
+
+ <%= link_to t(:edit), edit_admin_design_path(design) %> |
+ <%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete %>
+
+
+<% end %>
+
diff --git a/app/views/admin/layouts/new.html.erb b/app/views/admin/designs/new.html.erb
similarity index 62%
rename from app/views/admin/layouts/new.html.erb
rename to app/views/admin/designs/new.html.erb
index 91d3fed5..ded2237a 100644
--- a/app/views/admin/layouts/new.html.erb
+++ b/app/views/admin/designs/new.html.erb
@@ -1,6 +1,6 @@
-<%= t('admin.new_layout') %>
+<%= t('admin.new_design') %>
-<%= form_for :layout, :url => admin_layouts_path do |f| %>
+<%= form_for :design, :url => admin_designs_path do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
diff --git a/app/views/admin/designs/upload_package.html.erb b/app/views/admin/designs/upload_package.html.erb
new file mode 100644
index 00000000..08ce91cf
--- /dev/null
+++ b/app/views/admin/designs/upload_package.html.erb
@@ -0,0 +1,9 @@
+
+<%= form_tag '',:multipart => true,:action=>"post" do |f| %>
+
+
+<%= file_field :design,:package_file %>
+
+<%= submit_tag %>
+
+<% end %>
diff --git a/app/views/admin/items/index.html.erb b/app/views/admin/items/index.html.erb
index 6e224aa6..5d2c714e 100644
--- a/app/views/admin/items/index.html.erb
+++ b/app/views/admin/items/index.html.erb
@@ -1,3 +1,4 @@
+
<% content_for :sidebar do %>
<%= render 'admin/items/site_map_left_bar' %>
<% end -%>
@@ -21,4 +22,4 @@
}
-->
<% end %>
-<%= render "admin/#{@item._type.downcase.pluralize}/show" %>
\ No newline at end of file
+<%= render "admin/#{@item._type.downcase.pluralize}/show" %>
diff --git a/app/views/admin/layouts/_form.html.erb b/app/views/admin/layouts/_form.html.erb
deleted file mode 100644
index a34d8e86..00000000
--- a/app/views/admin/layouts/_form.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-
-<%= f.label :name, t('admin.name') %>
-<%= f.text_field :name, :class => 'text' %>
-
-
-
-<%= f.label :description, t('admin.description') %>
-<%= f.text_field :description, :class => 'text' %>
-
-
-
-<%= f.label "content", t('admin.content') %>
-<%= f.text_area :content, :size => '100x30' %>
-
diff --git a/app/views/admin/layouts/index.html.erb b/app/views/admin/layouts/index.html.erb
deleted file mode 100644
index b0634d3a..00000000
--- a/app/views/admin/layouts/index.html.erb
+++ /dev/null
@@ -1,28 +0,0 @@
-<% content_for :secondary do %>
-
- <%= link_to t(:new_layout, :scope => :admin), new_admin_layout_path, :class => 'button positive' %>
-
-<% end -%>
-
-<%= flash_messages %>
-
-<%= t('admin.list_layouts') %>
-
-
-
- <%= t('admin.name') %>
- <%= t('admin.description') %>
- <%= t('admin.action') %>
-
-
-<% @layouts.each do |layout| %>
-
- <%= layout.name %>
- <%= layout.description %>
-
- <%= link_to t(:edit), edit_admin_layout_path(layout) %> |
- <%= link_to t(:delete), admin_layout_path(layout), :confirm => t('sure?'), :method => :delete %>
-
-
-<% end %>
-
diff --git a/app/views/admin/pages/_edit.html.erb b/app/views/admin/pages/_edit.html.erb
new file mode 100644
index 00000000..61ff8046
--- /dev/null
+++ b/app/views/admin/pages/_edit.html.erb
@@ -0,0 +1,10 @@
+<%= flash_messages %>
+
+<%= t('admin.editing_page') %>
+
+<%= form_for @item, :url => admin_page_path(@item) do |f| %>
+ <%= render :partial => "form", :locals => { :f => f } %>
+
+ <%= f.submit t('update') %> <%= link_back %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/pages/_edit_code.html.erb b/app/views/admin/pages/_edit_code.html.erb
deleted file mode 100644
index 24069927..00000000
--- a/app/views/admin/pages/_edit_code.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<%= flash_messages %>
-
-<%= form_for @item, :url => admin_page_path(@item), :html => { :class => 'form' } do |f| %>
- <%= render :partial => "admin/pages/form_code", :locals => { :f => f, :locale => locale } %>
-
- <%= f.submit t(:update) %> <%= link_back %>
-
-<% end %>
\ No newline at end of file
diff --git a/app/views/admin/pages/_form.html.erb b/app/views/admin/pages/_form.html.erb
index 89c56e69..845e4d37 100644
--- a/app/views/admin/pages/_form.html.erb
+++ b/app/views/admin/pages/_form.html.erb
@@ -15,8 +15,20 @@
<% end %>
-<%= f.label :layout_id, t('admin.layout_name') %>
-<%= f.select :layout_id, Layout.all.map{ |l| [l.description, l.id] } %>
+ <%= t('admin.design_name') %>
+ <% if @design %>
+ <%= f.collection_select :design_id, @designs, :id, :title, {}, :rel => admin_pages_path %>
+ <% else %>
+ <%= f.select :design_id, @designs.collect { |d| [d.title, d.id] }, {:selected => @default_design.id}, {:rel => admin_pages_path} %>
+ <% end %>
+
+
+ <%= t('admin.theme') %>
+ <% if @design %>
+ <%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %>
+ <% else %>
+ <%= f.select :theme_id, @default_design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %>
+ <% end %>
diff --git a/app/views/admin/pages/_form_code.html.erb b/app/views/admin/pages/_form_code.html.erb
deleted file mode 100644
index ad0e55ed..00000000
--- a/app/views/admin/pages/_form_code.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= f.error_messages %>
-
-<%= f.text_area :content %>
\ No newline at end of file
diff --git a/app/views/admin/pages/_show.html.erb b/app/views/admin/pages/_show.html.erb
index 2bc1d1f4..39905cbf 100644
--- a/app/views/admin/pages/_show.html.erb
+++ b/app/views/admin/pages/_show.html.erb
@@ -9,4 +9,4 @@
$(this).children('.edit_link').toggle();
});
-<% end -%>
\ No newline at end of file
+<% end -%>
diff --git a/app/views/admin/pages/_themes_ddl.html.erb b/app/views/admin/pages/_themes_ddl.html.erb
new file mode 100644
index 00000000..1bb31ac9
--- /dev/null
+++ b/app/views/admin/pages/_themes_ddl.html.erb
@@ -0,0 +1,2 @@
+
+<%= options_from_collection_for_select(@themes, :id, :name) %>
\ No newline at end of file
diff --git a/app/views/admin/pages/edit.html.erb b/app/views/admin/pages/edit.html.erb
index dd812ac0..aecf04c7 100644
--- a/app/views/admin/pages/edit.html.erb
+++ b/app/views/admin/pages/edit.html.erb
@@ -1,15 +1,5 @@
<% content_for :sidebar do %>
- <%= render 'admin/items/site_map_left_bar' %>
+ <%= render 'admin/items/site_map_left_bar' %>
<% end -%>
-
<%= t('admin.editing_page') %>
-
-<%= form_for @item, :url => admin_page_path(@item) do |f| %>
- <%= f.error_messages %>
- <%= render :partial => @code ? 'form_code' : 'form', :locals => { :f => f } %>
-
-
- <%= f.submit t('update') %> <%= link_back %>
-
-
-<% end %>
+<%= render 'edit' %>
diff --git a/app/views/admin/pages/edit.js.erb b/app/views/admin/pages/edit.js.erb
index 9c61245e..67d528b5 100644
--- a/app/views/admin/pages/edit.js.erb
+++ b/app/views/admin/pages/edit.js.erb
@@ -1 +1 @@
-$('#panel_main').html("<%= escape_javascript(render(:partial => @code ? 'edit_code' : 'edit')) %>");
\ No newline at end of file
+$('#panel_main').html("<%= escape_javascript(render 'edit') %>");
\ No newline at end of file
diff --git a/app/views/admin/pages/reload_themes.js.erb b/app/views/admin/pages/reload_themes.js.erb
new file mode 100644
index 00000000..8515d02a
--- /dev/null
+++ b/app/views/admin/pages/reload_themes.js.erb
@@ -0,0 +1 @@
+$('#page_theme_id').html("<%= escape_javascript(render :partial => 'admin/pages/themes_ddl') %>");
\ No newline at end of file
diff --git a/app/views/admin/pages/show.html.erb b/app/views/admin/pages/show.html.erb
index 6dd0f923..d6b6a8a2 100644
--- a/app/views/admin/pages/show.html.erb
+++ b/app/views/admin/pages/show.html.erb
@@ -2,4 +2,4 @@
<%= render 'admin/items/site_map_left_bar' %>
<% end -%>
-<%= render @code ? 'show_code' : 'show' %>
\ No newline at end of file
+<%= render 'show' %>
\ No newline at end of file
diff --git a/app/views/admin/purchases/index.html.erb b/app/views/admin/purchases/index.html.erb
new file mode 100644
index 00000000..1bd870e4
--- /dev/null
+++ b/app/views/admin/purchases/index.html.erb
@@ -0,0 +1,25 @@
+<%= t('admin.list_puchases') %>
+
+
+
+ <%= t('admin.title') %>
+ <%= t('admin.intro') %>
+ <%= t('admin.author') %>
+ <%= t('admin.action') %>
+
+
+<% @purchases.each do |purchase| %>
+
+ <%= purchase.title %>
+ <%= purchase.intro %>
+ <%= purchase.author %>
+
+ <% if purchase.downloaded %>
+ <%= t(:downloaded) %>
+ <% else %>
+ <%= link_to t(:download) , download_admin_purchase_path(purchase) %>
+ <% end %>
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/app/views/admin/sites/_registration.html.erb b/app/views/admin/sites/_registration.html.erb
new file mode 100644
index 00000000..062db5b9
--- /dev/null
+++ b/app/views/admin/sites/_registration.html.erb
@@ -0,0 +1,12 @@
+<% if @site && @site.registered? %>
+<%# if @site %>
+
+ <%= t('admin.registered') %>
+
+<% else %>
+
+ <%= link_to 'register', "http://#{APP_CONFIG['store_ip']}/user/sites/register?" +
+ {:site => {:school => @site.school, :department => @site.department}}.to_query,
+ :target => '_blank' %>
+
+<% end %>
diff --git a/app/views/admin/sites/_update.html.erb b/app/views/admin/sites/_update.html.erb
new file mode 100644
index 00000000..cf565d38
--- /dev/null
+++ b/app/views/admin/sites/_update.html.erb
@@ -0,0 +1,10 @@
+<%# if @site.up_to_date? %>
+<% if true %>
+
+ <%= t('admin.up_to_date') %>
+
+<% else %>
+
+ <%= link_to t(:update), site_update_path %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/sites/index.html.erb b/app/views/admin/sites/index.html.erb
new file mode 100644
index 00000000..ec22707c
--- /dev/null
+++ b/app/views/admin/sites/index.html.erb
@@ -0,0 +1,33 @@
+
+
Site Information
+
+
+ School Name
+ <%= @site.school %>
+
+
+ Department
+ <%= @site.department %>
+
+
+ Version
+ v0.1
+
+
+ Administrator
+ admin
+
+
+ Visitor Counter
+ 2,201
+
+
+ Registration Status
+ <%= render 'registration' %>
+
+
+ Updates
+ <%= render 'update' %>
+
+
+
\ No newline at end of file
diff --git a/app/views/sites/new.html.erb b/app/views/admin/sites/new.html.erb
similarity index 100%
rename from app/views/sites/new.html.erb
rename to app/views/admin/sites/new.html.erb
diff --git a/app/views/admin/user_attribute_models/_attribute_model.html.erb b/app/views/admin/user_attribute_models/_attribute_model.html.erb
index e8ad4854..819f584b 100644
--- a/app/views/admin/user_attribute_models/_attribute_model.html.erb
+++ b/app/views/admin/user_attribute_models/_attribute_model.html.erb
@@ -1,40 +1,36 @@
<%= fields_for "user_#{@attribute}_model[attribute_models][]", attribute_model, :index => nil do |f| %>
-
-
- <%= attribute_model.new_record? ? (f.text_field :key, {:style => "width:130px"}) : attribute_model.key %>
-
- <%= check_box_tag "locale[]", value = '', attribute_model.locale.nil? ? true : attribute_model.locale %>
- <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][locale]", attribute_model.locale.nil? ? true : attribute_model.locale %>
-
- <% @site_valid_locales.each do |locale| %>
- <%= text_field_tag "user_#{@attribute}_model[attribute_models][][i18n_variable][#{locale}]", (attribute_model.i18n_variable[locale] rescue nil), :style => "width:130px" %>
- <% end %>
-
- <%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %>
- >
- <%= t('admin.options') %>:
- <%= text_field_tag "user_#{@attribute}_model[attribute_models][][select_list_options]", attribute_model.select_list_options, :style => "width:130px" %>
-
-
-
- <% if attribute_model.new_record? %>
- (<%= t(:delete) %>)
- <% else %>
-
- <% if attribute_model.is_built_in? %>
-
- <%= t(:disable) %>
- <%= t(:enable) %>
-
- <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][disabled]", attribute_model.is_disabled? , :class => 'built_in_state' %>
- <% else %>
- (<%= t(:delete) %>)
- <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %>
- <% end %>
- <%= f.hidden_field :id %>
- <%= f.hidden_field :key %>
- <% end %>
-
-
-
-<% end %>
+
+ <%= attribute_model.new_record? ? (f.text_field :key) : attribute_model.key %>
+
+ <%= check_box_tag "locale[]", value = '', attribute_model.locale.nil? ? true : attribute_model.locale %>
+ <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][locale]", attribute_model.locale.nil? ? true : attribute_model.locale %>
+
+ <% @site_valid_locales.each do |locale| %>
+ <%= text_field_tag "user_#{@attribute}_model[attribute_models][][i18n_variable][#{locale}]", (attribute_model.i18n_variable[locale] rescue nil), :style => "width:130px" %>
+ <% end %>
+
+ <%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %>
+ >
+ <%= t('admin.options') %>:
+ <%= text_field_tag "user_#{@attribute}_model[attribute_models][][select_list_options]", attribute_model.select_list_options, :style => "width:130px" %>
+
+
+
+
+ <% if attribute_model.new_record? %>
+ <%= t(:delete) %>
+ <% else %>
+ <% if attribute_model.is_built_in? %>
+
+ <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][disabled]", attribute_model.is_disabled? , :class => 'built_in_state' %>
+ <% else %>
+ <%= t(:delete) %>
+ <%= hidden_field_tag "user_#{@attribute}_model[attribute_models][][should_destroy]", nil , :class => 'should_destroy' %>
+ <% end %>
+ <%= f.hidden_field :id %>
+ <%= f.hidden_field :key %>
+ <% end %>
+
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/user_attribute_models/_form.html.erb b/app/views/admin/user_attribute_models/_form.html.erb
index 3b8a0b5f..beb9c5df 100644
--- a/app/views/admin/user_attribute_models/_form.html.erb
+++ b/app/views/admin/user_attribute_models/_form.html.erb
@@ -1,60 +1,74 @@
-
-
- <%= t('admin.key') %>
- <% @site_valid_locales.each do |locale| %>
- <%= locale %>
- <% end %>
-
-
- <%= is_new ? (f.text_field :key, {:style => "width:130px"}) : @user_attribute_model.key %>
- <% @site_valid_locales.each do |locale| %>
-
- <%= text_field_tag "user_#{@attribute}_model[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:130px" %>
-
- <% end %>
-
-
-
-
-
- <%= t('admin.attributes')%>
-
-
-
-
- <%= t('admin.key') %>
- <%= t('admin.multilingual') %>
- <% @site_valid_locales.each do |locale| %>
- <%= locale %>
- <% end %>
- <%= t('admin.type')%>
-
-
- <%= render :partial => 'admin/user_attribute_models/attribute_model', :collection => @user_attribute_model.attribute_models %>
-
-
- (<%= t(:add) %>)
-
+
+
<%= t("admin.user_#{@attribute}") %>
+
+
+
<% content_for :page_specific_javascript do %>
+<% end -%>
diff --git a/app/views/admin/users/_show_user_attribute.html.erb b/app/views/admin/users/_show_user_attribute.html.erb
new file mode 100644
index 00000000..a6468944
--- /dev/null
+++ b/app/views/admin/users/_show_user_attribute.html.erb
@@ -0,0 +1,27 @@
+
\ No newline at end of file
diff --git a/app/views/admin/users/_user_attribute.html.erb b/app/views/admin/users/_user_attribute.html.erb
new file mode 100644
index 00000000..1ee17890
--- /dev/null
+++ b/app/views/admin/users/_user_attribute.html.erb
@@ -0,0 +1,44 @@
+<%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %>
+ <%= f.hidden_field :key, :value => ua.key %>
+ <%= f.hidden_field :id unless user_attribute.new_record? %>
+
+
+
+<% end %>
diff --git a/app/views/admin/users/edit.html.erb b/app/views/admin/users/edit.html.erb
new file mode 100644
index 00000000..2e114f21
--- /dev/null
+++ b/app/views/admin/users/edit.html.erb
@@ -0,0 +1,14 @@
+<% content_for :body_id do %>user_list<% end -%>
+
+
+ <%= form_for @user, :url => admin_user_path(@user), :html => { :multipart => true } do |f| %>
+ <%= f.error_messages %>
+ <%= render :partial => 'form', :locals => { :f => f } %>
+
+ <%= link_to t('update'), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
+
+
+ <%= link_back %>
+
+ <% end -%>
+
\ No newline at end of file
diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb
new file mode 100644
index 00000000..09a8ec22
--- /dev/null
+++ b/app/views/admin/users/index.html.erb
@@ -0,0 +1,34 @@
+<% content_for :body_id do %>user_list<% end -%>
+
+
+ <%= flash_messages %>
+
+ <%= link_to t('admin.new_user'), new_admin_user_path %>
+
+
+
+ <%= t('admin.role') %>
+ <%= t('admin.name') %>
+ <%= t('admin.email') %>
+ <%= t('admin.admin') %>
+ <%= t('admin.action') %>
+
+ <% @users.each do |user| %>
+
+ <% active_role = UserRoleModel.get_role_model_from_key(user.active_role) %>
+ <%= active_role.i18n_variable[I18n.locale] rescue nil %>
+ <%= user.name ? user.name : 'bob' %>
+ <%= user.email %>
+ <%= user.admin ? t(:yes_) : t(:no_) %>
+
+ <%= link_to t(:show), admin_user_path(user), :class => 'show' %>
+ <%= link_to t(:edit), edit_admin_user_path(user), :class => 'edit' %>
+ <%= link_to t(:delete), admin_user_path(user), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
+
+
+ <% end %>
+
+
+ <%= link_to t('admin.new_user'), new_admin_user_path %>
+
+
diff --git a/app/views/admin/users/new.html.erb b/app/views/admin/users/new.html.erb
new file mode 100644
index 00000000..a3864046
--- /dev/null
+++ b/app/views/admin/users/new.html.erb
@@ -0,0 +1,19 @@
+<% content_for :body_id do %>user_list<% end -%>
+
+
+ <%= form_for @user, :url => admin_users_path, :html => { :multipart => true } do |f| %>
+ <%= f.error_messages %>
+ <%= render :partial => 'form', :locals => { :f => f } %>
+
+ <%= link_to t('create'), "#", :onclick=>"$('#new_user').submit()" %>
+
+
+ <%= link_back %>
+
+ <% end -%>
+
+
+
+
+
+
diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb
new file mode 100644
index 00000000..cc6fafff
--- /dev/null
+++ b/app/views/admin/users/show.html.erb
@@ -0,0 +1,30 @@
+<% content_for :body_id do %>user_list<% end -%>
+
+
+
+
+ <% if @user.avatar? %>
+ <%= image_tag(@user.avatar.thumb.url) %>
+ <% else %>
+ <%= image_tag "person.png" %>
+ <% end %>
+ <%= link_to t(:edit), edit_admin_user_path(@user), :id => 'edit' %>
+
+
+ <% @user_info_models.each do |am| %>
+
+
<%= am.i18n_variable[I18n.locale] %>
+
+ <%= render :partial => 'show_user_attribute', :locals => {:am => am, :object => @user.get_info_from_model_key(am.key)} %>
+
+ <% end -%>
+
+
+ <% active_role = UserRoleModel.get_role_model_from_key(@user.active_role) %>
+
<%= active_role.i18n_variable[I18n.locale] %>
+
+ <%= render :partial => 'show_user_attribute', :locals => {:am => active_role, :object => @user.get_role_from_model_key(active_role.key)} %>
+
+
+
+
diff --git a/app/views/devise/menu/_login_items.html.erb b/app/views/devise/menu/_login_items.html.erb
index 68ded0dd..04f94472 100644
--- a/app/views/devise/menu/_login_items.html.erb
+++ b/app/views/devise/menu/_login_items.html.erb
@@ -1,9 +1,9 @@
<% if user_signed_in? %>
-