Godwin
9 years ago
7 changed files with 92 additions and 249 deletions
@ -1,25 +0,0 @@ |
|||
- page_title = 'Bike!Bike! Reources' |
|||
- title page_title |
|||
- banner_title page_title |
|||
- description 'Bike!Bike! list of resources - Bike Collective Wiki, ThinkTank, Bike!Bike! photos and documents' |
|||
|
|||
.row |
|||
.columns |
|||
%p |
|||
Here is a list of online resources available to commmunity bike projects. The bike collective wiki in particlular has great start up kits and many helpful articles about how community bike shops operate. The think tank is a list serve with over 600 contributors. When you join the list, you can talk to community bike shops from all over the world about how to better organize and operate a shop. |
|||
%ul |
|||
%li |
|||
%a{href: 'http://www.bikecollectives.org/wiki/index.php?title=Main_Page', target: '_blank'} |
|||
Bike Collective Wiki |
|||
%li |
|||
%a{href: 'http://lists.bikecollectives.org/listinfo.cgi/thethinktank-bikecollectives.org', target: '_blank'} |
|||
Think tank sign up |
|||
%li |
|||
%a{href: 'http://www.flickr.com/photos/93412361@N07/with/8494632542/', target: '_blank'} |
|||
flickr bikebike! |
|||
%li |
|||
%a{href: 'https://www.dropbox.com/sh/4phyl9lft18whzi/SXQ6XUklKB', target: '_blank'} |
|||
Drop box for bikebike2012 (shared public box) |
|||
|
|||
%p |
|||
If you have more resources you think should be listed here, please post them to the <a href="http://tqa.bikebike.org/project/issues/website" rel="external">issue tracker for the bikebike! website.</a></div></div> |
@ -1,26 +0,0 @@ |
|||
- page_title = 'Translations' |
|||
- title page_title |
|||
- banner_title page_title |
|||
|
|||
.row |
|||
%h1 |
|||
= _ 'languages.list' |
|||
%h2 |
|||
= _ 'languages.active' |
|||
%ul.languages.active.small-block-grid-1.medium-block-grid-3.large-block-grid-4.grid.links |
|||
- @language_codes.each do |code| |
|||
- if code && @completeness.has_key?(code.to_s) |
|||
%li.text-center |
|||
- completeness = @completeness[code.to_s] |
|||
-# percent = @total_translations ? ((completeness / @total_translations.to_f) * 100).to_i : 0 |
|||
%a{:href => "/translations/#{code}/", :class => (completeness > 99 ? 'complete' : completeness > 67 ? 'needs-work' : nil)} |
|||
%h3=_"languages.#{code}" |
|||
.completeness |
|||
= "#{completeness} / #{@total_translations} (#{completeness}%)" |
|||
%h2= _ 'languages.inactive' |
|||
%ul.languages.inactive.small-block-grid-1.medium-block-grid-3.large-block-grid-4.grid.links |
|||
- @language_codes.each do |code| |
|||
- if code && !@completeness.has_key?(code.to_s) |
|||
%li.text-center |
|||
%a{:href => "/translations/#{code}/"} |
|||
%h3=_"languages.#{code}" |
@ -1,73 +0,0 @@ |
|||
- content_for :dom_ready |
|||
$('table#translations td.value').click(function() { |
|||
var $this = $(this); |
|||
if(!$this.find('.translation-form').length()) { |
|||
startTranslating($this); |
|||
} |
|||
}); |
|||
if ($('table#translations').length()) { |
|||
$(document).click(function(event) { |
|||
$target = $(event.target); |
|||
if ($target.closest('table#translations').length() < 1 && !$target.hasClass('auto-translate')) { |
|||
stopTranslating(); |
|||
} |
|||
$('.auto-translate').click (function(event) { |
|||
event.preventDefault(); |
|||
$td = $(this).parent(); |
|||
saveTranslation($td, null, true); |
|||
}); |
|||
} |
|||
|
|||
- content_for :scripts |
|||
function saveTranslation($td, $move_to, auto_translate) { |
|||
var val = ''; |
|||
var do_auto_translate = true; |
|||
if (typeof auto_translate == "undefined" || !auto_translate) { |
|||
val = $td.find('textarea').val(); |
|||
do_auto_translate = false; |
|||
} |
|||
var key = $td.parent().data().key; |
|||
var params = { |
|||
translationkey: key, |
|||
translationvalue: val, |
|||
translationlang: window.location.href.replace(/^.*\/(\w+)\/$/, '$1') |
|||
}; |
|||
if (do_auto_translate) { |
|||
params['auto_translate'] = true; |
|||
} |
|||
$.post('/translate/', params, function(json) { |
|||
$td.html(json.translation); |
|||
if ($td.parent().hasClass('not-exists')) { |
|||
$td.parent().removeClass('not-exists'); |
|||
$td.parent().addClass('exists'); |
|||
} |
|||
$('.translation-form').remove(); |
|||
if (typeof $move_to != "undefined" && $move_to) { |
|||
startTranslating($move_to); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function stopTranslating() { |
|||
$('.translation-form').remove(); |
|||
} |
|||
|
|||
function startTranslating($td) { |
|||
stopTranslating(); |
|||
var value = $td.parent().hasClass('not-exists') ? '' : $td.html().trim(); |
|||
var $tr = $td.parent(); |
|||
var key = $tr.data().key; |
|||
$td.append('<div class="translation-form"><textarea>' + value + '</textarea><button class="small" data-key="' + key + '">Save</textarea>'); |
|||
var $textarea = $td.find('textarea'); |
|||
$textarea.select(); |
|||
$td.find('.translation-form button').click(function() { saveTranslation($td); }); |
|||
$textarea.keydown(function(event) { |
|||
if (event.keyCode == 9) { |
|||
event.preventDefault(); |
|||
var $new_tr = event.shiftKey ? $tr.prev() : $tr.next(); |
|||
saveTranslation($td, $new_tr.find('.value')); |
|||
} else if (event.keyCode == 27) { |
|||
stopTranslating(); |
|||
} |
|||
}); |
|||
} |
@ -1,48 +0,0 @@ |
|||
- page_title = (_ 'language_translations', vars: {:language => (_ ('languages.' + @lang))}) |
|||
- title page_title |
|||
- banner_title page_title |
|||
- page_style :form |
|||
|
|||
.row |
|||
%table.columns#translations{data: {token: form_authenticity_token}} |
|||
%thead |
|||
%tr |
|||
%th.key=_'translations.Key' |
|||
%th.key=_'translations.Pages' |
|||
%th.key=_'translations.Value' |
|||
- @translations.sort{| a1, a2 | a1[0].downcase <=> a2[0].downcase}.each do |k,translation| |
|||
- current_translation = Translation.locale(@lang.to_sym).lookup(k) |
|||
- current_translation = current_translation.size() > 0 ? current_translation = current_translation[0].value : nil |
|||
- cached = (translation && translation['languages'] && translation['languages'].include?(@lang)) |
|||
- vars = translation && translation.has_key?('vars') && translation['vars'].size() > 0 ? translation['vars'] : nil |
|||
- (vars && vars.include?(:count) ? I18n.backend.get_pluralization_rules(@lang) : [nil]).each do |pluralization| |
|||
- key = k + (pluralization ? ".#{pluralization.to_s}" : '') |
|||
%tr{:class => current_translation ? 'exists' : 'not-exists', :data => {:key => key}} |
|||
%td.key |
|||
= key |
|||
- if vars |
|||
.tags |
|||
%h5=_'translations.Vars' |
|||
%ul |
|||
- vars.each do |v| |
|||
%li=v |
|||
%td.pages |
|||
%ul |
|||
- if translation |
|||
- translation['pages'].each do |page| |
|||
%li |
|||
%a{:href => page}=page |
|||
%td.value.primary |
|||
- if current_translation |
|||
= current_translation |
|||
- elsif I18n.locale.to_s == @lang.to_s |
|||
Nil |
|||
- else |
|||
- translation_hint = Translation.locale(I18n.locale).lookup(k) |
|||
- translation_hint = translation_hint && translation_hint.size() > 0 ? translation_hint = translation_hint[0].value : nil |
|||
= translation_hint ? (_ "languages.#{I18n.locale.to_s}") + " = \"#{translation_hint}\"" : 'Nil' |
|||
- unless current_translation |
|||
%a{:href => '#', :class => 'auto-translate button small'}='Auto' |
|||
|
|||
- content_for :footer_scripts do |
|||
= javascript_include_tag 'translations' |
Loading…
Reference in new issue