Skip to content

Commit

Permalink
Some UI tweaking: adding a lovely icon at the beggining of page titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric de Villamil committed Aug 26, 2013
1 parent 7a88899 commit b482801
Show file tree
Hide file tree
Showing 34 changed files with 70 additions and 10 deletions.
4 changes: 4 additions & 0 deletions app/helpers/admin/base_helper.rb
Expand Up @@ -16,6 +16,10 @@ def subtabs_for(current_module)
def show_page_heading
return if @page_heading.nil? or @page_heading.blank?

unless @page_heading_class.nil? or @page_heading_class.blank?
@page_heading = content_tag(:i, "", class: "icon-large #{@page_heading_class}") + " " + @page_heading
end

content_tag(:div, {:class => 'page-header'}) do
content_tag(:h2, @page_heading.html_safe)
end
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/cache/index.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Cache') %>
<% @page_heading_class = 'icon-settings'%>

<p><%= _("To save resources Publify caches content in static files. Cache is cleared each time something gets published. You may however want to clear the cache yourself.") %></p>

Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/categories/new.html.erb
@@ -1,5 +1,5 @@
<% @page_heading = _("Categories") %>

<% @page_heading_class = 'icon-categories'%>
<div>
<div class='span4'>
<%= form_tag :action=>"edit", :id => @category.id do %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/content/_form.html.erb
Expand Up @@ -4,6 +4,7 @@
<div id="article_keywords_auto_complete" class="auto_complete"></div>

<h2 class='page-header'>
<i class='icon-large icon-article-new'></i>
<%= _("#{controller.action_name.to_s.capitalize} article") %>
<span class='pull-right'>
<span id='preview_link'><%= link_to(_("Preview"), {:controller => '/articles', :action => 'preview', :id => @article.id}, {:target => 'new', :class => 'btn'}) if @article.id %></span>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/content/index.html.erb
@@ -1,5 +1,5 @@
<% @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 %>
<% if params[:search] and params[:search]['state'] %>
Expand Down
1 change: 0 additions & 1 deletion app/views/admin/dashboard/_overview.html.erb
@@ -1,4 +1,3 @@
<h3><%= _("Welcome back, %s!", current_user.name ) -%></h3>
<div class='alert alert-info'>
<p>
<%= _("This place gives you a quick overview of what happens on your Publify blog and what you can do. Maybe will you want to %s", dashboard_action_links) %>
Expand Down
3 changes: 3 additions & 0 deletions app/views/admin/dashboard/index.html.erb
@@ -1,3 +1,6 @@
<% @page_heading = _("Welcome back, %s!", current_user.name ) %>
<% @page_heading_class = 'icon-dashboard'%>
<%= render "overview" %>

<div>
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/feedback/article.html.erb
@@ -1,4 +1,6 @@
<% @page_heading = _("Comments for %s", @article.title) %>
<% @page_heading_class = 'icon-comment' %>
<% @link_to_new = link_to(_("Add a comment"), '#comment', {:id => 'dialog-link', :class => 'button'}) %>
<%= form_tag({:action => 'bulkops'}) do %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/feedback/edit.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _("Comments for %s", link_to(h(@comment.article.title), :controller => '/admin/content', :action => 'edit', :id => @comment.article.id).html_safe).html_safe %>
<% @page_heading_class = 'icon-comment' %>
<%= form_tag :action => "update", :id => @comment.id do %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/feedback/index.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _("Feedback") %>
<% @page_heading_class = 'icon-comment' %>
<%= form_tag({:action => 'index'}, :method => :get, :class => 'form-inline') do %>
<div>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/notes/new.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Notes') %>
<% @page_heading_class = 'icon-notes' %>
<div>
<div class='span4'>
<%= form_tag :action=>"edit", :id => @note.id do %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/pages/_form.html.erb
Expand Up @@ -2,6 +2,7 @@
<input type="hidden" name="user_textfilter" id="user_textfilter" value="<%= current_user.text_filter_name %>" />

<h2 class='page-header'>
<i class='icon-large icon-page-new'></i>
<%= _("#{controller.action_name.to_s.capitalize} Page") %>
<span class='pull-right'>
<%= save( _("Publish")) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/pages/index.html.erb
@@ -1,5 +1,5 @@
<% @page_heading = _('Manage pages') + content_tag(:div, link_to(_("New Page"), {:controller => 'pages', :action => 'new'}, :id => 'dialog-link', :class => 'btn btn-info'), :class => 'pull-right') %>

<% @page_heading_class = 'icon-pages'%>
<table class='table table-striped'>
<thead>
<tr class='noborder'>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/post_types/new.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _("Post Types") %>
<% @page_heading_class = 'icon-articles-types' %>
<div>
<div class='span4'>
<%= error_messages_for 'post_type' %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/profiles/index.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Your profile') %>
<% @page_heading_class = 'icon-profile' %>
<%= form_tag :action=>"index", :id => @user.id do %>
<%= render :partial => "admin/users/form" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/redirects/new.html.erb
@@ -1,5 +1,5 @@
<% @page_heading = _("Redirects") %>

<% @page_heading_class = 'icon-redirect'%>
<div>
<div class='span4'>
<%= form_tag :action=>"edit", :id => @redirect.id do %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/resources/index.html.erb
@@ -1,5 +1,5 @@
<% @page_heading = _('Media library') %>
<% @page_heading_class = 'icon-resources' %>
<%= render 'upload' -%>

