forked from RaVbaker/tolk
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start implementing a more streamlined interface for visual progress o…
…f completion
- Loading branch information
Showing
5 changed files
with
132 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@mixin border-radius($specs) { | ||
-webkit-border-radius: $specs; | ||
-moz-border-radius: $specs; | ||
-o-border-radius: $specs; | ||
border-radius: $specs; | ||
} | ||
@mixin box-shadow($specs) { | ||
-webkit-box-shadow: $specs; | ||
-moz-box-shadow: $specs; | ||
-o-box-shadow: $specs; | ||
box-shadow: $specs; | ||
} | ||
@mixin wrapper($width) { | ||
width: $width; | ||
margin: 0 auto; | ||
} | ||
@mixin css3pie { | ||
behavior: asset-path('pie/pie.js', js); | ||
} | ||
@mixin transition($transition) { | ||
-webkit-transition: $transition; | ||
-moz-transition: $transition; | ||
-o-transition: $transition; | ||
transition: $transition; | ||
} | ||
@mixin transform($properties) { | ||
-webkit-transform: $properties; | ||
-moz-transform: $properties; | ||
-o-transform: $properties; | ||
transform: $properties; | ||
} | ||
@mixin transform-origin($properties) { | ||
-webkit-transform-origin: $properties; | ||
-moz-transform-origin: $properties; | ||
-o-transform-origin: $properties; | ||
transform-origin: $properties; | ||
} | ||
@mixin linear-gradient($color1, $color2, $bgImage: null) { | ||
background-color: $color2; | ||
background-image: -webkit-gradient(linear, left top, left bottom, from($color1), to($color2)); /* Saf4+, Chrome */ | ||
background-image: -webkit-linear-gradient(top, $color1, $color2); /* Chrome 10+, Saf5.1+ */ | ||
background-image: -moz-linear-gradient(top, $color1, $color2); /* FF3.6 */ | ||
background-image: -ms-linear-gradient(top, $color1, $color2); /* IE10 */ | ||
background-image: -o-linear-gradient(top, $color1, $color2); /* Opera 11.10+ */ | ||
background-image: linear-gradient(top, $color1, $color2); | ||
|
||
@if $bgImage != null { | ||
background: $color2 $bgImage; | ||
} @else { | ||
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#{$color1}, EndColorStr=#{$color2}); | ||
zoom:1; | ||
} | ||
} | ||
@mixin clearfix { | ||
&:before, &:after { content: ""; display: table; } | ||
&:after { clear: both; } | ||
zoom: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$headerHeight: 50px; | ||
$footerHeight: 50px; | ||
$localesWidth: 150px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,10 @@ | ||
module Tolk | ||
module ApplicationHelper | ||
def format_i18n_value(value) | ||
h(yaml_value(value)).gsub(/\n/, '<br />') | ||
end | ||
|
||
def format_i18n_text_area_value(value) | ||
yaml_value(value) | ||
end | ||
|
||
def yaml_value(value) | ||
if value.present? | ||
unless value.is_a?(String) | ||
value = value.respond_to?(:ya2yaml) ? value.ya2yaml(:syck_compatible => true) : value.to_yaml | ||
end | ||
def completed_percentage_link(locale) | ||
content_tag :li, :style => "background-position: 0 #{locale.completed_percentage}%;", | ||
:class => locale.phrases_completed? ? 'completed' : nil do | ||
link_to locale.language_name, locale_path(locale) | ||
end | ||
|
||
value | ||
end | ||
|
||
def tolk_locale_selection | ||
existing_locale_names = Tolk::Locale.available_locales | ||
|
||
pairs = Tolk::Locale::MAPPING.to_a.map(&:reverse).sort_by(&:first) | ||
pairs.reject { |pair| existing_locale_names.include?(pair.last) } | ||
end | ||
|
||
def scope_selector_for(locale) | ||
select_tag 'scope', options_for_select([[Tolk::Locale.primary_locale.language_name, "origin"], | ||
[locale.language_name, "target"]], params[:scope]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters