Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra unrelated set of fixes #65

Merged
merged 5 commits into from
Aug 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ body {

.navbar-toggle .icon-bar { background: white; }

.navbar-brand { padding-right: 40px; }

a { color: white; }

.label {
text-transform: uppercase;
font-weight: normal;
font-size: 80%;
padding-top: 0.3em;
margin-left: 6px;
background: lighten(#993300, 10%);
}

.navbar-nav {
margin-top: 0;
Expand Down
21 changes: 0 additions & 21 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ def canonical_url
url_for only_path: false, params: parameters
end

# This helper automatically will add "current" class on to a <li> item
# as required by Bootstrap to show the navbar item using 'current' style.
def navigation_link text, url
content_tag(:li, class: "nav-item #{current_page?(url) ? 'active' : ''}") do
link_to text, url, class: 'nav-link'
end
end

def running_time sec, options = {}
if sec >= 3600 || (!options[:full].nil? && options[:full] == true)
'%d:%02d:%02d' % [ sec / 3600, (sec % 3600) / 60, sec % 60]
Expand Down Expand Up @@ -46,17 +38,4 @@ def to_markdown text
markdown = Redcarpet::Markdown.new(render)
markdown.render(text).html_safe
end

# TODO: Remove this method after it has been tested that is not used.
def horizontal_form_for(resource, options = {}, &block)
options[:html] = { class: 'form-horizontal' }
options[:wrapper] = :horizontal_form
options[:wrapper_mappings] = {
check_boxes: :horizontal_radio_and_checkboxes,
radio_buttons: :horizontal_radio_and_checkboxes,
file: :horizontal_file_input,
boolean: :horizontal_boolean
}
simple_form_for(resource, options, &block)
end
end
77 changes: 39 additions & 38 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
<footer class="main-footer">
<div class="footer-links">
<div class="container">
<div class="row">
<div class="footer-info col-md-6 col-sm-8">
<h3><%= t('.footer_info.title') %></h3>
<p><%= t('.footer_info.description') %></p>
<p><%= link_to t('.footer_info.about.text'), root_path, title: t('.footer_info.about.title') %></p>
</div>
<div class="footer-col col-sm-2 col-xs-6 col-lg-offset-2 col-md-offset-2">
<h3><%= t('.navigation.title') %></h3>
<ul>
<li><%= link_to t('.navigation.front'), root_path %></li>
<li><%= link_to t('.navigation.videos'), videos_path %></li>
<li><%= link_to t('.navigation.playlists'), playlists_path %></li>
<li><%= link_to t('.navigation.topics'), topics_path %></li>
<li><%= link_to t('.navigation.community'), 'https://www.facebook.com/groups/makigas', target: 'blank' %></li>
</ul>
</div>
<div class="footer-col col-sm-2 col-xs-6">
<h3><%= t('.social.title') %></h3>
<ul>
<li><%= link_to t('.social.facebook'), 'https://www.facebook.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.twitter'), 'https://twitter.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.youtube'), 'https://youtube.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.github'), 'https://github.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.telegram'), 'https://www.telegram.me/makigas', target: 'blank' %></li>
</ul>
<div class="row">
<div class="footer-info col-md-6 col-sm-8">
<h3><%= t('.footer_info.title') %></h3>
<p><%= t('.footer_info.description') %></p>
<p><%= link_to t('.footer_info.about.text'), root_path, title: t('.footer_info.about.title') %></p>
</div>
<div class="footer-col col-sm-2 col-xs-6 col-lg-offset-2 col-md-offset-2">
<h3><%= t('.navigation.title') %></h3>
<ul>
<li><%= link_to t('.navigation.front'), root_path %></li>
<li><%= link_to t('.navigation.videos'), videos_path %></li>
<li><%= link_to t('.navigation.playlists'), playlists_path %></li>
<li><%= link_to t('.navigation.topics'), topics_path %></li>
<li><%= link_to t('.navigation.community'), 'https://www.facebook.com/groups/makigas', target: 'blank' %></li>
</ul>
</div>
<div class="footer-col col-sm-2 col-xs-6">
<h3><%= t('.social.title') %></h3>
<ul>
<li><%= link_to t('.social.facebook'), 'https://www.facebook.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.twitter'), 'https://twitter.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.youtube'), 'https://youtube.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.github'), 'https://github.com/makigas', target: 'blank' %></li>
<li><%= link_to t('.social.telegram'), 'https://www.telegram.me/makigas', target: 'blank' %></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="copyright-info">
<div class="container">
<div class="row">
<div class="col-md-9 copyright-links">
<p class="year"><strong>&copy; 2012 - <%= Time.now.year %> makigas</strong></p>
<p>
<%= link_to t('.copyright.legal'), terms_path %> &bull;
<%= link_to t('.copyright.privacy'), privacy_path %> &bull;
<%= link_to t('.copyright.disclaimer'), disclaimer_path %> &bull;
<%= link_to t('.copyright.cookies'), cookies_path %>
</p>
</div>
<div class="col-md-3 made-in-spain">
<p><%= t('.made_in_spain') %></p>
<div class="row">
<div class="col-md-9 copyright-links">
<p class="year"><strong>&copy; 2012 - <%= Time.now.year %> makigas</strong></p>
<p>
<%= link_to t('.copyright.legal'), terms_path %> &bull;
<%= link_to t('.copyright.privacy'), privacy_path %> &bull;
<%= link_to t('.copyright.disclaimer'), disclaimer_path %> &bull;
<%= link_to t('.copyright.cookies'), cookies_path %>
</p>
</div>
<div class="col-md-3 made-in-spain">
<p><%= t('.made_in_spain') %></p>
</div>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
<meta name="theme-color" content="#4d6699">

<%= csrf_meta_tags %>
<%= content_for(:header) if content_for?(:header) %>
16 changes: 11 additions & 5 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@
<% end %>
</div>
<div class="collapse navbar-collapse" id="makigas-navbar">
<ul class="nav navbar-nav navbar-right">
<%= navigation_link t('.front'), root_path %>
<%= navigation_link t('.videos'), videos_path %>
<%= navigation_link t('.playlists'), playlists_path %>
<%= navigation_link t('.topics'), '/topics' %>
<ul class="nav navbar-nav">
<li class="nav-item"><%= link_to t('.videos'), :videos, class: 'nav-link' %></li>
<li class="nav-item"><%= link_to t('.playlists'), :playlists, class: 'nav-link' %></li>
<li class="nav-item"><%= link_to t('.topics'), :topics, class: 'nav-link' %></li>
<li class="nav-item"><%= link_to t('.community'), 'https://www.facebook.com/groups/makigas', target: :blank, class: 'nav-link' %></li>
<li class="nav-item">
<%= link_to 'https://discord.gg/Mq7TBAB', target: :blank, class: 'nav-link' do %>
<%= t('.discord') %>
<span class="label"><%= t('.new') %></span>
<% end %>
</li>
</ul>
</div>
</div>
Expand Down
11 changes: 6 additions & 5 deletions app/views/layouts/dashboard/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
</div>
<div class="collapse navbar-collapse" id="makigas-navbar">
<ul class="nav navbar-nav">
<%= navigation_link t('.videos'), [:dashboard, :videos] %>
<%= navigation_link t('.playlists'), [:dashboard, :playlists] %>
<%= navigation_link t('.topics'), [:dashboard, :topics] %>
<%= navigation_link t('.users'), [:dashboard, :users] %>
<li class="nav-item"><%= link_to t('.videos'), [:dashboard, :videos], class: 'nav-link' %></li>
<li class="nav-item"><%= link_to t('.playlists'), [:dashboard, :playlists], class: 'nav-link' %></li>
<li class="nav-item"><%= link_to t('.topics'), [:dashboard, :topics], class: 'nav-link' %></li>
<li class="nav-item"><%= link_to t('.opinions'), [:dashboard, :opinions], class: 'nav-link' %></li>
<li class="nav-item"><%= link_to t('.users'), [:dashboard, :users], class: 'nav-link' %></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="navbar-text hidden-xs"><%= current_user.email %></li>
<li class="navbar-text hidden-sm hidden-xs"><%= current_user.email %></li>
<li><%= link_to t('.view_site'), root_url(subdomain: nil), target: :blank %></li>
<li><%= link_to t('.log_out'), destroy_user_session_path %></li>
</ul>
Expand Down
3 changes: 2 additions & 1 deletion app/views/playlists/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
<% end %>

<% if @playlist.topic %>
<% content_for :header do %>
<style>
/* Override default page colors with my own. */
.main-header, .hero-tron { background: <%= @playlist.topic.color %>; }
.main-header .navbar-makigas { background: rgba(0, 0, 0, 0.25); }
</style>
<% end %>
<% end %>

<% content_for :hero do %>
<div class="media playlist-data">
Expand Down
3 changes: 2 additions & 1 deletion app/views/topics/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
<meta property="og:image" content="<%= image_url(@topic.thumbnail.url, only_path: false) %>">
<% end %>

<% content_for :header do %>
<style>
/* Override default page colors with my own. */
.main-header, .hero-tron { background: <%= @topic.color %>; }
.main-header .navbar-makigas { background: rgba(0, 0, 0, 0.25); }
</style>
<% end %>

<% content_for :hero do %>
<div class="media playlist-data">
Expand Down
3 changes: 2 additions & 1 deletion app/views/videos/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
<% content_for :body_classes, 'video-player-page' %>

<% if @video.playlist.topic %>
<% content_for :header do %>
<style>
/* Override default page colors with my own. */
.main-header, .hero-tron { background: <%= @video.playlist.topic.color %>; }
.main-header .navbar-makigas { background: rgba(0, 0, 0, 0.25); }
</style>
<% end %>
<% end %>