<table class="table table-striped">
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/seo/index.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Global settings') %>
<% @page_heading_class = 'icon-settings' %>
<%= error_messages_for 'blog' %>
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/seo/permalinks.html.erb
@@ -1,4 +1,6 @@
<% @page_heading = _('Permalinks') %>
<% @page_heading_class = 'icon-settings' %>
<%= error_messages_for 'blog' %>
<%= form_tag :action => 'permalinks' do %>
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/seo/titles.html.erb
@@ -1,4 +1,6 @@
<% @page_heading = _("Title settings")%>
<% @page_heading_class = 'icon-settings' %>
<%= error_messages_for 'blog' %>
<%= form_tag :action => 'update' do %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/settings/display.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Display settings') %>
<% @page_heading_class = 'icon-settings' %>
<%= form_tag :action => 'update' do %>

Expand Down
1 change: 1 addition & 0 deletions app/views/admin/settings/feedback.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Feedback settings') %>
<% @page_heading_class = 'icon-settings' %>
<%= form_tag :action => 'update' do %>

Expand Down
1 change: 1 addition & 0 deletions app/views/admin/settings/index.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('General settings') %>
<% @page_heading_class = 'icon-settings' %>
<%= form_tag :action => 'update' do %>

Expand Down
1 change: 1 addition & 0 deletions app/views/admin/settings/update_database.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Database migration') %>
<% @page_heading_class = 'icon-settings' %>

<div class='alert alert-message warning'>
<h3><%= _("Information")%></h3>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/settings/write.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Write') %>
<% @page_heading_class = 'icon-settings' %>
<%= form_tag :action => 'update' do %>

Expand Down
1 change: 1 addition & 0 deletions app/views/admin/sidebar/index.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Sidebar') %>
<% @page_heading_class = 'icon-sidebar' %>

<p class='help-block'><%= _("Drag and drop to change the sidebar items displayed on this blog. To remove items from the sidebar just click 'remove'. Changes are saved immediately, but not activated until you click the 'Publish changes' button")%>.</p>
<%= form_remote_tag(:url => {:action=>'publish',
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/tags/new.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Manage tags') %>
<% @page_heading_class = 'icon-tags' %>

<div>
<div class='span4'>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/themes/index.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Choose a theme') %>
<% @page_heading_class = 'icon-theme' %>
<% i = 0 %>
<% for theme in @themes %>
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/users/edit.html.erb
@@ -1,4 +1,5 @@
<% @page_heading = _('Edit User') %>
<% @page_heading_class = 'icon-user-add' %>
<%= form_tag :action=>"edit", :id => @user.id do %>
<%= render :partial => "form" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/index.html.erb
@@ -1,5 +1,5 @@
<% @page_heading = _('Users') + content_tag(:div, link_to(_("New User"), {:controller => 'users', :action => 'new'}, :id => 'dialog-link', :class => 'btn btn-info'), :class => 'pull-right') %>

<% @page_heading_class = 'icon-user' %>
<table class="table table-striped">
<thead>
<tr class='noborder'>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/new.html.erb
@@ -1,5 +1,5 @@
<% @page_heading = _('Add User') %>
<% @page_heading_class = 'icon-user-add' %>
<%= form_tag :action=>"new" do %>
<%= render :partial => "admin/users/form" %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/layouts/administration.html.erb
Expand Up @@ -88,7 +88,7 @@

<footer class='clearfix'>
<div class='span12'>
<%= link_to(this_blog.blog_name, this_blog.base_url) %> <%= _("is proudly powered by")%> Publify <%=h PUBLIFY_VERSION %>
<%= link_to(this_blog.blog_name, this_blog.base_url) %> <%= _("is proudly powered by")%> Publify <%=h PUBLIFY_VERSION %> – Icons courtesy of <a href='http://glyphicons.com/'>Glyphicons</a>
</div>
</footer>
</body>
Expand Down
Binary file added public/images/admin/glyphicons-large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 31 additions & 1 deletion public/stylesheets/administration_structure.css
Expand Up @@ -201,4 +201,34 @@ a.delete:focus {

.icon-profile {
background-position: -240px 0;
}
}

.icon-large {
background-image: url("../images/admin/glyphicons-large.png");
background-position: 24px 24px;
background-repeat: no-repeat;
display: inline-block;
height: 28px;
line-height: 28px;
vertical-align: text-bottom;
width: 28px;
}

.icon-large.icon-dashboard{ background-position: 0 -670px; }
.icon-large.icon-articles{ background-position: 0 -985px; }
.icon-large.icon-article-new{ background-position: -138px -1666px; }
.icon-large.icon-comment{ background-position: -230px -102px; }
.icon-large.icon-categories{ background-position: -46px -212px; }
.icon-large.icon-tags{ background-position: -46px -212px; }
.icon-large.icon-articles-types{ background-position: 0 -780px; }
.icon-large.icon-redirect{ background-position: -46px -852px; }
.icon-large.icon-notes{ background-position: -46px -1829px; }
.icon-large.icon-pages{ background-position: -92px -853px; }
.icon-large.icon-page-new{ background-position: -138px -1666px; }
.icon-large.icon-theme{ background-position: -1px -1704px; }
.icon-large.icon-sidebar{ background-position: 0 -780px; }
.icon-large.icon-profile{ background-position: 0 -104px; }
.icon-large.icon-user{ background-position: 0 -104px; }
.icon-large.icon-user-add{ background-position: 0 -200px; }
.icon-large.icon-settings{ background-position: 0 -780px; }
.icon-large.icon-resources{ background-position: -92px -1332px; }

0 comments on commit b482801

Please sign in to comment.