Announcement modifications and tags

This commit is contained in:
Christophe Vilayphiou committed 2012-02-15 00:34:22 +08:00
1 parent f57e9f19f7
commit 3e70634add
38 files changed
+615 -143

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
<%= form_for :tag, :url => admin_tags_path, :remote => true, :html => {:id => 'tag_form'} do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
<% end %>
<%= f.hidden_field :module_app_id, :value => @module_app_id %>
<%= f.submit %>
<% end %>
+7
View File
@@ -0,0 +1,7 @@
<%= form_for tag, :url => admin_tag_path(tag), :remote => true do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
<% end %>
<%= f.hidden_field :module_app_id, :value => tag.module_app_id %>
<%= f.submit %>
<% end %>
+8
View File
@@ -0,0 +1,8 @@
<div id="<%= dom_id tag %>" >
<% @site_valid_locales.each do |locale| %>
<%= I18nVariable.from_locale(locale) %>:
<%= tag[locale] %>
<% end %>
<%= link_to t(:edit), edit_admin_tag_path(tag), :remote => true %>
<%= link_to t(:delete), admin_tag_path(tag), :confirm => t('sure?'), :method => :delete, :remote => true %>
</div>
+4
View File
@@ -0,0 +1,4 @@
$('#tag_form').each(function(){
this.reset();
});
$('#tags').append("<%= j render :partial => 'tag', :object => @tag %>")
+1
View File
@@ -0,0 +1 @@
$('#<%= dom_id @tag %>').html("<%= j render :partial => 'form', :locals => {:tag => @tag} %>")
+6
View File
@@ -0,0 +1,6 @@
<div id='tags'>
<%= render :partial => 'tag', :collection => @tags %>
</div>
-------------------------
<br/>
<%= render 'add' %>
+1
View File
@@ -0,0 +1 @@
$('#<%= dom_id @tag %>').html("<%= j render :partial => 'tag', :object => @tag %>")
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "First" page
- available local variables
url: url to the first page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="first">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
</span>
+8
View File
@@ -0,0 +1,8 @@
<%# Non-link tag that stands for skipped pages...
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page gap"><%= raw(t 'views.pagination.truncate') %></span>
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "Last" page
- available local variables
url: url to the last page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="last">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
</span>
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "Next" page
- available local variables
url: url to the next page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="next">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
</span>
+12
View File
@@ -0,0 +1,12 @@
<%# Link showing page number
- available local variables
page: a page object for "this" page
url: url to this page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page<%= ' current' if page.current? %>">
<%= link_to_unless page.current?, page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
</span>
+23
View File
@@ -0,0 +1,23 @@
<%# The container tag
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav class="pagination">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</nav>
<% end -%>
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "Previous" page
- available local variables
url: url to the previous page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="prev">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
</span>