diff --git a/app/assets/javascripts/rem.min.js b/app/assets/javascripts/rem.min.js new file mode 100755 index 000000000..7a96d75ed --- /dev/null +++ b/app/assets/javascripts/rem.min.js @@ -0,0 +1,7 @@ +/** + * Module: rem - v1.3.2 + * Description: A polyfill to parse CSS links and rewrite pixel equivalents into head for non supporting browsers + * Date Built: 2014-07-02 + * Copyright (c) 2014 | Chuck Carpenter ,Lucas Serven ; +**/ +!function(e){"use strict";var t=function(){var e=document.createElement("div");return e.style.cssText="font-size: 1rem;",/rem/.test(e.style.fontSize)},n=function(){for(var e=document.getElementsByTagName("link"),t=[],n=0;n0?(v=[],p=[],m=[],r()):i()}},a=function(e,t){for(var n,r=d(e).replace(/\/\*[\s\S]*?\*\//g,""),o=/[\w\d\s\-\/\\\[\]:,.'"*()<>+~%#^$_=|@]+\{[\w\d\s\-\/\\%#:!;,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!;,.'"*()]*\}/g,a=r.match(o),i=/\d*\.?\d+rem/g,s=r.match(i),c=/(.*\/)/,l=c.exec(t)[0],u=/@import (?:url\()?['"]?([^'\)"]*)['"]?\)?[^;]*/gm;null!==(n=u.exec(e));)m.push(0===n[1].indexOf("/")?n[1]:l+n[1]);null!==a&&0!==a.length&&(f=f.concat(a),g=g.concat(s))},i=function(){for(var e=/[\w\d\s\-\/\\%#:,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!,.'"*()]*[;}]/g,t=0;t #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b<%= moderator.name %> - •  + •  <%= moderator.email %> <% if moderator.persisted? %> <%= link_to t('admin.moderators.moderator.delete'), diff --git a/app/views/admin/officials/index.html.erb b/app/views/admin/officials/index.html.erb index b5e5efddb..5e4e2e443 100644 --- a/app/views/admin/officials/index.html.erb +++ b/app/views/admin/officials/index.html.erb @@ -17,9 +17,9 @@ <% @officials.each do |official| %>
  • <%= link_to official.name, edit_admin_official_path(official) %> -  •  +  •  <%= t("admin.officials.level_#{official.official_level}") %> -  •  +  •  <%= official.official_position %> diff --git a/app/views/admin/officials/search.html.erb b/app/views/admin/officials/search.html.erb index 028ba065b..f2636a52e 100644 --- a/app/views/admin/officials/search.html.erb +++ b/app/views/admin/officials/search.html.erb @@ -17,11 +17,11 @@ <% @users.each do |user| %>
  • <%= link_to user.name, edit_admin_official_path(user) %> -  •  +  •  <%= user.official_position %> -  •  +  •  <%= t("admin.officials.level_#{user.official_level}") %> <%= 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" %> diff --git a/app/views/comments/_actions.html.erb b/app/views/comments/_actions.html.erb index 72a458f52..36ec42e01 100644 --- a/app/views/comments/_actions.html.erb +++ b/app/views/comments/_actions.html.erb @@ -4,13 +4,13 @@ <% if can? :hide, comment %> -  •  +  •  <%= link_to t("admin.actions.hide").capitalize, hide_moderation_comment_path(comment), method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %> <% end %> <% if can? :hide, comment.user %> -  •  +  •  <%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(comment.user_id, debate_id: @debate.id), method: :put, data: { confirm: t('admin.actions.confirm') } %> <% end %> diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 0ac6b9be1..3997efdaf 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -38,20 +38,20 @@ <% else %> <%= comment.user.name %> <% if comment.user.official? %> -  •  +  •  <%= comment.user.official_position %> <% end %> <% end %> <% if comment.user.verified_organization? %> -  •  +  •  <%= t("shared.collective") %> <% end %> <% if comment.user_id == @commentable.author_id %> -  •  +  •  <%= t("debates.comment.author") %> @@ -59,7 +59,7 @@ <% end %> -  •  +  •  <% if comment.as_administrator? %> diff --git a/app/views/debates/_debate.html.erb b/app/views/debates/_debate.html.erb index 49d202cc8..0d2cef4ce 100644 --- a/app/views/debates/_debate.html.erb +++ b/app/views/debates/_debate.html.erb @@ -11,7 +11,7 @@

      <%= link_to t("debates.debate.comments", count: debate.comments_count), debate_path(debate, anchor: "comments") %> -  •  +  •  <%= l debate.created_at.to_date %>

    diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 1c48ea214..83c37964a 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -32,7 +32,7 @@ <%= @debate.author.name %> <% if @debate.author.official? %> -  •  +  •  <%= @debate.author.official_position %> @@ -40,18 +40,18 @@ <% end %> <% if @debate.author.verified_organization? %> -  •  +  •  <%= t("shared.collective") %> <% end %> -  •  +  •  <%= l @debate.created_at.to_date %> -  •  +  •    <%= link_to t("debates.show.comments", count: @debate.comments_count), "#comments" %> -  •  +  •  <%= render 'debates/flag_actions', debate: @debate %> diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index f341f4bd0..f71c6b8ee 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -13,7 +13,6 @@ open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "blank"), github: link_to(t("layouts.footer.github"), t("layouts.footer.github_url"), target: "blank")).html_safe %> -
    <%= t("layouts.footer.contact_us") %> <%= mail_to "web.gobiernoabierto@madrid.es" %>

    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fa9f1852d..860bf791a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,7 +14,10 @@ rel: "apple-touch-icon", sizes: "200x200", type: "image/png" %> - + + ">
    <%= render 'layouts/header' %> @@ -48,4 +51,7 @@ <%= render 'layouts/footer' %>
    + diff --git a/app/views/moderation/bulk/index.html.erb b/app/views/moderation/bulk/index.html.erb index c3bb68777..5451d4b1c 100644 --- a/app/views/moderation/bulk/index.html.erb +++ b/app/views/moderation/bulk/index.html.erb @@ -24,9 +24,9 @@ <%= link_to debate.title, debate, target: "_blank" %> -  •  +  •  <%= debate.author.username %> -  •  +  •  <%= l debate.updated_at.to_date %>
    <%= debate.description %> diff --git a/app/views/moderation/users/index.html.erb b/app/views/moderation/users/index.html.erb index 5a49c16d1..18f4f5f67 100644 --- a/app/views/moderation/users/index.html.erb +++ b/app/views/moderation/users/index.html.erb @@ -19,7 +19,7 @@ <% @users.each do |user| %>
  • <%= user.name %> -  •  +  •  <% if user.hidden? %> <%= t("moderation.users.index.hidden") %> <% else %> diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index a6dfa75c0..e79eaca70 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -10,3 +10,4 @@ Rails.application.config.assets.version = '1.0' # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) Rails.application.config.assets.precompile += %w( ckeditor/* ) +Rails.application.config.assets.precompile += %w( rem.min.js, respond.min.js ) \ No newline at end of file diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 330508e88..277db20b0 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -360,59 +360,59 @@ feature 'Debates' do feature 'Debate index order filters' do scenario 'Default order is confidence_score', :js do - create(:debate, title: 'best').update_column(:confidence_score, 10) - create(:debate, title: 'worst').update_column(:confidence_score, 2) - create(:debate, title: 'medium').update_column(:confidence_score, 5) + create(:debate, title: 'Best').update_column(:confidence_score, 10) + create(:debate, title: 'Worst').update_column(:confidence_score, 2) + create(:debate, title: 'Medium').update_column(:confidence_score, 5) visit debates_path - expect('best').to appear_before('medium') - expect('medium').to appear_before('worst') + expect('Best').to appear_before('Medium') + expect('Medium').to appear_before('Worst') end scenario 'Debates are ordered by hot_score', :js do - create(:debate, title: 'best').update_column(:hot_score, 10) - create(:debate, title: 'worst').update_column(:hot_score, 2) - create(:debate, title: 'medium').update_column(:hot_score, 5) + create(:debate, title: 'Best').update_column(:hot_score, 10) + create(:debate, title: 'Worst').update_column(:hot_score, 2) + create(:debate, title: 'Medium').update_column(:hot_score, 5) visit debates_path select 'most active', from: 'order-selector' within '#debates.js-order-hot-score' do - expect('best').to appear_before('medium') - expect('medium').to appear_before('worst') + expect('Best').to appear_before('Medium') + expect('Medium').to appear_before('Worst') end expect(current_url).to include('order=hot_score') end scenario 'Debates are ordered by most commented', :js do - create(:debate, title: 'best', comments_count: 10) - create(:debate, title: 'medium', comments_count: 5) - create(:debate, title: 'worst', comments_count: 2) + create(:debate, title: 'Best', comments_count: 10) + create(:debate, title: 'Medium', comments_count: 5) + create(:debate, title: 'Worst', comments_count: 2) visit debates_path select 'most commented', from: 'order-selector' within '#debates.js-order-most-commented' do - expect('best').to appear_before('medium') - expect('medium').to appear_before('worst') + expect('Best').to appear_before('Medium') + expect('Medium').to appear_before('Worst') end expect(current_url).to include('order=most_commented') end scenario 'Debates are ordered by newest', :js do - create(:debate, title: 'best', created_at: Time.now) - create(:debate, title: 'medium', created_at: Time.now - 1.hour) - create(:debate, title: 'worst', created_at: Time.now - 1.day) + create(:debate, title: 'Best', created_at: Time.now) + create(:debate, title: 'Medium', created_at: Time.now - 1.hour) + create(:debate, title: 'Worst', created_at: Time.now - 1.day) visit debates_path select 'newest', from: 'order-selector' within '#debates.js-order-created-at' do - expect('best').to appear_before('medium') - expect('medium').to appear_before('worst') + expect('Best').to appear_before('Medium') + expect('Medium').to appear_before('Worst') end expect(current_url).to include('order=created_at')