Adds styles for new admin's sections

This commit is contained in:
Alberto Garcia Cabeza
2015-08-18 13:48:37 +02:00
parent ad1833b918
commit 33875daef6
14 changed files with 155 additions and 77 deletions

View File

@@ -3,6 +3,7 @@
// 01. Global styles // 01. Global styles
// 02. Sidebar // 02. Sidebar
// 03. List elements // 03. List elements
// 04. Stats
// //
// 01. Global styles // 01. Global styles
@@ -16,6 +17,11 @@ body.admin {
font-weight: bold; font-weight: bold;
} }
h3 {
font-size: rem-calc(14);
font-weight: normal;
}
form { form {
.button { .button {
margin-top: 0; margin-top: 0;
@@ -26,15 +32,6 @@ body.admin {
margin-right: rem-calc(12); margin-right: rem-calc(12);
} }
.button.create {
background: #EFD90C;
color: $text;
&:hover {
background: #BDAB09;
}
}
.admin-content { .admin-content {
margin-top: rem-calc(24); margin-top: rem-calc(24);
} }
@@ -105,6 +102,7 @@ body.admin {
.admin-list { .admin-list {
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
margin-bottom: rem-calc(48);
form { form {
clear: both; clear: both;
@@ -143,11 +141,29 @@ body.admin {
.delete { .delete {
border-bottom: 1px dotted #CF2A0E; border-bottom: 1px dotted #CF2A0E;
color: #F04124; color: #F04124;
font-size: rem-calc(11); font-size: rem-calc(12);
margin-right: rem-calc(12);
&:hover, &:active, &:focus { &:hover, &:active, &:focus {
border: 0; border: 0;
color: #cf2a0e; color: #cf2a0e;
} }
} }
.level {
font-size: rem-calc(12);
}
.official {
background-color: #e7e7e7;
border-radius: rem-calc(3);
font-size: rem-calc(12);
font-weight: normal;
padding: rem-calc(6) rem-calc(12);
}
// 04. Stats
// - - - - - - - - - - - - - - - - - - - - - - - - -
.stats {
background: white;
}

View File

@@ -366,10 +366,6 @@
color: $text-medium; color: $text-medium;
} }
.bullet {
color: $border;
}
p { p {
font-size: rem-calc(14); font-size: rem-calc(14);
line-height: $line-height; line-height: $line-height;
@@ -431,6 +427,10 @@
} }
} }
.bullet {
color: $border;
}
// 04. New // 04. New
// - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@@ -11,6 +11,7 @@
// 09. Alerts // 09. Alerts
// 10. User account // 10. User account
// 11. Filters // 11. Filters
// 12. Official levels
// //
// 01. Variables // 01. Variables
@@ -618,3 +619,30 @@ form {
} }
} }
} }
// 12. Officials levels
// - - - - - - - - - - - - - - - - - - - - - - - - -
.level-0 {
background: $level-0;
}
.level-1 {
background: $level-1;
}
.level-2 {
background: $level-2;
}
.level-3 {
background: $level-3;
}
.level-4 {
background: $level-4;
}
.level-5 {
background: $level-5;
}

View File

@@ -38,6 +38,13 @@ $votes-unlike-act: #BD6A6A;
$check: #46DB91; $check: #46DB91;
$level-0: #F08A24;
$level-1: #43AC6A;
$level-2: #43AC6A;
$level-3: #43AC6A;
$level-4: #43AC6A;
$level-5: #43AC6A;
// 03. Forms // 03. Forms
// - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@@ -27,21 +27,21 @@
<li <%= 'class=active' if controller_name == 'officials' %>> <li <%= 'class=active' if controller_name == 'officials' %>>
<%= link_to admin_officials_path do %> <%= link_to admin_officials_path do %>
<i class="icon-chat-bubble-two"></i> <i class="icon-user"></i>
<%= t('admin.menu.officials') %> <%= t('admin.menu.officials') %>
<% end %> <% end %>
</li> </li>
<li <%= 'class=active' if controller_name == 'settings' %>> <li <%= 'class=active' if controller_name == 'settings' %>>
<%= link_to admin_settings_path do %> <%= link_to admin_settings_path do %>
<i class="icon-chat-bubble-two"></i> <i class="icon-settings"></i>
<%= t('admin.menu.settings') %> <%= t('admin.menu.settings') %>
<% end %> <% end %>
</li> </li>
<li <%= 'class=active' if controller_name == 'stats' %>> <li <%= 'class=active' if controller_name == 'stats' %>>
<%= link_to stats_path do %> <%= link_to stats_path do %>
<i class="icon-chat-bubble-two"></i> <i class="icon-stats"></i>
<%= t('admin.menu.stats') %> <%= t('admin.menu.stats') %>
<% end %> <% end %>
</li> </li>

