Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Geraud Puechaldou committed Aug 29, 2013
2 parents 15f84ca + 8d13f99 commit 19c7a48
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 25 deletions.
6 changes: 1 addition & 5 deletions app/helpers/admin/base_helper.rb
Expand Up @@ -76,10 +76,6 @@ def plugin_options(kind, blank = true)
blank ? r << [_("none"),''] : r
end

def alternate_class
@class = @class != '' ? '' : 'class="shade"'
end

def task_overview
content_tag :li, link_to(_('Back to list'), :action => 'index')
end
Expand Down Expand Up @@ -152,7 +148,7 @@ def render_macros(macros)
content_tag(:th, _('Tag'))
end
for macro in macros.sort_by { |f| f.short_name }
content_tag(:tr, {:class => alternate_class}) do
content_tag(:tr) do
content_tag(:td, macro_help_popup(macro, macro.display_name))
content_tag(:td, h(macro.description))
content_tag(:td, content_tag(:code, "&lt;#{h(macro.short_name)}&gt;"))
Expand Down
25 changes: 19 additions & 6 deletions app/helpers/admin/feedback_helper.rb
Expand Up @@ -8,12 +8,25 @@ def comment_class state

def show_feedback_actions(item, context='listing')
return if current_user.profile.label == "contributor"
content_tag(:small) do
[change_status(item, context),
content_tag(:small, link_to(_("Edit"), :controller => 'admin/feedback', :action => 'edit', :id => item.id)),
content_tag(:small, link_to(_("Delete"), {:controller => 'admin/feedback', :action => 'destroy', :id => item.id}, {:class => 'delete'})),
link_to(_("Show conversation"), :controller => 'admin/feedback', :action => 'article', :id => item.article_id)].join(" | ").html_safe
end
content_tag(:div, { :class => 'action', :style => '' }) do
[content_tag(:small, change_status(item, context)),
small_to_edit_comment(item),
small_to_delete_comment(item),
small_to_conversation(item)
].join(" | ").html_safe
end
end

def small_to_edit_comment(item)
content_tag(:small, link_to(_("Edit"), :controller => "admin/feedback", :action => 'edit', :id => item.id))
end

def small_to_delete_comment(item)
content_tag(:small, link_to(_("Delete"), {:controller => 'admin/feedback', :action => 'destroy', :id => item.id}, :class => 'delete'))
end

def small_to_conversation(item)
content_tag(:small, link_to(_("Show conversation"), :controller => 'admin/feedback', :action => 'article', :id => item.article_id))
end

def filter_link(text, filter='', style='')
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/categories/new.html.erb
Expand Up @@ -31,9 +31,9 @@
</thead>
<%= render_void_table(@categories.size, 4) %>
<% for category in @categories -%>
<tr <%= alternate_class -%> id="category_<%= category.id -%>">
<tr id="category_<%= category.id -%>">
<td>
<%= link_to_edit category.name, category %><br />
<%= link_to_edit category.name, category %>
<%= show_category_actions category %>
</td>
<td><%= h category.description %></td>
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/content/_article_list.html.erb
@@ -1,7 +1,7 @@
<%= render_empty_table(7) if @articles.empty? %>
<% for article in @articles %>
<tr <%= alternate_class %>>
<td class='article-title'>
<tr>
<td>
<strong><%= link_to_edit h(article.title), article %></strong>
<%= show_actions article %>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/dashboard/_publify_dev.html.erb
Expand Up @@ -10,7 +10,7 @@
<li class='alert'><%= _("Oh no, nothing new") %></li>
<% else %>
<% @publify_links.each do |link| -%>
<li <%= alternate_class %>>
<li>
<h5><%= link_to("#{link.title}</strong>".html_safe, link.link) %> <%= display_date_and_time(link.date) %></h5>
<p><%= link.description.strip_html.slice(0, 300) %>...</p>
<hr />
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/feedback/_feedback.html.erb
Expand Up @@ -16,7 +16,7 @@
<small><%= format_date_time comment.created_at %></small>
</div>
</td>
<td class='article-title'>
<td>
<%= comment.html(:all) %>
<div class='action'>
<%= show_feedback_actions comment %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/pages/_pages.html.erb
@@ -1,7 +1,7 @@
<%= render_void_table(@pages.size, 5) %>
<% for page in @pages %>
<tr <%= alternate_class %>>
<tr>
<td>
<%= link_to_edit_with_profiles page.title, page %>
<%= show_actions page %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/post_types/new.html.erb
Expand Up @@ -29,7 +29,7 @@
<td>read</td>
</tr>
<% for pt in @post_types -%>
<tr <%= alternate_class -%>>
<tr>
<td>
<%= link_to_edit pt.name, pt %><br />
<%= show_post_types_actions pt %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/redirects/new.html.erb
Expand Up @@ -25,7 +25,7 @@
</thead>
<%= render_void_table(@redirects.size, 2) %>
<% for redirect in @redirects %>
<tr <%= alternate_class %>>
<tr>
<td>
<%= link_to("#{redirect.to_url}", "#{redirect.to_url}") %>
<%= show_redirect_actions redirect %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/resources/_resource_list.html.erb
@@ -1,6 +1,6 @@
<%= render_void_table(@resources.size, 6) %>
<% for upload in @resources -%>
<tr <%= alternate_class -%>>
<tr>
<td>
<% if upload.mime =~ /image/ %>
<%= link_to upload.upload_url, rel: 'lightbox' do %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tags/new.html.erb
Expand Up @@ -23,7 +23,7 @@
</thead>
<%= render_void_table(@tags.size, 3) %>
<% for tag in @tags %>
<tr <%= alternate_class %>>
<tr>
<td>
<%= link_to_edit tag.display_name, tag %>
<%= show_tag_actions tag %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/index.html.erb
Expand Up @@ -13,7 +13,7 @@
</tr>
</thead>
<% for user in @users -%>
<tr <%= alternate_class %>>
<tr>
<td><%= link_to_edit user.login, user%></td>
<td> <%= user.nickname %></td>
<td><%= mail_to user.email, user.email%></td>
Expand Down
4 changes: 2 additions & 2 deletions public/stylesheets/administration_structure.css
Expand Up @@ -30,11 +30,11 @@ td small {
font-size: 11px;
}

td.article-title .action {
tr .action {
display: none;
}

td.article-title:hover .action {
tr:hover .action {
display: block;
}

Expand Down

0 comments on commit 19c7a48

Please sign in to comment.