Chris's first commit at Fri Jan 28 2011 10:14:32 GMT+0800 (CST)

This commit is contained in:
ihower committed 2011-04-13 18:19:51 +08:00
1 parent 554aa0a95d
commit 19a7d51e60
145 files changed
+12742 -893

No files matched your search

+3 -5
View File
@@ -1,16 +1,14 @@
<%= f.error_messages %>
<p>
<%= f.label :filename, "FileName" %>
<%= f.label :filename, t('admin.file_name') %>
<%= f.text_field :filename, :class => 'text' %>
</p>
<p>
<%= f.label :description, "Description" %>
<%= f.label :description, t('admin.description') %>
<%= f.text_field :description, :class => 'text' %>
</p>
<p>
<%= f.label :data, "Data" %>
<%= f.label :data, t('admin.data') %>
<%= f.file_field :data %>
</p>
+3 -5
View File
@@ -1,12 +1,10 @@
<h1>Editing assets</h1>
<h1><%= t('editing_asset') %></h1>
<% form_for @asset, :url => admin_asset_path(@asset), :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Update' %>
<%= f.submit t('update') %> <%= link_back %>
</p>
<% end %>
<%= link_to 'Back', admin_assets_path %>
+21 -20
View File
@@ -1,31 +1,32 @@
<h1>Listing assets</h1>
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t(:new_asset, :scope => :admin), new_admin_asset_path, :class => 'button positive' %></li>
</ul>
<% end -%>
<h1><%= t('admin.list_assets') %></h1>
<table>
<tr>
<th>檔案</th>
<th>描述</th>
<th>格式</th>
<th>原上傳檔名</th>
<th>檔案大小</th>
<th></th>
<th></th>
<th><%= t('admin.file_name') %></th>
<th><%= t('admin.description') %></th>
<th><%= t('admin.format') %></th>
<th><%= t('admin.orig_upload_file') %></th>
<th><%= t('admin.file_name') %></th>
<th><%= t('admin.action') %></th>
</tr>
<% @assets.each do |asset| %>
<tr>
<td><%#= link_to asset.filename, admin_asset_path(asset) %>
<%= link_to asset.url, asset.url %>
</td>
<td><%= link_to asset.filename, asset.data.url, :target => '_blank' %></td>
<td><%= asset.description %></td>
<td><%= asset.data.content_type %></td>
<td><%= asset.data.file_name %></td>
<td><%= number_to_human_size(asset.data.file_size) %></td>
<td><%= link_to t(:edit), edit_admin_asset_path(asset) %></td>
<td><%= link_to t(:delete), admin_asset_path(asset), :confirm => 'Are you sure?', :method => :delete %></td>
<td><%= asset.data.file.content_type %></td>
<td><%= asset.data_filename %></td>
<td><%= number_to_human_size(asset.data.file.file_length) %></td>
<td>
<%= link_to t(:edit), edit_admin_asset_path(asset) %> |
<%= link_to t(:delete), admin_asset_path(asset), :confirm => t('sure?'), :method => :delete %>
</td>
</tr>
<% end %>
</table>
<br />
<%= link_to t(:new_asset, :scope => :admin), new_admin_asset_path, :class => 'button positive' %>
+4 -5
View File
@@ -1,11 +1,10 @@
<h1>New Asset</h1>
<h1><%= t('admin.new_asset') %></h1>
<% form_for :asset, :url => admin_assets_path, :html => { :multipart => true } do |f| %>
<%= form_for :asset, :url => admin_assets_path, :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Create' %>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end %>
<% end %>
+30
View File
@@ -0,0 +1,30 @@
<%= f.hidden_field :parent_id %>
<p>
<%= f.label :name, t('admin.name') %>
<%= f.text_field :name, :class => 'text', :value => 'home', :disabled => true %>
<%= f.hidden_field :name, :value => 'home' %>
</p>
<% @site_valid_locales.each do |locale| %>
<p>
<%= label_tag "#{f}[title]", "#{t('admin.title')} #{locale}" %>
<%= text_field_tag "#{f}[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %>
</p>
<% end %>
<p>
<%= f.label :layout_name, t('admin.layout_name') %>
<%= f.select :layout_name, Layout.all.map{ |l| [l.description, l.name] } %>
</p>
<p>
<%= f.label "content", t('admin.content') %>
<%= f.text_area "content", :size => '100x30' %>
</p>
<p>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %>
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
</p>
+10
View File
@@ -0,0 +1,10 @@
<h1><%= t('admin.editing_home') %></h1>
<%= form_for @home, :url => admin_home_path(@home) do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit t('update') %> <%= link_back %>
</p>
<% end %>
+11
View File
@@ -0,0 +1,11 @@
<h1><%= t('admin.new_home') %></h1>
<%= form_for :home, :url => admin_homes_path do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end %>
+1 -1
View File
@@ -7,5 +7,5 @@
<td>
<%= link_to t(:show), item.url %> |
<%= link_to t(:edit), edit_admin_component_path(item) %> |
<%= link_to t(:delete), admin_component_path(item), :confirm => 'Are you sure?', :method => :delete %>
<%= link_to t(:delete), admin_component_path(item), :confirm => t('sure?'), :method => :delete %>
</td>
+10
View File
@@ -0,0 +1,10 @@
<td><%= item.class %></td>
<td><%= link_to item.name, admin_items_path(:parent_id => item.id) %></td>
<td><%= item.i18n_variable[I18n.locale] rescue nil %>
<td><%= item.position %></td>
<td><%= item.is_published.to_s %></td>
<td>
<%= link_to t(:show), item.url %> |
<%= link_to t(:edit), edit_admin_home_path(item) %> |
<%= link_to t(:delete), admin_home_path(item), :confirm => t('sure?'), :method => :delete %>
</td>
+10 -11
View File
@@ -1,11 +1,10 @@
<td><%= item.class %></td>
<td><%= link_to item.name, admin_items_path(:parent_name => item.name) %></td>
<td><%=h item.title %>
<td><%= item.position %></td>
<td><%= item.is_published.to_s %></td>
<td>
<%= link_to t(:show), item.url %> |
<%= link_to t(:edit), edit_admin_link_path(item) %> |
<%= link_to t(:delete), admin_link_path(item), :confirm => 'Are you sure?', :method => :delete %>
</td>
<td><%= item.class %></td>
<td><%= item.name %></td>
<td><%= item.i18n_variable[I18n.locale] rescue nil %>
<td><%= item.position %></td>
<td><%= item.is_published.to_s %></td>
<td>
<%= link_to t(:show), item.url %> |
<%= link_to t(:edit), edit_admin_link_path(item) %> |
<%= link_to t(:delete), admin_link_path(item), :confirm => t('sure?'), :method => :delete %>
</td>
+4 -4
View File
@@ -1,11 +1,11 @@
<td><%= item.class %></td>
<td><%= link_to item.name, admin_items_path(:parent_name => item.name) %></td>
<td><%=h item.title %>
<td><%= link_to item.name, admin_items_path(:parent_id => item.id) %></td>
<td><%= item.i18n_variable[I18n.locale] rescue nil %>
<td><%= item.position %></td>
<td><%= item.is_published.to_s %></td>
<td>
<%= link_to t(:show), item.url %> |
<%= link_to t(:edit), edit_admin_page_path(item) %> |
<%= link_to t(:delete), admin_page_path(item), :confirm => 'Are you sure?', :method => :delete %>
</td>
<%= link_to t(:delete), admin_page_path(item), :confirm => t('sure?'), :method => :delete %>
</td>
+3 -3
View File
@@ -1,4 +1,4 @@
<h1>Listing snippets</h1>
<h1><%= t('admin.list_snippets') %></h1>
<table>
<tr>
@@ -9,7 +9,7 @@
<td><%= snippet.name %></td>
<td><%= link_to t(:show), admin_snippet_path(snippet) %>
<td><%= link_to t(:edit), edit_admin_snippet_path(snippet) %></td>
<td><%= link_to t(:delete), admin_snippet_path(snippet), :confirm => 'Are you sure?', :method => :delete %></td>
<td><%= link_to t(:delete), admin_snippet_path(snippet), :confirm => t('sure?'), :method => :delete %></td>
</tr>
<% end %>
<% end if snippets%>
</table>
+37 -25
View File
@@ -1,32 +1,44 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t(:new_page, :scope => :admin), new_admin_page_path( :parent_name => @parent_item.name ), :class => 'button positive' %></li>
<li><%= link_to t(:new_link, :scope => :admin), new_admin_link_path( :parent_name => @parent_item.name ) %>
<li><%= link_to t(:new_snippet, :scope => :admin ), new_admin_snippet_path( :parent_name => @parent_item.name ), :class => 'button positive' %></li>
</ul>
<ul class="list">
<% if (@items.empty? && !@parent_item ) || (!@items.empty? && @items[0].is_home?) %>
<li><%= t('admin.new_page') %></li>
<li><%= t('admin.new_link') %></li>
<li><%= t('admin.new_snippet') %></li>
<% else %>
<li><%= link_to t('admin.new_page'), new_admin_page_path( :parent_id => @parent_item.id ), :class => 'button positive' %></li>
<li><%= link_to t('admin.new_link'), new_admin_link_path( :parent_id => @parent_item.id ) %>
<li><%= link_to t('admin.new_snippet'), new_admin_snippet_path( :parent_id => @parent_item.id ), :class => 'button positive' %></li>
<% end %>
</ul>
<% end -%>
<h1>Listing items: <%= show_parent_items_link(@parent_item) %></h1>
<h1><%= t('admin.list_items') %>: <%= show_parent_items_link unless @parent_item.nil? %></h1>
<table>
<tr>
<th>Class</th>
<th>Name</th>
<th>Title</th>
<th>Position</th>
<th>Published?</th>
<th>Action</th>
<th></th>
</tr>
<% @items.each do |item| %>
<tr>
<%= render :partial => item.class.to_s.downcase, :locals => { :item => item } %>
<!--<td><%= link_to t(:move_up, :scope => :admin), up_admin_item_path(item), :method => :put %> |
<%= link_to t(:move_down, :scope => :admin), down_admin_item_path(item), :method => :put %></td>-->
</tr>
<% if !Layout.exist_one? %>
<div style='color:red'><%= t('admin.no_layout') %>: <%= link_to t('create').downcase, new_admin_layout_path %></div>
<br/>
<% elsif (@items.empty? && !@parent_item ) %>
<div style='color:red'><%= t('admin.no_home_page') %>: <%= link_to t('create').downcase, new_admin_home_path(:parent_id => nil) %></div>
<br/>
<% else %>
<table>
<tr>
<th><%= t('admin.class') %></th>
<th><%= t('admin.name') %></th>
<th><%= t('admin.title') %></th>
<th><%= t('admin.position') %></th>
<th><%= t('admin.published?') %></th>
<th><%= t('admin.action') %></th>
<th></th>
</tr>
<% @items.each do |item| %>
<tr>
<%= render :partial => item.class.to_s.downcase, :locals => { :item => item } %>
<!--<td><%= link_to t(:move_up, :scope => :admin), up_admin_item_path(item), :method => :put %> |
<%= link_to t(:move_down, :scope => :admin), down_admin_item_path(item), :method => :put %></td>-->
</tr>
<% end if @items %>
</table>
<% end %>
</table>
<%= render :partial => "snippets", :locals => { :snippets => @snippets } %>
+5 -21
View File
@@ -1,30 +1,14 @@
<p>
<%= f.label :name, "Name" %>
<%= f.label :name, t('admin.name') %>
<%= f.text_field :name, :class => 'text' %>
</p>
<p>
<%= f.label :description, "Description" %>
<%= f.label :description, t('admin.description') %>
<%= f.text_field :description, :class => 'text' %>
</p>
<p id="content_zh_tw_block">
<%= f.label "content_zh_tw", "Content (zh_tw)" %>
<%= f.text_area "content_zh_tw", :size => '100x30' %>
<p>
<%= f.label "content", t('admin.content') %>
<%= f.text_area :content, :size => '100x30' %>
</p>
<p><a href="#" id="toggle_content_en_block">Edit english</a></p>
<p id="content_en_block">
<%= f.label "content_en", "Content (en)" %>
<%= f.text_area "content_en", :size => '100x30' %>
</p>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
$('#content_en_block').hide();
$('#toggle_content_en_block').click(function(){
$('#content_en_block').toggle();
});
</script>
<% end -%>
+3 -6
View File
@@ -1,12 +1,9 @@
<h1>Editing layouts</h1>
<h1><%= t('admin.editing_layout') %></h1>
<% form_for @layout, :url => admin_layout_path(@layout) do |f| %>
<%= form_for @layout, :url => admin_layout_path(@layout) do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Update' %>
<%= f.submit t('update') %> <%= link_back %>
</p>
<% end %>
<%= link_to 'Back', admin_layouts_path %>
+14 -7
View File
@@ -1,19 +1,26 @@
<h1>Listing layouts</h1>
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t(:new_layout, :scope => :admin), new_admin_layout_path, :class => 'button positive' %></li>
</ul>
<% end -%>
<h1><%= t('admin.list_layouts') %></h1>
<table>
<tr>
<th><%= t('admin.name') %></th>
<th><%= t('admin.description') %></th>
<th><%= t('admin.action') %></th>
</tr>
<% @layouts.each do |layout| %>
<tr>
<td><%= layout.name %></td>
<td><%= layout.description %></td>
<td><%= link_to t(:edit), edit_admin_layout_path(layout) %></td>
<td><%= link_to t(:delete), admin_layout_path(layout), :confirm => 'Are you sure?', :method => :delete %></td>
<td>
<%= link_to t(:edit), edit_admin_layout_path(layout) %> |
<%= link_to t(:delete), admin_layout_path(layout), :confirm => t('sure?'), :method => :delete %>
</td>
</tr>
<% end %>
</table>
<br />
<%= link_to t(:new_layout, :scope => :admin), new_admin_layout_path, :class => 'button positive' %>
+3 -6
View File
@@ -1,13 +1,10 @@
<h1>New layouts</h1>
<h1><%= t('admin.new_layout') %></h1>
<% form_for :layout, :url => admin_layouts_path do |f| %>
<%= form_for :layout, :url => admin_layouts_path do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Create' %>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end %>
<%= link_to 'Back', admin_layouts_path %>
+9 -13
View File
@@ -1,28 +1,24 @@
<%= f.error_messages %>
<%= f.hidden_field :parent_name %>
<%= f.hidden_field :parent_id %>
<p>
<%= f.label :name, "Name" %>
<%= f.text_field :name, :class => 'text' %>
</p>
<p>
<%= f.label :title, "Title en" %>
<%= f.text_field :title_en, :class => 'text' %>
</p>
<% @site_valid_locales.each do |locale| %>
<p>
<%= label_tag "link[title]", "#{t('admin.title')} #{locale}" %>
<%= text_field_tag "link[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %>
</p>
<% end %>
<p>
<%= f.label :title, "Title zh_tw" %>
<%= f.text_field :title_zh_tw, :class => 'text' %>
</p>
<p>
<%= f.label :is_published, "Is Published" %>
<%= f.label :is_published, t('admin.is_published') %>
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
</p>
<p>
<%= f.label :url, "URL" %>
<%= f.text_field :url %>
</p>
</p>
+4 -4
View File
@@ -1,10 +1,10 @@
<h1>Editing pages</h1>
<h1><%= t('admin.editing_link') %></h1>
<% form_for @link, :url => admin_link_path(@link) do |f| %>
<%= form_for @link, :url => admin_link_path(@link) do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Update' %>
<%= f.submit t(:update) %> <%= link_back %>
</p>
<% end %>
<% end %>
+4 -4
View File
@@ -1,11 +1,11 @@
<h1><%= t(:new_link, :scope => :admin) %></h1>
<h1><%= t('admin.new_link') %></h1>
<% form_for @link, :url => admin_links_path do |f| %>
<%= form_for @link, :url => admin_links_path do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Create' %>
<%= f.submit t(:create) %> <%= link_back %>
</p>
<% end %>
<% end %>
+19 -34
View File
@@ -1,49 +1,34 @@
<%= f.error_messages %>
<%= f.hidden_field :parent_name %>
<%= f.hidden_field :parent_id %>
<p>
<%= f.label :name, "Name" %>
<%= f.text_field :name, :class => 'text' %>
</p>
<p>
<%= f.label :title, "Title en" %>
<%= f.text_field :title_en, :class => 'text' %>
<%= f.label :name, t('admin.name') %>
<% if @page.parent_id.nil? %>
<%= f.text_field :name, :class => 'text', :value => 'home', :disabled => true %>
<%= f.hidden_field :name, :value => 'home' %>
<% else %>
<%= f.text_field :name, :class => 'text' %>
<% end %>
</p>
<p>
<%= f.label :title, "Title zh_tw" %>
<%= f.text_field :title_zh_tw, :class => 'text' %>
</p>
<% @site_valid_locales.each do |locale| %>
<p>
<%= label_tag "#{f}[title]", "#{t('admin.title')} #{locale}" %>
<%= text_field_tag "#{f}[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %>
</p>
<% end %>
<p>
<%= f.label :layout_name, "Layout Name" %>
<%= f.label :layout_name, t('admin.layout_name') %>
<%= f.select :layout_name, Layout.all.map{ |l| [l.description, l.name] } %>
</p>
<p id="content_zh_tw_block">
<%= f.label "content_zh_tw", "Content (zh_tw)" %>
<%= f.text_area "content_zh_tw", :size => '100x30' %>
</p>
<p><a href="#" id="toggle_content_en_block">Edit english</a></p>
<p id="content_en_block">
<%= f.label "content_en", "Content (en)" %>
<%= f.text_area "content_en", :size => '100x30' %>
<p>
<%= f.label "content", t('admin.content') %>
<%= f.text_area "content", :size => '100x30' %>
</p>
<p>
<%= f.label :is_published, "Is Published" %>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %>
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
</p>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
$('#content_en_block').hide();
$('#toggle_content_en_block').click(function(){
$('#content_en_block').toggle();
});
</script>
<% end -%>
+6 -5
View File
@@ -1,10 +1,11 @@
<h1>Editing pages</h1>
<% form_for @page, :url => admin_page_path(@page) do |f| %>
<h1><%= t('admin.editing_page') %></h1>
<%= form_for @page, :url => admin_page_path(@page) do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Update' %>
<%= f.submit t('update') %> <%= link_back %>
</p>
<% end %>
<% end %>
+4 -4
View File
@@ -1,11 +1,11 @@
<h1>New pages</h1>
<% form_for :page, :url => admin_pages_path do |f| %>
<h1><%= t('admin.new_page') %></h1>
<%= form_for :page, :url => admin_pages_path do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Create' %>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end %>
+5 -22
View File
@@ -1,28 +1,11 @@
<%= f.error_messages %>
<%= f.hidden_field :parent_name %>
<%= f.hidden_field :parent_id %>
<p>
<%= f.label :name, "Name" %>
<%= f.label :name, t('admin.name') %>
<%= f.text_field :name, :class => 'text' %>
</p>
<p id="content_zh_tw_block">
<%= f.label "content_zh_tw", "Content (zh_tw)" %>
<%= f.text_area "content_zh_tw", :size => '100x30' %>
<p>
<%= f.label "content", t('admin.content') %>
<%= f.text_area "content", :size => '100x30' %>
</p>
<p><a href="#" id="toggle_content_en_block">Edit english</a></p>
<p id="content_en_block">
<%= f.label "content_en", "Content (en)" %>
<%= f.text_area "content_en", :size => '100x30' %>
</p>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
$('#content_en_block').hide();
$('#toggle_content_en_block').click(function(){
$('#content_en_block').toggle();
});
</script>
<% end -%>
+4 -4
View File
@@ -1,11 +1,11 @@
<h1>Editing snippets</h1>
<h1><%= t('admin.editing_snippet') %></h1>
<% form_for @snippet, :url => admin_snippet_path(@snippet) do |f| %>
<%= form_for @snippet, :url => admin_snippet_path(@snippet) do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Update' %>
<%= f.submit 'Update' %> <%= link_back %>
</p>
<% end %>
<% end %>
+3 -3
View File
@@ -1,4 +1,4 @@
<h1>New snippets</h1>
<h1><%= t('admin.new_snippet') %></h1>
<% form_for :snippet, :url => admin_snippets_path do |f| %>
<%= f.error_messages %>
@@ -6,6 +6,6 @@
<%= render :partial => "form", :locals => { :f => f } %>
<p>
<%= f.submit 'Create' %>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end %>
<% end %>
@@ -0,0 +1 @@
<a href="#" class="edit"><%= t(:edit) %></a> | <a href="#" class="hide"><%= t(:hide) %></a>
@@ -0,0 +1,16 @@
<table>
<tr>
<th><%= t('admin.key') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
<% @language_i18n_variables.each do |var| %>
<tr>
<td><%= var.key %></td>
<% @site_valid_locales.each do |locale| %>
<td><%= text_field_tag "i18n_variables[#{var.id}][#{locale}]", var[locale] %></td>
<% end %>
</tr>
<% end %>
</table>
@@ -0,0 +1,34 @@
<% @vars = @i18n_variables.inject([]) do |result, var|
result << var if var.parent_id.to_s.eql?(edit_user_attribute_model.id.to_s)
result
end %>
<fieldset>
<legend>
<%= edit_user_attribute_model.key %>
<%#= render :partial => 'action_bar' %>
</legend>
<table>
<tr>
<th><%= t('admin.key') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
<tr>
<td><%= edit_user_attribute_model.key %></td>
<% @site_valid_locales.each do |locale| %>
<td><%= text_field_tag "i18n_variables[#{edit_user_attribute_model.id}][#{locale}]", edit_user_attribute_model[locale] %></td>
<% end %>
</tr>
<% @vars.each do |var| %>
<tr>
<td><%= var.key %></td>
<% @site_valid_locales.each do |locale| %>
<td><%= text_field_tag "i18n_variables[#{var.id}][#{locale}]", var[locale] %></td>
<% end %>
</tr>
<% end %>
</table>
</fieldset>
@@ -0,0 +1,16 @@
<table>
<tr>
<th><%= t('admin.key') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
<% @language_i18n_variables.each do |var| %>
<tr>
<td><%= var.key %></td>
<% @site_valid_locales.each do |locale| %>
<td><%= var[locale] %></td>
<% end %>
</tr>
<% end %>
</table>
@@ -0,0 +1,34 @@
<% @vars = @i18n_variables.inject([]) do |result, var|
result << var if var.parent_id.to_s.eql?(user_attribute_model.id.to_s)
result
end %>
<fieldset>
<legend>
<%= user_attribute_model.key %>
<%#= render :partial => 'action_bar' %>
</legend>
<table>
<tr>
<th><%= t('admin.key') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
<tr>
<td><%= user_attribute_model.key %></td>
<% @site_valid_locales.each do |locale| %>
<td><%= user_attribute_model[locale] %></td>
<% end %>
</tr>
<% @vars.each do |var| %>
<tr>
<td><%= var.key %></td>
<% @site_valid_locales.each do |locale| %>
<td><%= var[locale] %></td>
<% end %>
</tr>
<% end %>
</table>
</fieldset>
@@ -0,0 +1,25 @@
<%= form_tag admin_translation_path('all'), :method => :put do %>
<% if @language_i18n_variables.size > 0 %>
<fieldset>
<legend>
<%= t('admin.language') %>
<%#= render :partial => 'action_bar' %>
</legend>
<div><%= render :partial => 'edit_language' %></div>
</fieldset>
<% end %>
<% if @user_attribute_model_i18n_variables.size > 0 %>
<fieldset>
<legend>
<%= t('admin.user_attribute') %>
<%#= render :partial => 'action_bar' %>
</legend>
<div><%= render :partial => 'edit_user_attribute_model', :collection => @user_attribute_model_i18n_variables %></div>
</fieldset>
<% end %>
<%= submit_tag t('update') %> <%= link_back %>
<% end %>
@@ -0,0 +1,69 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t(:edit), edit_admin_translation_path('all'), :class => 'button positive' %></li>
<li>
<%= t('admin.add_language') %>:
<%= form_tag admin_translation_path('add'), :method => :put do %>
<%= text_field_tag 'language', '', :style => "width:100px" %>
<%= submit_tag t(:add) %>
<% end %>
</li>
<li>
<%= t('admin.enable_language') %>:
<%= form_tag admin_translation_path('enable'), :method => :put do %>
<%= select_tag 'enable_language', options_for_select(@site_valid_locales - @site_in_use_locales), :style => "width:100px" %>
<%= submit_tag t(:enable) %>
<% end %>
</li>
<li>
<%= t('admin.disable_language') %>:
<%= form_tag admin_translation_path('disable'), :method => :put do %>
<%= select_tag 'disable_language', options_for_select(@site_in_use_locales), :style => "width:100px" %>
<%= submit_tag t(:disable) %>
<% end %>
</li>
<li>
<%= t('admin.delete_language') %>:
<%= form_tag admin_translation_path('delete'), :method => :put do %>
<%= select_tag 'delete_language', options_for_select(@site_valid_locales), :style => "width:100px" %>
<%= submit_tag t(:delete), :confirm => t('sure?') %>
<% end %>
</li>
</ul>
<% end -%>
<% if @language_i18n_variables.size > 0 %>
<fieldset>
<legend>
<%= t('admin.language') %>
<%#= render :partial => 'action_bar' %>
</legend>
<div><%= render :partial => 'language' %></div>
</fieldset>
<% end %>
<% if @user_attribute_model_i18n_variables.size > 0 %>
<fieldset>
<legend>
<%= t('admin.user_attribute') %>
<%#= render :partial => 'action_bar' %>
</legend>
<div><%= render :partial => 'user_attribute_model', :collection => @user_attribute_model_i18n_variables %></div>
</fieldset>
<% end %>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
$('div a.hide').live( "click", function(){
$(this).parent().next().hide();
$(this).replaceWith("<a href='#' class='show'><%= t(:show) %></a>");
});
$('div a.show').live( "click", function(){
$(this).parent().next().show();
$(this).replaceWith("<a href='#' class='hide'><%= t(:hide) %></a>");
});
</script>
<% end -%>
@@ -0,0 +1,30 @@
<%= fields_for 'user_attribute_model[attribute_attr_models][]', attribute_attr_model, :index => nil do |f| %>
<tr>
<td><%= attribute_attr_model.new_record? ? (f.text_field :key, {:style => "width:130px"}) : attribute_attr_model.key %></td>
<td class='select_mulitlingual' style='text-align:center'>
<%= check_box_tag "locale[]", value = '', attribute_attr_model.locale.nil? ? true : attribute_attr_model.locale %>
<%= hidden_field_tag "user_attribute_model[attribute_attr_models][][locale]", attribute_attr_model.locale.nil? ? true : attribute_attr_model.locale %>
</td>
<% @site_valid_locales.each do |locale| %>
<td><%= text_field_tag "user_attribute_model[attribute_attr_models][][i18n_variable][#{locale}]", (attribute_attr_model.i18n_variable[locale] rescue nil), :style => "width:130px" %></td>
<% end %>
<td class='select_type'>
<%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %>
<div <%= attribute_attr_model[:markup].eql?('select') ? nil : "style='display:none'"%>>
<%= t('admin.options') %>:
<%= text_field_tag "user_attribute_model[attribute_attr_models][][select_options]", attribute_attr_model.select_options, :style => "width:130px" %>
</div>
</td>
<td>
<% if attribute_attr_model.new_record? %>
<a href="#" class="remove">(<%= t(:delete) %>)</a>
<% else %>
<a href="#" class="remove_existing_record">(<%= t(:delete) %>)</a>
<%= hidden_field_tag "user_attribute_model[attribute_attr_models][][should_destroy]", nil , :class => 'should_destroy' %>
<%= f.hidden_field :id %>
<% end %>
</td>
</tr>
<% end %>
@@ -0,0 +1,73 @@
<table>
<tr>
<th><%= t('admin.key') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
<tr>
<td><%= is_new ? (f.text_field :key, {:style => "width:130px"}) : @user_attribute_model.key %></td>
<% @site_valid_locales.each do |locale| %>
<td>
<%= text_field_tag "user_attribute_model[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :style => "width:130px" %>
</td>
<% end %>
</tr>
</table>
<fieldset id='field_set_attribute_attrs'>
<legend>
<%= t('admin.attributes')%>
</legend>
<table id='attribute_attrs'>
<tr>
<th><%= t('admin.key') %></th>
<th><%= t('admin.multilingual') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
<th><%= t('admin.type')%></th>
<th></th>
</tr>
<%= render :partial => 'attribute_attr_model', :collection => @user_attribute_model.attribute_attr_models %>
</table>
<a href="#" class="add">(<%= t(:add) %>)</a>
</fieldset>
<% content_for :page_specific_javascript do %>
<script type="text/javascript" charset="utf-8">
$('#field_set_attribute_attrs a.remove').live('click', function(){
$(this).parent().parent().remove();
});
$('#field_set_attribute_attrs a.add').click(function(){
$('#attribute_attrs').append("<%= escape_javascript(render(:partial => 'attribute_attr_model', :object => @user_attribute_model.attribute_attr_models.build)) %>");
});
$('#field_set_attribute_attrs a.remove_existing_record').click(function(){
$(this).next('.should_destroy').attr('value', 1);
$(this).parent().parent().hide();
});
$('.select_mulitlingual input').live('click', function(){
$(this).next().attr('value', this.checked);
});
$('.select_type select').live('change', function(){
if(this.value == 'select')
{
$(this).next().show();
}
else
{
$(this).next().hide();
}
});
</script>
<% end -%>
@@ -0,0 +1,19 @@
<h1><%= t('admin.editing_user_attribute') %>: <%= @user_attribute_model.key %></h1>
<fieldset>
<legend>
<%= t('admin.user_attribute')%>
</legend>
<%= form_for @user_attribute_model, :url => admin_user_attribute_model_path(@user_attribute_model) do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f, :is_new => false } %>
<p>
<%= f.submit t('update') %> <%= link_back %>
</p>
<% end -%>
</fieldset>
@@ -0,0 +1,26 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('admin.new_user_attribute'), new_admin_user_attribute_model_path, :class => 'button positive' %></li>
</ul>
<% end -%>
<h1><%= t('admin.list_user_attributes') %></h1>
<table>
<tr>
<th><%= t('admin.attribute') %></th>
<th><%= t('admin.key') %></th>
<th><%= t('admin.action') %></th>
</tr>
<% @user_attribute_models.each do |user_attribute_model| %>
<tr>
<td><%= user_attribute_model.i18n_variable[I18n.locale] %></td>
<td><%= user_attribute_model.key %></td>
<td>
<%= link_to t(:edit), edit_admin_user_attribute_model_path(user_attribute_model) %> |
<%= link_to t(:delete), admin_user_attribute_model_path(user_attribute_model), :confirm => t('sure?'), :method => :delete %>
</td>
</tr>
<% end %>
</table>
@@ -0,0 +1,19 @@
<h1><%= t('admin.new_user_attribute') %></h1>
<fieldset id='field_set_attribute_attrs'>
<legend>
<%= t('admin.user_attribute')%>
</legend>
<%= form_for @user_attribute_model, :url => admin_user_attribute_models_path do |f| %>
<%= f.error_messages %>
<%= render :partial => "form", :locals => { :f => f, :is_new => true } %>
<p>
<%= f.submit t('create') %> <%= link_back %>
</p>
<% end -%>
</fieldset>
@@ -0,0 +1,9 @@
<% if user_signed_in? %>
<li>
<%= link_to('Logout', destroy_user_session_path) %>
</li>
<% else %>
<li>
<%= link_to('Login', new_user_session_path) %>
</li>
<% end %>
@@ -0,0 +1,9 @@
<% if user_signed_in? %>
<li>
<%= link_to('Edit registration', edit_user_registration_path) %>
</li>
<% else %>
<li>
<%= link_to('Register', new_user_registration_path) %>
</li>
<% end %>
+7
View File
@@ -0,0 +1,7 @@
<%= raw(VALID_LOCALES.map{ |locale|
if I18n.locale.to_s.eql?(locale)
t(:_locale, :locale => locale)
else
link_to t(:_locale, :locale => locale), params.merge({:locale => locale})
end
}.join(' | ')) %>
+19 -8
View File
@@ -5,7 +5,7 @@
<title>R4</title>
<link rel="shortcut icon" href="/favicon.ico">
<%= yield :page_specific_link %>
<%= stylesheet_link_tag "easy", "main", :media => "screen, projection" %>
<%= stylesheet_link_tag "easy", "main", "devise", :media => "screen, projection" %>
<%= stylesheet_link_tag "easyprint", :media => "print" %>
<!--[if IE]>
<%= stylesheet_link_tag "ie", :media => "screen, projection" %>
@@ -15,16 +15,27 @@
</head>
<body>
<div id="container">
<div id="banner_link" style='text-align:right'>
<ul class="hmenu">
<li>
<%= render 'layouts/lang_menu' %>
</li>
<%= render 'devise/menu/login_items' %>
</ul>
</div>
<div id="header">
<h1>RulingSite Admin</h1>
<h1>RulingSite <%= t('admin.admin') %></h1>
<ul id="nav">
<li><%= link_to t(:home, :scope => :admin), root_path %></li>
<li><%= link_to t(:item, :scope => :admin), admin_items_path %></li>
<li><%= link_to t(:layout, :scope => :admin), admin_layouts_path %></li>
<li><%= link_to t(:asset, :scope => :admin), admin_assets_path %></li>
<li><%= link_to t(:user_attribute, :scope => :admin), admin_user_attributes_path %></li>
<li><%= link_to t('homepage'), root_path %></li>
<li><%= link_to t('admin.item'), admin_items_path %></li>
<li><%= link_to t('admin.layout'), admin_layouts_path %></li>
<li><%= link_to t('admin.asset'), admin_assets_path %></li>
<li><%= link_to t('admin.user_attribute'), admin_user_attribute_models_path %></li>
<li><%= link_to t('admin.translation'), admin_translations_path %></li>
</ul>
</div>
@@ -46,4 +57,4 @@
"application", :cache => 'all' %>
<%= yield :page_specific_javascript %>
</body>
</html>
</html>
+47
View File
@@ -0,0 +1,47 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>R4</title>
<link rel="shortcut icon" href="/favicon.ico">
<%= yield :page_specific_link %>
<%= stylesheet_link_tag "easy", "main", "devise", :media => "screen, projection" %>
<%= stylesheet_link_tag "easyprint", :media => "print" %>
<!--[if IE]>
<%= stylesheet_link_tag "ie", :media => "screen, projection" %>
<![endif]-->
<%= yield :page_specific_css %>
<%= csrf_meta_tag %>
</head>
<body>
<div id="container">
<ul class="hmenu">
<%= render 'devise/menu/registration_items' %>
<%= render 'devise/menu/login_items' %>
</ul>
<div id="header">
<h1>RulingSite</h1>
</div>
<div class="content">
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<div class="main"><%= yield %></div>
<div class="secondary"><%= yield :secondary %></div>
<div class="tertiary"><%= yield :tertiary %></div>
</div>
<div id="footer">
<p>Rulingcom</p>
</div>
</div>
<%#= javascript_include_tag "jquery",
"jquery-ui",
"rails",
"easy",
"application", :cache => 'all' %>
<%= yield :page_specific_javascript %>
</body>
</html>
+14 -4
View File
@@ -5,7 +5,7 @@
<title>R4</title>
<link rel="shortcut icon" href="/favicon.ico">
<%= yield :page_specific_link %>
<%= stylesheet_link_tag "easy", "main", :media => "screen, projection" %>
<%= stylesheet_link_tag "easy", "main", "devise", :media => "screen, projection" %>
<%= stylesheet_link_tag "easyprint", :media => "print" %>
<!--[if IE]>
<%= stylesheet_link_tag "ie", :media => "screen, projection" %>
@@ -15,13 +15,23 @@
</head>
<body>
<div id="container">
<div id="banner_link" style='text-align:right'>
<ul class="hmenu">
<li>
<%= render 'layouts/lang_menu' %>
</li>
<%= render 'devise/menu/login_items' %>
</ul>
</div>
<div id="header">
<h1>RulingSite Panel</h1>
<ul id="nav">
<li><%= link_to t(:home, :scope => :panel), root_path %></li>
<li><%= link_to t(:users, :scope => :panel), panel_users_path %></li>
<li><%= link_to t('panel.home'), root_path %></li>
<li><%= link_to t('panel.user'), panel_users_path %></li>
</ul>
</div>
@@ -43,4 +53,4 @@
"application", :cache => 'all' %>
<%= yield :page_specific_javascript %>
</body>
</html>
</html>
@@ -0,0 +1,25 @@
<%= fields_for 'user[user_attributes][attribute_attrs]', attribute_attr, :index => nil do |f| %>
<%#= f.hidden_field :id unless attribute_attr.new_record? %>
<% if attr["locale"] %>
<p>
<%#= f.hidden_field :key, :value => attr["key"] %>
<% if attr["markup"] == "text_field" %>
<% @site_valid_locales.each do |locale| %>
<%= f.label attr.i18n_variable[locale] %>
<%= text_field_tag "user[user_attributes][attribute_attrs][i18n_user][#{locale}]", (attribute_attr.i18n_user[locale] rescue nil) %>
<% end -%>
<% elsif attr["markup"] == "select" %>
<%= f.select "#{attr["key"]}_#{I18n.locale}", attr["options_#{I18n.locale}"].to_a %>
<% end -%>
</p>
<% else %>
<p>
<%= f.label attr["name"] %>
<% if attr["markup"] == "text_field" %>
<%= f.text_field "#{attr["key"]}" %>
<% elsif attr["markup"] == "select" %>
<%= f.select "#{attr["key"]}", attr["options"].to_a %>
<% end -%>
</p>
<% end -%>
<% end %>
+19 -38
View File
@@ -1,47 +1,28 @@
<div id="select_user_attributes">
<% @user_attributes.each do |ua| %>
<%= check_box_tag "user[use_attributes][]", ua.key, @user.use_attributes.include?(ua.key) %> <%= ua.name %>
<% end -%>
<%= hidden_field_tag 'user[use_attributes][]','' %>
<% @user_attribute_models.each do |ua| %>
<%= check_box_tag "user[active_attributes][]", ua.key, (@user.active_attributes.include?(ua.key) rescue false) %> <%= ua.i18n_variable[locale] %>
<% end -%>
<%= hidden_field_tag 'user[active_attributes][]', '' %>
</div>
<div>
<p>
<%= f.label :email %>
<%= f.text_field :email %>
</p>
<label><%= t('panel.my_avatar') %></label>
<%= image_tag(@user.avatar.thumb.url) if @user.avatar? %>
<%= file_field_tag 'file' %>
<%= hidden_field_tag :avatar_cache %>
</div>
<% @user_attributes.each do |ua| %>
<div id="attribute_<%= ua.key %>"<%= raw(' style="display: none;"') unless @user.use_attributes.include?(ua.key) %>>
<h3><%= ua.name %></h3>
<% ua.attrs.each do |attr| %>
<% if attr["locale"] %>
<p>
<%= f.label attr["name_#{I18n.locale}"] %>
<% if attr["type"] == "text_field" %>
<% VALID_LOCALES.each do |locale| %>
<%= f.text_field "#{ua.key}_#{attr["key"]}_#{locale}" %>(<%= locale %>)
<% end -%>
<% elsif attr["type"] == "select" %>
<%= f.select "#{ua.key}_#{attr["key"]}_#{I18n.locale}", attr["options_#{I18n.locale}"].to_a %>
<% end -%>
</p>
<% else %>
<p>
<%= f.label attr["name"] %>
<% if attr["type"] == "text_field" %>
<%= f.text_field "#{ua.key}_#{attr["key"]}" %>
<% elsif attr["type"] == "select" %>
<%= f.select "#{ua.key}_#{attr["key"]}", attr["options"].to_a %>
<% end -%>
</p>
<% end -%>
<% end -%>
<div>
<p>
<%= f.label :email %>
<%= f.text_field :email %>
</p>
</div>
<% @user_attribute_models.each do |ua| %>
<%= render :partial => 'user_attribute',
:object => (@user.user_attributes.detect {|u| u.key == ua.key } || @user.user_attributes.build),
:locals => {:ua => ua} %>
<% end -%>
<% content_for :page_specific_javascript do %>
@@ -52,4 +33,4 @@
});
});
</script>
<% end -%>
<% end -%>
@@ -0,0 +1,42 @@
<fieldset id="attribute_<%= ua.key %>"<%= raw(' style="display: none;"') unless (@user.active_attributes.include?(ua.key) rescue nil) %>>
<%= fields_for 'user[user_attributes]', user_attribute, :index => nil do |f| %>
<legend><%= ua.i18n_variable[I18n.locale] %></legend>
<%= f.hidden_field :key, :value => ua.key %>
<%= f.hidden_field :id unless user_attribute.new_record? %>
<table>
<tr>
<th><%= t('admin.attribute') %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
<% ua.attribute_attr_models.each do |attr| %>
<tr>
<td><%= attr.i18n_variable[I18n.locale] %></td>
<% if attr["locale"] && attr["markup"] == 'text_field' %>
<% @site_valid_locales.each do |locale| %>
<td>
<%= text_field_tag "user[user_attributes][][#{attr.key}_#{locale}]", (user_attribute["#{attr.key}_#{locale}"] rescue nil) %>
</td>
<% end -%>
<% else %>
<td colspan=<%= @site_valid_locales.size %>>
<% if attr["markup"] == "text_field" %>
<%= text_field_tag "user[user_attributes][][#{attr.key}]", (user_attribute[attr.key] rescue nil) %>
<% elsif attr["markup"] == "select" %>
<%= select_tag "user[user_attributes][][#{attr.key}]", options_for_select(attr["options"], user_attribute[attr.key]) %>
<% end -%>
</td>
<% end -%>
</tr>
<% end %>
</table>
<% end %>
</fieldset>
+4 -5
View File
@@ -4,15 +4,14 @@
</ul>
<% end -%>
<h1>Users panel</h1>
<% form_for @user, :url => panel_user_path(@user) do |f| %>
<h1><%= t('panel.user_panel') %></h1>
<%= form_for @user, :url => panel_user_path(@user), :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :locals => { :f => f } %>
<p>
<%= f.submit %>
<%= f.submit t(:update) %> <%= link_back %>
</p>
<% end -%>
+11 -12
View File
@@ -1,29 +1,28 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t(:new_user, :scope => :panel), new_panel_user_path, :class => 'button positive' %></li>
<li><%= link_to t('panel.new_user'), new_panel_user_path, :class => 'button positive' %></li>
</ul>
<% end -%>
<h1>Users panel</h1>
<h1><%= t('panel.list_users') %></h1>
<table>
<tr>
<th>Attrs</th>
<th>Name</th>
<th>Email</th>
<th>Action</th>
<th><%= t('panel.attributes') %></th>
<th><%= t('panel.name') %></th>
<th><%= t('panel.email') %></th>
<th><%= t('panel.action') %></th>
</tr>
<% @users.each do |user| %>
<tr>
<td><%= user.use_attributes.join(",") %></td>
<td><%= user.name %></td>
<td><%= user.get_attributes %></td>
<td><%= user[:name] %></td>
<td><%= user.email %></td>
<td>
<%= link_to 'Show', panel_user_path(user) %>
<%= link_to 'Edit', edit_panel_user_path(user) %> |
<%= link_to 'Destroy', panel_user_path(user), :method => :delete %></td>
<%= link_to t(:show), panel_user_path(user) %> |
<%= link_to t(:edit), edit_panel_user_path(user) %> |
<%= link_to t(:delete), panel_user_path(user), :method => :delete %></td>
</tr>
<% end %>
</table>
+11 -11
View File
@@ -1,18 +1,18 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t(:new_user, :scope => :panel), new_panel_user_path, :class => 'button positive' %></li>
</ul>
<ul class="list">
<li><%= link_to t(:new_user, :scope => :panel), new_panel_user_path, :class => 'button positive' %></li>
</ul>
<% end -%>
<h1>Users panel</h1>
<h1><%= t('panel.user_panel') %></h1>
<% form_for @user, :url => panel_users_path do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<p>
<%= f.submit %>
</p>
<%= form_for @user, :url => panel_users_path, :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :locals => { :f => f } %>
<p>
<%= f.submit t(:create) %> <%= link_back %>
</p>
<% end -%>
+25 -3
View File
@@ -4,7 +4,29 @@
</ul>
<% end -%>
<h1>Users panel</h1>
<h1><%= t('panel.user_panel') %></h1>
<%=h @user.name %>
<%=h @user.email %>
<%= image_tag(@user.avatar.thumb.url) rescue nil %>
<%= @user.email %>
<% @user.get_active_attribute_models.each do |am| %>
<% user_attribute = @user.get_attribute_from_model_key(am.key) %>
<fieldset>
<legend><%= am.i18n_variable[I18n.locale] %></legend>
<table>
<% am.attribute_attr_models.each do |attr| %>
<tr>
<td><%= attr.i18n_variable[I18n.locale] %></td>
<td>
<% if attr["locale"] && attr["markup"] == 'text_field' %>
<%= user_attribute["#{attr.key}_#{I18n.locale}"] %>
<% else %>
<%= user_attribute["#{attr.key}"] %>
<% end %>
</td>
</tr>
<% end %>
</table>
</fieldset>
<% end -%>
+1
View File
@@ -0,0 +1 @@
<%= @title %>
+1
View File
@@ -0,0 +1 @@
<%= @site.inspect %>