View File

@@ -10,7 +10,7 @@
<div class="small-12 medium-2 column"> <div class="small-12 medium-2 column">
<%= link_to t("admin.actions.restore"), restore_admin_comment_path(comment), <%= link_to t("admin.actions.restore"), restore_admin_comment_path(comment),
method: :put, data: { confirm: t("admin.actions.confirm") }, method: :put, data: { confirm: t("admin.actions.confirm") },
class: "button radius tiny success right" %> class: "button radius small success right" %>
</div> </div>
</div> </div>
</li> </li>

View File

@@ -1,14 +1,15 @@
<h1><%= t("admin.officials.edit.title") %></h1> <h2>
<%= t("admin.officials.edit.title") %>
<span class="official right"><strong><%= @user.name %></strong> (<%= @user.email %>)</span>
</h2>
<%= @user.name %> (<%= @user.email %>)
<%= form_for @user, url: admin_official_path(@user) do |f| %> <%= form_for @user, url: admin_official_path(@user) do |f| %>
<%= f.text_field :official_position %> <%= f.text_field :official_position %>
<%= f.select :official_level, official_level_options %> <%= f.select :official_level, official_level_options %>
<%= link_to t("admin.officials.edit.back"), admin_officials_path, class: "button radius small secondary" %>
<%= f.submit %> <%= f.submit %>
<% if @user.official? %> <% if @user.official? %>
<%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'button tiny alert' %> <%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'delete' %>
<% else %>
<%= link_to t("admin.officials.edit.cancel"), admin_officials_path, class: 'button tiny alert' %>
<% end %> <% end %>
<% end %> <% end %>

View File

@@ -1,25 +1,32 @@
<h1><%= t("admin.officials.index.title") %></h1> <h2><%= t("admin.officials.index.title") %></h2>
<div>
<%= form_for(User.new, url: search_admin_officials_path, as: :user, method: :get) do |f| %> <%= form_for(User.new, url: search_admin_officials_path, as: :user, method: :get) do |f| %>
<%= text_field_tag :email, "", label: false, placeholder: t("admin.officials.index.search_email_placeholder") %> <div class="row">
<%= f.submit t("admin.officials.index.search") %> <div class="small-12 medium-6 column">
<%= text_field_tag :email, "", placeholder: t("admin.officials.index.search_email_placeholder") %>
</div>
<div class="form-inline small-12 medium-6 column">
<%= f.submit t("admin.officials.index.search"), class: "button radius success" %>
</div>
</div>
<% end %> <% end %>
</div>
<div> <h3><%= page_entries_info @officials %></h3>
<%= page_entries_info @officials %>
</div>
<div> <ul class="admin-list">
<% @officials.each do |official| %> <% @officials.each do |official| %>
<%= link_to official.name, edit_admin_official_path(official) %> <li>
<strong><%= official.name %></strong>
<span class="bullet">&nbsp;&bullet;&nbsp;</span>
<span class="level"><%= t("admin.officials.level_#{official.official_level}") %></span>
<span class="bullet">&nbsp;&bullet;&nbsp;</span>
<span class="label round level-<%= official.official_level %>">
<%= official.official_position %> <%= official.official_position %>
<%= t("admin.officials.level_#{official.official_level}") %> </span>
<br/><br/>
<% end %> <%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(official), class: "button radius tiny right" %>
</div> </li>
<% end %>
</ul>
<div>
<%= paginate @officials %> <%= paginate @officials %>
</div>

View File