<%= content_for :hero do %>
<h1><%= @video.position %>. <%= @video.title %></h1>
Expand Down
1 change: 1 addition & 0 deletions config/locales/dashboard.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,4 @@ es:
videos: Vídeos
view_site: Ver sitio
navigation: Navegación
opinions: Opiniones
4 changes: 3 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ es:
dismiss: "Me entero"
learn_more: "Lee más sobre las cookies"
header:
front: Principal
navigation: Desplegar navegación
playlists: Listas
topics: Temas
videos: Vídeos
community: Comunidad
discord: Discord
new: Nuevo
footer:
copyright:
cookies: Uso de cookies (EU)
Expand Down
46 changes: 21 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ babel-helpers@^6.24.1:
babel-template "^6.24.1"

babel-loader@7.x:
version "7.1.1"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.1.tgz#b87134c8b12e3e4c2a94e0546085bc680a2b8488"
version "7.1.2"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126"
dependencies:
find-cache-dir "^1.0.0"
loader-utils "^1.0.2"
Expand Down Expand Up @@ -1293,8 +1293,8 @@ css-color-names@0.0.4:
resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0"

css-loader@^0.28.4:
version "0.28.4"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.4.tgz#6cf3579192ce355e8b38d5f42dd7a1f2ec898d0f"
version "0.28.5"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.5.tgz#dd02bb91b94545710212ef7f6aaa66663113d754"
dependencies:
babel-code-frame "^6.11.0"
css-selector-tokenizer "^0.7.0"
Expand All @@ -1309,7 +1309,7 @@ css-loader@^0.28.4:
postcss-modules-scope "^1.0.0"
postcss-modules-values "^1.1.0"
postcss-value-parser "^3.3.0"
source-list-map "^0.1.7"
source-list-map "^2.0.0"

css-selector-tokenizer@^0.7.0:
version "0.7.0"
Expand Down Expand Up @@ -1557,8 +1557,8 @@ error-ex@^1.2.0:
is-arrayish "^0.2.1"

es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14:
version "0.10.27"
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.27.tgz#bf926b058c62b1cb5de1a887930673b6aa6d9a66"
version "0.10.29"
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.29.tgz#768eb2dfc4957bcf35fa0568f193ab71ede53fd8"
dependencies:
es6-iterator "2"
es6-symbol "~3.1"
Expand Down Expand Up @@ -3486,13 +3486,13 @@ postcss-minify-selectors@^2.0.4:
postcss-selector-parser "^2.0.0"

postcss-mixins@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/postcss-mixins/-/postcss-mixins-6.0.1.tgz#f5c9726259a6103733b43daa6a8b67dd0ed7aa47"
version "6.1.0"
resolved "https://registry.yarnpkg.com/postcss-mixins/-/postcss-mixins-6.1.0.tgz#a7db09c34c3bfdf0d52cfb822abf2e574e6bf86b"
dependencies:
globby "^6.1.0"
postcss "^6.0.3"
postcss "^6.0.9"
postcss-js "^1.0.0"
postcss-simple-vars "^4.0.0"
postcss-simple-vars "^4.1.0"
sugarss "^1.0.0"

postcss-modules-extract-imports@^1.0.0:
Expand Down Expand Up @@ -3530,8 +3530,8 @@ postcss-nested@^2.0.2:
postcss-selector-parser "^2.2.3"

postcss-nesting@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-4.0.1.tgz#8fc2ce40cbfcfab7ee24e7b68fb6ebe84b641469"
version "4.1.0"
resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-4.1.0.tgz#28ef1e7cf9d497618ad2e5fa4de25d4757da1653"
dependencies:
postcss "^6.0.1"

Expand Down Expand Up @@ -3629,11 +3629,11 @@ postcss-selector-parser@^2.0.0, postcss-selector-parser@^2.2.2, postcss-selector
indexes-of "^1.0.1"
uniq "^1.0.1"

postcss-simple-vars@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/postcss-simple-vars/-/postcss-simple-vars-4.0.0.tgz#d49e082897d9a4824f2268fa91d969d943e2ea76"
postcss-simple-vars@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/postcss-simple-vars/-/postcss-simple-vars-4.1.0.tgz#043248cfef8d3f51b3486a28c09f8375dbf1b2f9"
dependencies:
postcss "^6.0.1"
postcss "^6.0.9"

postcss-smart-import@^0.7.5:
version "0.7.5"
Expand Down Expand Up @@ -3940,8 +3940,8 @@ regenerator-runtime@^0.11.0:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1"

regenerator-transform@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.0.tgz#f9ab3eac9cc2de38431d996a6a8abf1c50f2e459"
version "0.10.1"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd"
dependencies:
babel-runtime "^6.18.0"
babel-types "^6.19.0"
Expand Down Expand Up @@ -4283,10 +4283,6 @@ sort-keys@^1.0.0:
dependencies:
is-plain-obj "^1.0.0"

source-list-map@^0.1.7:
version "0.1.8"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106"

source-list-map@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
Expand All @@ -4301,8 +4297,8 @@ source-map-resolve@^0.3.0:
urix "~0.1.0"

source-map-support@^0.4.15:
version "0.4.15"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1"
version "0.4.16"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.16.tgz#16fecf98212467d017d586a2af68d628b9421cd8"
dependencies:
source-map "^0.5.6"

Expand Down