forked from publify/publify
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove helper method to use content_for
I think it's a better way to do this kind of stuff (build a header title and put it elsewhere than in yield place)
- Loading branch information
Yannick Francois
committed
Sep 26, 2013
1 parent
2cb2fb3
commit 0c38a45
Showing
33 changed files
with
737 additions
and
696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,54 @@ | ||
<% @page_heading = _('Manage articles') + content_tag(:div, link_to(_("New Article"), {:controller => 'content', :action => 'new'}, :id => 'dialog-link', :class => 'btn btn-info'), :class => 'pull-right') %> | ||
<% @page_heading_class = 'icon-articles' %> | ||
<%= form_remote_tag url: {action: 'index'}, method: :get, name: 'article', update: {:success => 'articleList'}, before: "Element.show('spinner')", complete: "Element.hide('spinner')" do %> | ||
<%- content_for :page_heading do %> | ||
<h2 class="icon-large icon-articles"><%= _("Manage articles") %></h2> | ||
<div class="pull-right"> | ||
<%= link_to(_("New Article"), {controller: 'content', action: 'new'}, id: 'dialog-link', class: 'btn btn-info')%> | ||
</div> | ||
|
||
<% if params[:search] and params[:search]['state'] %> | ||
<input type='hidden' name="search[state]" value="<%= params[:search]['state'] %>" > | ||
<% end %> | ||
<div> | ||
<span class='badge badge-inverse'> | ||
<%= link_to(_("All articles"), action: 'index') %> | ||
</span> | ||
<span class='badge badge-success'> | ||
<%= link_to(_("Published"), action: 'index', search: {state: 'published'}) %> | ||
</span> | ||
<span class='badge badge-important'> | ||
<%= link_to(_("Withdrawn"), action: 'index', search: {state: 'withdrawn'}) %> | ||
</span> | ||
<span class='badge badge-info'> | ||
<%= link_to(_("Drafts"), action: 'index', search: {state: 'drafts'}) %> | ||
</span> | ||
<span class='badge badge-warning'> | ||
<%= link_to(_("Publication pending"), action: 'index', search: {state: 'pending'}) %> | ||
</span> | ||
<div class='pull-right'> | ||
<span class="input-append"> | ||
<input id="search" type="text" name="search[searchstring]" class='large' /> | ||
<%= submit_tag(_("Search"), {:class => 'btn'}) %> | ||
<span id='spinner' style="display:none;"><%= image_tag('spinner.gif') %></span> | ||
<%= form_remote_tag url: {action: 'index'}, method: :get, name: 'article', update: {:success => 'articleList'}, before: "Element.show('spinner')", complete: "Element.hide('spinner')" do %> | ||
<% if params[:search] and params[:search]['state'] %> | ||
<input type='hidden' name="search[state]" value="<%= params[:search]['state'] %>" > | ||
<% end %> | ||
|
||
<div> | ||
<span class='badge badge-inverse'> | ||
<%= link_to(_("All articles"), action: 'index') %> | ||
</span> | ||
<span class='badge badge-success'> | ||
<%= link_to(_("Published"), action: 'index', search: {state: 'published'}) %> | ||
</span> | ||
<span class='badge badge-important'> | ||
<%= link_to(_("Withdrawn"), action: 'index', search: {state: 'withdrawn'}) %> | ||
</span> | ||
<span class='badge badge-info'> | ||
<%= link_to(_("Drafts"), action: 'index', search: {state: 'drafts'}) %> | ||
</span> | ||
<span class='badge badge-warning'> | ||
<%= link_to(_("Publication pending"), action: 'index', search: {state: 'pending'}) %> | ||
</span> | ||
<div class='pull-right'> | ||
<span class="input-append"> | ||
<input id="search" type="text" name="search[searchstring]" class='large' /> | ||
<%= submit_tag(_("Search"), {:class => 'btn'}) %> | ||
<span id='spinner' style="display:none;"><%= image_tag('spinner.gif') %></span> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<br class='clearleft' /> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr class='noborder'> | ||
<th><%= _("Title") %></th> | ||
<th><%= select_tag('search[category]', options_from_collection_for_select(Category.all, 'id', 'name'), {prompt: _("Select a category"), :class => 'span12'}) %></th> | ||
<th><%= select_tag('search[user_id]', options_from_collection_for_select(User.all, 'id', 'name'), {prompt: _("Select an author"), :class => 'span12'}) %></th> | ||
<th><%= select_tag('search[published_at]', options_for_select(Article.find_by_published_at), {prompt: _("Publication date"), :class => 'span12'}) %></th> | ||
<th><input type="submit" value='<%= _("Filter") %>' class='btn' /> | ||
</tr> | ||
</thead> | ||
<tbody id="articleList"> | ||
<%= render 'article_list', { :articles => @articles } -%> | ||
</tbody> | ||
</table> | ||
<%end%> | ||
<br class='clearleft' /> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr class='noborder'> | ||
<th><%= _("Title") %></th> | ||
<th><%= select_tag('search[category]', options_from_collection_for_select(Category.all, 'id', 'name'), {prompt: _("Select a category"), :class => 'span12'}) %></th> | ||
<th><%= select_tag('search[user_id]', options_from_collection_for_select(User.all, 'id', 'name'), {prompt: _("Select an author"), :class => 'span12'}) %></th> | ||
<th><%= select_tag('search[published_at]', options_for_select(Article.find_by_published_at), {prompt: _("Publication date"), :class => 'span12'}) %></th> | ||
<th><input type="submit" value='<%= _("Filter") %>' class='btn' /> | ||
</tr> | ||
</thead> | ||
<tbody id="articleList"> | ||
<%= render 'article_list', { :articles => @articles } -%> | ||
</tbody> | ||
</table> | ||
<%end%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,64 @@ | ||
<% @page_heading = _("Comments for %s", @article.title) %> | ||
<% @page_heading_class = 'icon-comment' %> | ||
<%- content_for :page_heading do %> | ||
<h2 class="icon-large icon-comment"><%= _("Comments for %s", @article.title) %></h2> | ||
<% end %> | ||
<% @link_to_new = link_to(_("Add a comment"), '#comment', {:id => 'dialog-link', :class => 'button'}) %> | ||
<%= form_tag({:action => 'bulkops'}) do %> | ||
<%= hidden_field 'article_id', @article.id %> | ||
<%= render 'button', { :position => 'top' } %> | ||
<%= hidden_field 'article_id', @article.id %> | ||
<%= render 'button', { :position => 'top' } %> | ||
|
||
<br class='clear' /> | ||
<table class='table table-stripped'> | ||
<thead> | ||
<tr class='noborder'> | ||
<th><input type="checkbox" name="checkall" id="checkall" onclick="check_all(this);"/></th> | ||
<th><%= _("Status")%></th> | ||
<th><%= _("Comment Author")%></th> | ||
<th><%= _("Comment")%></th> | ||
</tr> | ||
</thead> | ||
<%= render_void_table(@feedback.size, 5) %> | ||
<br class='clear' /> | ||
<table class='table table-stripped'> | ||
<thead> | ||
<tr class='noborder'> | ||
<th><input type="checkbox" name="checkall" id="checkall" onclick="check_all(this);"/></th> | ||
<th><%= _("Status")%></th> | ||
<th><%= _("Comment Author")%></th> | ||
<th><%= _("Comment")%></th> | ||
</tr> | ||
</thead> | ||
<%= render_void_table(@feedback.size, 5) %> | ||
<% @feedback.each do |comment| %> | ||
<%= render 'feedback', {:comment => comment} %> | ||
<% end %> | ||
</table> | ||
<% @feedback.each do |comment| %> | ||
<%= render 'feedback', {:comment => comment} %> | ||
<% end %> | ||
</table> | ||
<%end%> | ||
<%= form_tag :action => "create" do %> | ||
<%= hidden_field_tag('article_id', @article.id) %> | ||
<fieldset class='form-horizontal'> | ||
<legend><%= _("Add a comment")%></legend> | ||
<div class='control-group'> | ||
<label for="comment_author" class='control-label'><%= _("Author")%></label> | ||
<div class='controls'> | ||
<%= text_field 'comment', 'author', :class => 'medium' %> | ||
<%= hidden_field_tag('article_id', @article.id) %> | ||
<fieldset class='form-horizontal'> | ||
<legend><%= _("Add a comment")%></legend> | ||
<div class='control-group'> | ||
<label for="comment_author" class='control-label'><%= _("Author")%></label> | ||
<div class='controls'> | ||
<%= text_field 'comment', 'author', :class => 'medium' %> | ||
</div> | ||
</div> | ||
<div class='control-group'> | ||
<label for="comment_email" class='control-label'><%= _("Email")%></label> | ||
<div class='controls'> | ||
<%= text_field 'comment', 'email', :class => 'medium' %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='control-group'> | ||
<label for="comment_email" class='control-label'><%= _("Email")%></label> | ||
<div class='controls'> | ||
<%= text_field 'comment', 'email', :class => 'medium' %> | ||
<div class='control-group'> | ||
<label for="comment_url" class='control-label'><%= _("Url") %></label> | ||
<div class='controls'> | ||
<%= text_field 'comment', 'url', :class => 'medium' %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='control-group'> | ||
<label for="comment_url" class='control-label'><%= _("Url") %></label> | ||
<div class='controls'> | ||
<%= text_field 'comment', 'url', :class => 'medium' %> | ||
<div class='control-group'> | ||
<label for='comment_body' class='control-label'><%= _("Your comment") %></label> | ||
<div class='controls'> | ||
<script type="text/javascript">edToolbar('comment_body', '<%= current_user.default_text_filter.name %>');</script> | ||
<%= text_area 'comment', 'body', { :rows => '10', :class => 'span6'} %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='control-group'> | ||
<label for='comment_body' class='control-label'><%= _("Your comment") %></label> | ||
<div class='controls'> | ||
<script type="text/javascript">edToolbar('comment_body', '<%= current_user.default_text_filter.name %>');</script> | ||
<%= text_area 'comment', 'body', { :rows => '10', :class => 'span6'} %> | ||
<div class='form-actions'> | ||
<%= cancel_or_save %> | ||
</div> | ||
</div> | ||
<div class='form-actions'> | ||
<%= cancel_or_save %> | ||
</div> | ||
</fieldset> | ||
</fieldset> | ||
|
||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.