@@ -1,21 +1,30 @@
<h1><%= t("admin.officials.search.title") %></h1> <h2><%= t("admin.officials.search.title") %></h2>
<div>
<%= form_for(User.new, url: search_admin_officials_path, as: :user, method: :get) do |f| %> <%= form_for(User.new, url: search_admin_officials_path, as: :user, method: :get) do |f| %>
<%= text_field_tag :email, "", label: false, placeholder: t("admin.officials.index.search_email_placeholder") %> <div class="row">
<%= f.submit t("admin.officials.search.search") %> <div class="small-12 medium-6 column">
<%= text_field_tag :email, "", placeholder: t("admin.officials.index.search_email_placeholder") %>
</div>
<div class="small-12 medium-6 column">
<%= f.submit t("admin.officials.search.search"), class: "button radius success" %>
</div>
</div>
<% end %> <% end %>
</div>
<div> <h3><%= page_entries_info @users %></h3>
<%= page_entries_info @users %>
</div>
<div> <ul class="admin-list">
<% @users.each do |user| %> <% @users.each do |user| %>
<%= link_to user.name, edit_admin_official_path(user) %> <li>
<strong><%= user.name %></strong>
<span class="bullet">&nbsp;&bullet;&nbsp;</span>
<span class="label round level-<%= user.official_level %>">
<%= user.official_position %> <%= user.official_position %>
<%= t("admin.officials.level_#{user.official_level}") %> </span>
<%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(user) %> <span class="bullet">&nbsp;&bullet;&nbsp;</span>
<span class="level"><%= t("admin.officials.level_#{user.official_level}") %></span>
<%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(user), class: "button radius tiny right" %>
</li>
<% end %> <% end %>
</div> </ul>

View File

@@ -1,15 +1,14 @@
<h1><%= t("admin.settings.index.title") %></h1> <h2><%= t("admin.settings.index.title") %></h2>
<ul> <ul class="admin-list">
<% @settings.each do |setting| %> <% @settings.each do |setting| %>
<li> <li>
<strong><%= setting.key.classify %></strong> <strong><%= setting.key.classify %></strong>
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %> <%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= f.text_field :value, label: false, id: dom_id(setting) %> <%= f.text_field :value, label: false, id: dom_id(setting) %>
<%= f.submit(class: "button radius tiny") %> <%= f.submit(class: "button radius tiny success") %>
<% end %> <% end %>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View File

@@ -16,7 +16,7 @@
</div> </div>
</div> </div>
<%= f.submit(class: "button radius create") %> <%= f.submit(class: "button radius success") %>
<% end %> <% end %>
@@ -38,7 +38,7 @@
<% end %> <% end %>
<%= f.submit(class: "button radius tiny success") %> <%= f.submit(class: "button radius tiny success") %>
<br>
<%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "delete" %> <%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "delete" %>
<% end %> <% end %>
</li> </li>

View File

@@ -1,13 +1,24 @@
<h1>Stats</h1> <div class="stats row-full">
<div class="row">
<div class="small-12 column">
<h2>Stats</h2>
<div class="small-12 medium-6 column">
<h3>Visits</h3> <h3>Visits</h3>
<%= visits_chart_tag id: "visits" %> <%= visits_chart_tag id: "visits" %>
</div>
<div class="small-12 medium-6 column">
<h3>Combined</h3> <h3>Combined</h3>
<%= events_chart_tag @event_types, id: 'combined' %> <%= events_chart_tag @event_types, id: 'combined' %>
</div>
<div class="small-12">
<% @event_types.each do |event_type| %> <% @event_types.each do |event_type| %>
<h3><%= event_type.titleize %></h3> <h3><%= event_type.titleize %></h3>
<%= events_chart_tag event_type %> <%= events_chart_tag event_type %>
<% end %> <% end %>
</div>
</div>
</div>
</div>

View File

@@ -58,7 +58,7 @@ en:
edit: edit:
title: 'Officials: edit user' title: 'Officials: edit user'
destroy: "Remove 'Official' condition" destroy: "Remove 'Official' condition"
cancel: "Cancel" back: Back
flash: flash:
official_updated: 'Official position saved!' official_updated: 'Official position saved!'
official_destroyed: 'User is not an official anymore' official_destroyed: 'User is not an official anymore'

View File

@@ -58,7 +58,7 @@ es:
edit: edit:
title: 'Cargos Públicos: Editar usuario' title: 'Cargos Públicos: Editar usuario'
destroy: "Eliminar condición de 'Cargo Público'" destroy: "Eliminar condición de 'Cargo Público'"
cancel: "Cancelar" back: Volver
flash: flash:
official_updated: 'Datos del cargo público guardados' official_updated: 'Datos del cargo público guardados'
official_destroyed: 'Datos guardados: el usuario ya no es cargo público' official_destroyed: 'Datos guardados: el usuario ya no es cargo público'