Merge branch 'updated-styles'
Conflicts: assets/scripts/app/templates/layouts/top.hbs assets/scripts/app/templates/repos/list.hbs
This commit is contained in:
commit
360b32a4f2
|
@ -1,6 +0,0 @@
|
||||||
Localeapp.configure do |config|
|
|
||||||
config.api_key = ENV['LOCALEAPP_API_KEY']
|
|
||||||
config.translation_data_directory = 'locales'
|
|
||||||
config.synchronization_data_file = '.localeapp/log.yml'
|
|
||||||
config.daemon_pid_file = '.localeapp/localeapp.pid'
|
|
||||||
end
|
|
|
@ -1,3 +0,0 @@
|
||||||
---
|
|
||||||
:polled_at: 1363093348
|
|
||||||
:updated_at: 1363093348
|
|
|
@ -1,7 +1,6 @@
|
||||||
$: << 'lib'
|
$: << 'lib'
|
||||||
|
|
||||||
require 'rake-pipeline-web-filters'
|
require 'rake-pipeline-web-filters'
|
||||||
require 'rake-pipeline-i18n-filters'
|
|
||||||
require 'travis/assets'
|
require 'travis/assets'
|
||||||
require 'compass'
|
require 'compass'
|
||||||
|
|
||||||
|
@ -12,13 +11,6 @@ assets ||= Travis::Assets.new
|
||||||
assets.setup_compass
|
assets.setup_compass
|
||||||
assets.update_version
|
assets.update_version
|
||||||
|
|
||||||
output 'assets/scripts/config'
|
|
||||||
input 'locales' do
|
|
||||||
match '**/*.yml' do
|
|
||||||
i18n_js { 'locales.js' }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
output 'public/scripts'
|
output 'public/scripts'
|
||||||
input assets.scripts do
|
input assets.scripts do
|
||||||
match '**/*.hbs' do
|
match '**/*.hbs' do
|
||||||
|
|
3
Gemfile
3
Gemfile
|
@ -11,7 +11,6 @@ gem 'sinatra'
|
||||||
group :assets do
|
group :assets do
|
||||||
gem 'rake-pipeline', github: 'livingsocial/rake-pipeline'
|
gem 'rake-pipeline', github: 'livingsocial/rake-pipeline'
|
||||||
gem 'rake-pipeline-web-filters', github: 'wycats/rake-pipeline-web-filters'
|
gem 'rake-pipeline-web-filters', github: 'wycats/rake-pipeline-web-filters'
|
||||||
gem 'rake-pipeline-i18n-filters'
|
|
||||||
gem 'coffee-script'
|
gem 'coffee-script'
|
||||||
gem 'compass'
|
gem 'compass'
|
||||||
gem 'tilt'
|
gem 'tilt'
|
||||||
|
@ -22,8 +21,6 @@ end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
gem 'localeapp'
|
|
||||||
gem 'localeapp-handlebars_i18n'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
19
Gemfile.lock
19
Gemfile.lock
|
@ -40,28 +40,17 @@ GEM
|
||||||
foreman (0.61.0)
|
foreman (0.61.0)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
fssm (0.2.10)
|
fssm (0.2.10)
|
||||||
gli (2.5.4)
|
|
||||||
guard (1.6.2)
|
guard (1.6.2)
|
||||||
listen (>= 0.6.0)
|
listen (>= 0.6.0)
|
||||||
lumberjack (>= 1.0.2)
|
lumberjack (>= 1.0.2)
|
||||||
pry (>= 0.9.10)
|
pry (>= 0.9.10)
|
||||||
terminal-table (>= 1.4.3)
|
terminal-table (>= 1.4.3)
|
||||||
thor (>= 0.14.6)
|
thor (>= 0.14.6)
|
||||||
i18n (0.6.3)
|
|
||||||
json (1.7.7)
|
json (1.7.7)
|
||||||
libv8 (3.16.14.3)
|
libv8 (3.16.14.3)
|
||||||
listen (0.7.3)
|
listen (0.7.3)
|
||||||
localeapp (0.6.9)
|
|
||||||
gli
|
|
||||||
i18n
|
|
||||||
json
|
|
||||||
rest-client
|
|
||||||
ya2yaml
|
|
||||||
localeapp-handlebars_i18n (0.0.1)
|
|
||||||
localeapp
|
|
||||||
lumberjack (1.0.2)
|
lumberjack (1.0.2)
|
||||||
method_source (0.8.1)
|
method_source (0.8.1)
|
||||||
mime-types (1.21)
|
|
||||||
multi_json (1.6.1)
|
multi_json (1.6.1)
|
||||||
open4 (1.3.0)
|
open4 (1.3.0)
|
||||||
pry (0.9.12)
|
pry (0.9.12)
|
||||||
|
@ -82,13 +71,9 @@ GEM
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rake (10.0.3)
|
rake (10.0.3)
|
||||||
rake-pipeline-i18n-filters (0.0.5)
|
|
||||||
rake-pipeline (~> 0.6)
|
|
||||||
rb-fsevent (0.9.3)
|
rb-fsevent (0.9.3)
|
||||||
rerun (0.8.0)
|
rerun (0.8.0)
|
||||||
listen
|
listen
|
||||||
rest-client (1.6.7)
|
|
||||||
mime-types (>= 1.16)
|
|
||||||
rspec (2.13.0)
|
rspec (2.13.0)
|
||||||
rspec-core (~> 2.13.0)
|
rspec-core (~> 2.13.0)
|
||||||
rspec-expectations (~> 2.13.0)
|
rspec-expectations (~> 2.13.0)
|
||||||
|
@ -116,7 +101,6 @@ GEM
|
||||||
uglifier (1.3.0)
|
uglifier (1.3.0)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
multi_json (~> 1.0, >= 1.0.2)
|
multi_json (~> 1.0, >= 1.0.2)
|
||||||
ya2yaml (0.31)
|
|
||||||
yui-compressor (0.9.6)
|
yui-compressor (0.9.6)
|
||||||
POpen4 (>= 0.1.4)
|
POpen4 (>= 0.1.4)
|
||||||
|
|
||||||
|
@ -129,8 +113,6 @@ DEPENDENCIES
|
||||||
foreman
|
foreman
|
||||||
guard
|
guard
|
||||||
libv8 (~> 3.16.0)
|
libv8 (~> 3.16.0)
|
||||||
localeapp
|
|
||||||
localeapp-handlebars_i18n
|
|
||||||
puma
|
puma
|
||||||
rack-cache
|
rack-cache
|
||||||
rack-mobile-detect
|
rack-mobile-detect
|
||||||
|
@ -138,7 +120,6 @@ DEPENDENCIES
|
||||||
rack-ssl (~> 1.3)
|
rack-ssl (~> 1.3)
|
||||||
rake
|
rake
|
||||||
rake-pipeline!
|
rake-pipeline!
|
||||||
rake-pipeline-i18n-filters
|
|
||||||
rake-pipeline-web-filters!
|
rake-pipeline-web-filters!
|
||||||
rb-fsevent (~> 0.9.1)
|
rb-fsevent (~> 0.9.1)
|
||||||
rerun
|
rerun
|
||||||
|
|
|
@ -145,17 +145,8 @@ unless window.TravisApplication
|
||||||
$('#repo').append(element)
|
$('#repo').append(element)
|
||||||
Em.run.later (-> element.remove()), 10
|
Em.run.later (-> element.remove()), 10
|
||||||
|
|
||||||
setLocale: (locale) ->
|
|
||||||
return unless locale
|
|
||||||
I18n.locale = locale
|
|
||||||
Travis.set('locale', locale)
|
|
||||||
|
|
||||||
defaultLocale: 'en'
|
|
||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
location.href = location.href.replace('#!/', '') if location.hash.slice(0, 2) == '#!'
|
location.href = location.href.replace('#!/', '') if location.hash.slice(0, 2) == '#!'
|
||||||
I18n.fallbacks = true
|
|
||||||
@setLocale 'locale', @get('defaultLocale')
|
|
||||||
|
|
||||||
currentDate: ->
|
currentDate: ->
|
||||||
new Date()
|
new Date()
|
||||||
|
|
|
@ -6,11 +6,9 @@
|
||||||
window.addEventListener('message', (e) => @receiveMessage(e))
|
window.addEventListener('message', (e) => @receiveMessage(e))
|
||||||
|
|
||||||
signOut: ->
|
signOut: ->
|
||||||
Travis.storage.removeItem('travis.locale')
|
|
||||||
Travis.storage.removeItem('travis.user')
|
Travis.storage.removeItem('travis.user')
|
||||||
Travis.storage.removeItem('travis.token')
|
Travis.storage.removeItem('travis.token')
|
||||||
Travis.sessionStorage.clear()
|
Travis.sessionStorage.clear()
|
||||||
Travis.setLocale Travis.default_locale
|
|
||||||
@set('state', 'signed-out')
|
@set('state', 'signed-out')
|
||||||
@set('user', undefined)
|
@set('user', undefined)
|
||||||
if user = Travis.__container__.lookup('controller:currentUser').get('content')
|
if user = Travis.__container__.lookup('controller:currentUser').get('content')
|
||||||
|
@ -67,7 +65,6 @@
|
||||||
Travis.__container__.lookup('controller:currentUser').set('content', user)
|
Travis.__container__.lookup('controller:currentUser').set('content', user)
|
||||||
|
|
||||||
@set('state', 'signed-in')
|
@set('state', 'signed-in')
|
||||||
Travis.setLocale(data.user.locale || Travis.default_locale)
|
|
||||||
Travis.trigger('user:signed_in', data.user)
|
Travis.trigger('user:signed_in', data.user)
|
||||||
if router = Travis.__container__.lookup('router:main')
|
if router = Travis.__container__.lookup('router:main')
|
||||||
Ember.run.next =>
|
Ember.run.next =>
|
||||||
|
|
|
@ -13,5 +13,3 @@ Travis.CurrentUserController = Em.ObjectController.extend
|
||||||
Ember.run.scheduleOnce 'routerTransitions', this, ->
|
Ember.run.scheduleOnce 'routerTransitions', this, ->
|
||||||
@container.lookup('router:main').send('renderFirstSync')
|
@container.lookup('router:main').send('renderFirstSync')
|
||||||
).observes('isSyncing', 'content')
|
).observes('isSyncing', 'content')
|
||||||
|
|
||||||
updateLocale: delegate('updateLocale', to: 'content')
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'helpers/handlebars'
|
require 'helpers/handlebars'
|
||||||
require 'helpers/helpers'
|
require 'helpers/helpers'
|
||||||
require 'helpers/urls'
|
require 'helpers/urls'
|
||||||
require 'helpers/i18n_handlebars'
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
I18nBoundView = Ember.View.extend Ember._Metamorph, {
|
|
||||||
|
|
||||||
key: null,
|
|
||||||
|
|
||||||
valueDidChange: ->
|
|
||||||
return if this.morph.isRemoved()
|
|
||||||
this.morph.html(this.valueForRender())
|
|
||||||
|
|
||||||
valueForRender: ->
|
|
||||||
new Handlebars.SafeString I18n.t(this.key)
|
|
||||||
|
|
||||||
init: ->
|
|
||||||
this._super()
|
|
||||||
Travis.addObserver('locale', this, 'valueDidChange')
|
|
||||||
|
|
||||||
didInsertElement: ->
|
|
||||||
this.valueDidChange()
|
|
||||||
|
|
||||||
destroy: ->
|
|
||||||
Travis.removeObserver('locale', this, 'valueDidChange')
|
|
||||||
this._super()
|
|
||||||
|
|
||||||
render: (buffer) ->
|
|
||||||
buffer.push(this.valueForRender())
|
|
||||||
}
|
|
||||||
|
|
||||||
Ember.Handlebars.registerHelper 't', (key, options) ->
|
|
||||||
view = options.data.view
|
|
||||||
bindView = view.createChildView(I18nBoundView, { key: key })
|
|
||||||
view.appendChild(bindView)
|
|
||||||
# dont write any content from this helper, let the child view
|
|
||||||
# take care of itself.
|
|
||||||
false
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ require 'travis/model'
|
||||||
|
|
||||||
configKeys: (->
|
configKeys: (->
|
||||||
keys = @get('rawConfigKeys')
|
keys = @get('rawConfigKeys')
|
||||||
headers = (I18n.t(key) for key in ['build.job', 'build.duration', 'build.finished_at'])
|
headers = ['Job', 'Duration', 'Finished']
|
||||||
$.map(headers.concat(keys), (key) -> if Travis.CONFIG_KEYS_MAP.hasOwnProperty(key) then Travis.CONFIG_KEYS_MAP[key] else key)
|
$.map(headers.concat(keys), (key) -> if Travis.CONFIG_KEYS_MAP.hasOwnProperty(key) then Travis.CONFIG_KEYS_MAP[key] else key)
|
||||||
).property('rawConfigKeys.length')
|
).property('rawConfigKeys.length')
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ require 'travis/model'
|
||||||
email: Ember.attr('string')
|
email: Ember.attr('string')
|
||||||
login: Ember.attr('string')
|
login: Ember.attr('string')
|
||||||
token: Ember.attr('string')
|
token: Ember.attr('string')
|
||||||
locale: Ember.attr('string')
|
|
||||||
gravatarId: Ember.attr('string')
|
gravatarId: Ember.attr('string')
|
||||||
isSyncing: Ember.attr('boolean')
|
isSyncing: Ember.attr('boolean')
|
||||||
syncedAt: Ember.attr('string')
|
syncedAt: Ember.attr('string')
|
||||||
|
@ -59,10 +58,6 @@ require 'travis/model'
|
||||||
permissions
|
permissions
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
updateLocale: (locale) ->
|
|
||||||
@save()
|
|
||||||
Travis.setLocale(locale)
|
|
||||||
|
|
||||||
type: (->
|
type: (->
|
||||||
'user'
|
'user'
|
||||||
).property()
|
).property()
|
||||||
|
|
|
@ -2,21 +2,21 @@
|
||||||
<table id="builds" class="list">
|
<table id="builds" class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{t builds.name}}</th>
|
<th>Build</th>
|
||||||
<th>{{t builds.message}}</th>
|
<th>Message</th>
|
||||||
<th>
|
<th>
|
||||||
{{t builds.commit}}
|
Commit
|
||||||
</th>
|
</th>
|
||||||
<th class="committer">
|
<th class="committer">
|
||||||
{{t builds.committer}}
|
Committer
|
||||||
</th>
|
</th>
|
||||||
{{#if view.isPullRequestsList}}
|
{{#if view.isPullRequestsList}}
|
||||||
<th>
|
<th>
|
||||||
{{t builds.pr}}
|
PR
|
||||||
</th>
|
</th>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<th>{{t builds.duration}}</th>
|
<th>Duration</th>
|
||||||
<th>{{t builds.finished_at}}</th>
|
<th>Finished</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
<dl id="summary">
|
<dl id="summary">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<dt>{{t builds.name}}</dt>
|
<dt>Build</dt>
|
||||||
<dd class="number">
|
<dd class="number">
|
||||||
<span class="status"></span>
|
<span class="status"></span>
|
||||||
{{#if build.id}}
|
{{#if build.id}}
|
||||||
|
@ -12,40 +12,40 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</dd>
|
</dd>
|
||||||
<dt>{{t builds.state}}</dt>
|
<dt>state</dt>
|
||||||
<dd class="state">{{capitalize build.state}}</dd>
|
<dd class="state">{{capitalize build.state}}</dd>
|
||||||
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
|
<dt class="finished_at_label">Finished</dt>
|
||||||
<dd class="finished_at timeago" {{bind-attr title="build.formattedFinishedAt"}}>{{formatTime build.finishedAt}}</dd>
|
<dd class="finished_at timeago" {{bind-attr title="build.formattedFinishedAt"}}>{{formatTime build.finishedAt}}</dd>
|
||||||
<dt>{{t builds.duration}}</dt>
|
<dt>Duration</dt>
|
||||||
<dd class="duration" {{bind-attr title="startedAt"}}>{{formatDuration build.duration}}</dd>
|
<dd class="duration" {{bind-attr title="startedAt"}}>{{formatDuration build.duration}}</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#with build}}
|
{{#with build}}
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<dt>{{t builds.commit}}</dt>
|
<dt>Commit</dt>
|
||||||
<dd class="commit"><a {{bind-attr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
<dd class="commit"><a {{bind-attr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
||||||
{{#if pullRequest}}
|
{{#if pullRequest}}
|
||||||
<dt>{{t builds.pull_request}}</dt>
|
<dt></dt>
|
||||||
<dd class="pull_request"><a {{bind-attr href="commit.compareUrl"}}>#{{pullRequestNumber}} {{pullRequestTitle}}</a></dd>
|
<dd class="pull_request"><a {{bind-attr href="commit.compareUrl"}}>#{{pullRequestNumber}} {{pullRequestTitle}}</a></dd>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if commit.compareUrl}}
|
{{#if commit.compareUrl}}
|
||||||
<dt>{{t builds.compare}}</dt>
|
<dt>Compare</dt>
|
||||||
<dd class="compare"><a {{bind-attr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
<dd class="compare"><a {{bind-attr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if commit.authorName}}
|
{{#if commit.authorName}}
|
||||||
<dt>{{t builds.author}}</dt>
|
<dt>Author</dt>
|
||||||
<dd class="author">{{commit.authorName}}</dd>
|
<dd class="author">{{commit.authorName}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if commit.committerName}}
|
{{#if commit.committerName}}
|
||||||
<dt>{{t builds.committer}}</dt>
|
<dt>Committer</dt>
|
||||||
<dd class="committer">{{commit.committerName}}</dd>
|
<dd class="committer">{{commit.committerName}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
|
||||||
|
|
||||||
<dt>{{t builds.message}}</dt>
|
<dt>Message</dt>
|
||||||
<dd class="message">{{formatMessage build.commit.message repoBinding=build.repo}}</dd>
|
<dd class="message">{{formatMessage build.commit.message repoBinding=build.repo}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
{{#if view.required}}
|
{{#if view.required}}
|
||||||
<table id="jobs" class="list">
|
<table id="jobs" class="list">
|
||||||
<caption>
|
<caption>
|
||||||
{{t jobs.build_matrix}}
|
Build Matrix
|
||||||
</caption>
|
</caption>
|
||||||
{{else}}
|
{{else}}
|
||||||
<table id="allowed_failure_jobs" class="list">
|
<table id="allowed_failure_jobs" class="list">
|
||||||
<caption>
|
<caption>
|
||||||
{{t jobs.allowed_failures}}
|
Allowed Failures
|
||||||
<a title="What's this?" class="help open-popup" name="help-allowed_failures" {{action "popup" target="view"}}></a>
|
<a title="What's this?" class="help open-popup" name="help-allowed_failures" {{action "popup" target="view"}}></a>
|
||||||
</caption>
|
</caption>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
{{#unless view.required}}
|
{{#unless view.required}}
|
||||||
<div id="help-allowed_failures" class="popup">
|
<div id="help-allowed_failures" class="popup">
|
||||||
<a href="#" class="close" {{action "popupClose" target="view"}}></a>
|
<a href="#" class="close" {{action "popupClose" target="view"}}></a>
|
||||||
<h4>{{t "jobs.allowed_failures"}}</h4>
|
<h4></h4>
|
||||||
<p>
|
<p>
|
||||||
Allowed Failures are items in your build matrix that are allowed to
|
Allowed Failures are items in your build matrix that are allowed to
|
||||||
fail without causing the entire build to be shown as failed.
|
fail without causing the entire build to be shown as failed.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
{{#if view.job.sponsor.name}}
|
{{#if view.job.sponsor.name}}
|
||||||
<p class="sponsor">
|
<p class="sponsor">
|
||||||
{{t builds.messages.sponsored_by}}
|
This test series was run on a worker box sponsored by
|
||||||
<a {{bind-attr href="sponsor.url"}}>{{sponsor.name}}</a>
|
<a {{bind-attr href="sponsor.url"}}>{{sponsor.name}}</a>
|
||||||
</p>
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -11,38 +11,38 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</dd>
|
</dd>
|
||||||
<dt>{{t jobs.state}}</dt>
|
<dt>state</dt>
|
||||||
<dd class="state">{{capitalize job.state}}</dd>
|
<dd class="state">{{capitalize job.state}}</dd>
|
||||||
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
|
<dt class="finished_at_label">Finished</dt>
|
||||||
<dd class="finished_at timeago" {{bind-attr title="job.formattedFinishedAt"}}>{{formatTime job.finishedAt}}</dd>
|
<dd class="finished_at timeago" {{bind-attr title="job.formattedFinishedAt"}}>{{formatTime job.finishedAt}}</dd>
|
||||||
<dt>{{t jobs.duration}}</dt>
|
<dt>Duration</dt>
|
||||||
<dd class="duration" {{bind-attr title="startedAt"}}>{{formatDuration job.duration}}</dd>
|
<dd class="duration" {{bind-attr title="startedAt"}}>{{formatDuration job.duration}}</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#with job}}
|
{{#with job}}
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<dt>{{t jobs.commit}}</dt>
|
<dt>Commit</dt>
|
||||||
<dd class="commit"><a {{bind-attr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
<dd class="commit"><a {{bind-attr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
||||||
{{#if build.pullRequest}}
|
{{#if build.pullRequest}}
|
||||||
<dt>{{t builds.pull_request}}</dt>
|
<dt></dt>
|
||||||
<dd class="pull_request"><a {{bind-attr href="commit.compareUrl"}}>#{{build.pullRequestNumber}} {{build.pullRequestTitle}}</a></dd>
|
<dd class="pull_request"><a {{bind-attr href="commit.compareUrl"}}>#{{build.pullRequestNumber}} {{build.pullRequestTitle}}</a></dd>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if commit.compareUrl}}
|
{{#if commit.compareUrl}}
|
||||||
<dt>{{t jobs.compare}}</dt>
|
<dt>Compare</dt>
|
||||||
<dd class="compare"><a {{bind-attr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
<dd class="compare"><a {{bind-attr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if commit.authorName}}
|
{{#if commit.authorName}}
|
||||||
<dt>{{t jobs.author}}</dt>
|
<dt>Author</dt>
|
||||||
<dd class="author">{{commit.authorName}}</dd>
|
<dd class="author">{{commit.authorName}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if commit.committerName}}
|
{{#if commit.committerName}}
|
||||||
<dt>{{t jobs.committer}}</dt>
|
<dt>Committer</dt>
|
||||||
<dd class="committer">{{commit.committerName}}</dd>
|
<dd class="committer">{{commit.committerName}}</dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/with}}
|
{{/with}}
|
||||||
<dt>{{t jobs.message}}</dt>
|
<dt>Message</dt>
|
||||||
<dd class="message">{{formatMessage job.commit.message repoBinding=job.repo}}</dd>
|
<dd class="message">{{formatMessage job.commit.message repoBinding=job.repo}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
|
|
@ -4,24 +4,24 @@
|
||||||
|
|
||||||
<ul id="navigation">
|
<ul id="navigation">
|
||||||
<li class="home">
|
<li class="home">
|
||||||
{{#link-to "index.current"}}{{t layouts.top.home}}{{/link-to}}
|
{{#link-to "index.current"}}Home{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="http://blog.travis-ci.com">{{t layouts.top.blog}}</a>
|
<a href="http://blog.travis-ci.com">Blog</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="http://status.travis-ci.com">{{t layouts.top.status}}</a>
|
<a href="http://status.travis-ci.com">Status</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="menu community">
|
<li class="menu community">
|
||||||
<p class="handle">
|
<p class="handle">
|
||||||
<a href="#">Help</a>
|
<a href="#">Help</a>
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://docs.travis-ci.com">{{t layouts.top.docs}}</a></li>
|
<li><a href="http://docs.travis-ci.com">Docs</a></li>
|
||||||
<li><a href="http://docs.travis-ci.com/newsletter">Newsletter</a></li>
|
<li><a href="http://docs.travis-ci.com/newsletter">Newsletter</a></li>
|
||||||
<li><a href="https://github.com/travis-ci/travis-ci/issues/new">File an Issue</a></li>
|
<li><a href="https://github.com/travis-ci/travis-ci/issues/new">File an Issue</a></li>
|
||||||
<li><a href="https://twitter.com/travisci">{{t layouts.about.twitter}}</a></li>
|
<li><a href="https://twitter.com/travisci">Twitter</a></li>
|
||||||
<li><a href="https://groups.google.com/group/travis-ci">{{t layouts.about.mailing_list}}</a></li>
|
<li><a href="https://groups.google.com/group/travis-ci">Mailing List</a></li>
|
||||||
<li><a href="irc://irc.freenode.net#travis">IRC</a></li>
|
<li><a href="irc://irc.freenode.net#travis">IRC</a></li>
|
||||||
<li><a href="mailto:support@travis-ci.com">E-Mail us</a></li>
|
<li><a href="mailto:support@travis-ci.com">E-Mail us</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -32,21 +32,21 @@
|
||||||
<li {{bind-attr class="view.classProfile"}}>
|
<li {{bind-attr class="view.classProfile"}}>
|
||||||
<p class="handle">
|
<p class="handle">
|
||||||
{{#if signedOut}}
|
{{#if signedOut}}
|
||||||
<a class="signed-out" href="#" {{action "signIn" target="Travis"}}>{{t layouts.top.github_login}}</a>
|
<a class="signed-out" href="#" {{action "signIn" target="Travis"}}>Sign in with Github</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if signedIn}}
|
{{#if signedIn}}
|
||||||
{{#link-to "profile" class="signed-in"}}<img {{bind-attr src="gravatarUrl"}}/>{{userName}}{{/link-to}}
|
{{#link-to "profile" class="signed-in"}}<img {{bind-attr src="gravatarUrl"}}/>{{userName}}{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if signingIn}}
|
{{#if signingIn}}
|
||||||
<span class="signing-in">{{t layouts.top.signing_in}}</span>
|
<span class="signing-in">Signing In</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
{{#link-to "profile.index" class="signed-in"}}{{t layouts.top.accounts}}{{/link-to}}
|
{{#link-to "profile.index" class="signed-in"}}Accounts{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/" {{action "signOut" target="Travis"}}>{{t layouts.top.sign_out}}</a>
|
<a href="/" {{action "signOut" target="Travis"}}>Sign Out</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<p class="tip">
|
<p class="tip">
|
||||||
{{{t profiles.show.message.your_repos}}}
|
{ Flick the switches below to turn on the Travis service hook for your projects, then push to GitHub.<br />
|
||||||
|
To test against multiple rubies, see}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{{#if allHooks.isLoaded}}
|
{{#if allHooks.isLoaded}}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<dl class="profile">
|
<dl class="profile">
|
||||||
<div>
|
<div>
|
||||||
<dt>
|
<dt>
|
||||||
{{t profiles.show.github}}:
|
Github
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<a {{bind-attr href="urlGithub"}}>{{user.login}}</a>
|
<a {{bind-attr href="urlGithub"}}>{{user.login}}</a>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<dt>
|
<dt>
|
||||||
{{t profiles.show.email}}:
|
Email
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{{user.email}}
|
{{user.email}}
|
||||||
|
@ -19,22 +19,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<dt>
|
<dt>
|
||||||
{{t profiles.show.token}}:
|
Token
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{{user.token}}
|
{{user.token}}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<dt>
|
|
||||||
{{t profiles.show.locale}}:
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
{{view Ember.Select id="locale"
|
|
||||||
contentBinding="view.locales"
|
|
||||||
valueBinding="user.locale"
|
|
||||||
optionLabelPath="content.name"
|
|
||||||
optionValuePath="content.key"}}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<ul id="queues">
|
<ul id="queues">
|
||||||
{{#each queue in controller}}
|
{{#each queue in controller}}
|
||||||
<li class="queue">
|
<li class="queue">
|
||||||
<h4>{{t queue}}: {{queue.name}}</h4>
|
<h4>Queue: {{queue.name}}</h4>
|
||||||
<ul {{bind-attr id="queue.id"}}>
|
<ul {{bind-attr id="queue.id"}}>
|
||||||
{{#each job in queue}}
|
{{#each job in queue}}
|
||||||
{{#view Travis.QueueItemView jobBinding="job"}}
|
{{#view Travis.QueueItemView jobBinding="job"}}
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/view}}
|
{{/view}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{t no_job}}
|
There are no jobs
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
|
||||||
<p class="summary">
|
<p class="summary">
|
||||||
<span class="duration_label">{{t repositories.duration}}:</span>
|
<span class="duration_label">Duration:</span>
|
||||||
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>{{formatDuration lastBuildDuration}}</abbr>
|
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>{{formatDuration lastBuildDuration}}</abbr>
|
||||||
</p>
|
</p>
|
||||||
<p class="summary">
|
<p class="summary">
|
||||||
<span class="finished-icon"></span><span class="finished_at_label">{{t repositories.finished_at}}:</span>
|
<span class="finished-icon"></span><span class="finished_at_label">Finished:</span>
|
||||||
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>{{formatTime lastBuildFinishedAt}}</abbr>
|
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>{{formatTime lastBuildFinishedAt}}</abbr>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<ul class="tabs">
|
<ul class="tabs">
|
||||||
<li id="tab_owned" {{bind-attr class="view.classOwned"}}>
|
<li id="tab_owned" {{bind-attr class="view.classOwned"}}>
|
||||||
<h5><a {{action "activate" "owned" target="view"}}>{{t layouts.application.my_repositories}}</a></h5>
|
<h5><a {{action "activate" "owned" target="view"}}>My Repositories</a></h5>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="tab_recent" {{bind-attr class="view.classRecent"}}>
|
<li id="tab_recent" {{bind-attr class="view.classRecent"}}>
|
||||||
<h5><a {{action "activate" "recent" target="view"}}>{{t layouts.application.recent}}</a></h5>
|
<h5><a {{action "activate" "recent" target="view"}}>Recent</a></h5>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li id="tab_search" {{bind-attr class="view.classSearch"}}>
|
<li id="tab_search" {{bind-attr class="view.classSearch"}}>
|
||||||
<h5><a {{action "activate" "search" target="view"}}>{{t layouts.application.search}}</a></h5>
|
<h5><a {{action "activate" "search" target="view"}}>Search</a></h5>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<h5>
|
<h5>
|
||||||
{{#if repo.slug}}
|
{{#if repo.slug}}
|
||||||
{{#link-to "repo" repo currentWhen="repo.index"}}
|
{{#link-to "repo" repo currentWhen="repo.index"}}
|
||||||
{{t repositories.tabs.current}}
|
Current
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h5>
|
</h5>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<h5>
|
<h5>
|
||||||
{{#if repo.slug}}
|
{{#if repo.slug}}
|
||||||
{{#link-to "builds" repo}}
|
{{#link-to "builds" repo}}
|
||||||
{{t repositories.tabs.build_history}}
|
Build History
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h5>
|
</h5>
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
<h5>
|
<h5>
|
||||||
{{#if repo.slug}}
|
{{#if repo.slug}}
|
||||||
{{#link-to "pullRequests" repo}}
|
{{#link-to "pullRequests" repo}}
|
||||||
{{t repositories.tabs.pull_requests}}
|
Pull Requests
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h5>
|
</h5>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<h5>
|
<h5>
|
||||||
{{#if repo.slug}}
|
{{#if repo.slug}}
|
||||||
{{#link-to "branches" repo}}
|
{{#link-to "branches" repo}}
|
||||||
{{t repositories.tabs.branches}}
|
Branch Summary
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h5>
|
</h5>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
{{#if build.id}}
|
{{#if build.id}}
|
||||||
{{#if repo.slug}}
|
{{#if repo.slug}}
|
||||||
{{#link-to "build" repo build}}
|
{{#link-to "build" repo build}}
|
||||||
{{t repositories.tabs.build}} #{{build.number}}
|
Build #{{build.number}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
{{#if job.id}}
|
{{#if job.id}}
|
||||||
{{#if repo.slug}}
|
{{#if repo.slug}}
|
||||||
{{#link-to "job" repo job}}
|
{{#link-to "job" repo job}}
|
||||||
{{t repositories.tabs.job}} #{{job.number}}
|
Job #{{job.number}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<a href="#" class="close" {{action "close" target="view"}}></a>
|
<a href="#" class="close" {{action "close" target="view"}}></a>
|
||||||
<p>
|
<p>
|
||||||
<label>{{t repositories.branch}}:</label>
|
<label>Branch:</label>
|
||||||
{{#if view.branches.isLoaded}}
|
{{#if view.branches.isLoaded}}
|
||||||
{{view Ember.Select contentBinding="view.branches" selectionBinding="view.statusImageBranch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}}
|
{{view Ember.Select contentBinding="view.branches" selectionBinding="view.statusImageBranch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -8,27 +8,27 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>{{t repositories.image_url}}:</label>
|
<label>Image URL:</label>
|
||||||
<input type="text" class="url" {{bind-attr value="view.statusImageUrl"}}></input>
|
<input type="text" class="url" {{bind-attr value="view.statusImageUrl"}}></input>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>{{t repositories.markdown}}:</label>
|
<label>Markdown:</label>
|
||||||
<input type="text" class="markdown" {{bind-attr value="view.markdownStatusImage"}}></input>
|
<input type="text" class="markdown" {{bind-attr value="view.markdownStatusImage"}}></input>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>{{t repositories.textile}}:</label>
|
<label>Textile:</label>
|
||||||
<input type="text" class="textile" {{bind-attr value="view.textileStatusImage"}}></input>
|
<input type="text" class="textile" {{bind-attr value="view.textileStatusImage"}}></input>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>{{t repositories.rdoc}}:</label>
|
<label>RDOC:</label>
|
||||||
<input type="text" class="rdoc" {{bind-attr value="view.rdocStatusImage"}}></input>
|
<input type="text" class="rdoc" {{bind-attr value="view.rdocStatusImage"}}></input>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>{{t repositories.asciidoc}}:</label>
|
<label>AsciiDoc:</label>
|
||||||
<input type="text" class="asciidoc" {{bind-attr value="view.asciidocStatusImage"}}></input>
|
<input type="text" class="asciidoc" {{bind-attr value="view.asciidocStatusImage"}}></input>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>{{t repositories.rst}}:</label>
|
<label>:</label>
|
||||||
<input type="text" class="rst" {{bind-attr value="view.rstStatusImage"}}></input>
|
<input type="text" class="rst" {{bind-attr value="view.rstStatusImage"}}></input>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -41,29 +41,5 @@ Travis.reopen
|
||||||
userBinding: 'controller.user'
|
userBinding: 'controller.user'
|
||||||
|
|
||||||
gravatarUrl: (->
|
gravatarUrl: (->
|
||||||
"#{location.protocol}//www.gravatar.com/avatar/#{@get('user.gravatarId')}?s=96&d=mm"
|
"#{location.protocol}//www.gravatar.com/avatar/#{@get('user.gravatarId')}?s=200&d=mm"
|
||||||
).property('user.gravatarId')
|
).property('user.gravatarId')
|
||||||
|
|
||||||
locale: (->
|
|
||||||
@get('user.locale')
|
|
||||||
).property('user.locale')
|
|
||||||
|
|
||||||
locales: (->
|
|
||||||
[
|
|
||||||
{ key: null, name: '' }
|
|
||||||
{ key: 'en', name: 'English' }
|
|
||||||
{ key: 'es', name: 'Español' }
|
|
||||||
{ key: 'fr', name: 'Français' }
|
|
||||||
{ key: 'ja', name: '日本語' }
|
|
||||||
{ key: 'nl', name: 'Nederlands' }
|
|
||||||
{ key: 'nb', name: 'Norsk Bokmål' }
|
|
||||||
{ key: 'pl', name: 'Polski' }
|
|
||||||
{ key: 'pt-BR', name: 'Português brasileiro' }
|
|
||||||
{ key: 'ru', name: 'Русский' }
|
|
||||||
{ key: 'de', name: 'Deutsch' }
|
|
||||||
]
|
|
||||||
).property()
|
|
||||||
|
|
||||||
change: ->
|
|
||||||
return unless $('#locale').val()
|
|
||||||
@get('user').updateLocale($('#locale').val())
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
I18n.missingTranslation = ->
|
|
||||||
key = arguments[arguments.length - 1]
|
|
||||||
value = key.split('.').pop()
|
|
||||||
$.titleize(value)
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ window.signInUser = (data) ->
|
||||||
created_at: "2011-05-10T15:43:59Z"
|
created_at: "2011-05-10T15:43:59Z"
|
||||||
gravatar_id: "582034b63279abeaa8e76acf12f5ee30"
|
gravatar_id: "582034b63279abeaa8e76acf12f5ee30"
|
||||||
is_syncing: false
|
is_syncing: false
|
||||||
locale: "en"
|
|
||||||
name: "Tyrion"
|
name: "Tyrion"
|
||||||
synced_at: "2013-12-09T09:41:47Z"
|
synced_at: "2013-12-09T09:41:47Z"
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ test '', ->
|
||||||
created_at: "2011-05-10T15:43:59Z"
|
created_at: "2011-05-10T15:43:59Z"
|
||||||
gravatar_id: "582034b63279abeaa8e76acf12f5ee30"
|
gravatar_id: "582034b63279abeaa8e76acf12f5ee30"
|
||||||
is_syncing: false
|
is_syncing: false
|
||||||
locale: "en"
|
|
||||||
name: "Tyrion"
|
name: "Tyrion"
|
||||||
synced_at: "2013-12-09T09:41:47Z"
|
synced_at: "2013-12-09T09:41:47Z"
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,6 @@ Travis.Router.reopen
|
||||||
Ember.LinkView.reopen
|
Ember.LinkView.reopen
|
||||||
loadingClass: 'loading_link'
|
loadingClass: 'loading_link'
|
||||||
|
|
||||||
require 'ext/i18n'
|
|
||||||
require 'travis/ajax'
|
require 'travis/ajax'
|
||||||
require 'travis/adapter'
|
require 'travis/adapter'
|
||||||
require 'routes'
|
require 'routes'
|
||||||
|
@ -169,8 +168,6 @@ require 'templates'
|
||||||
require 'views'
|
require 'views'
|
||||||
require 'components'
|
require 'components'
|
||||||
|
|
||||||
require 'config/locales'
|
|
||||||
|
|
||||||
require 'travis/instrumentation'
|
require 'travis/instrumentation'
|
||||||
|
|
||||||
Travis.setup()
|
Travis.setup()
|
||||||
|
|
532
assets/scripts/vendor/i18n.js
vendored
532
assets/scripts/vendor/i18n.js
vendored
|
@ -1,532 +0,0 @@
|
||||||
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
|
|
||||||
if (!Array.prototype.indexOf) {
|
|
||||||
Array.prototype.indexOf = function(searchElement /*, fromIndex */) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
if (this === void 0 || this === null) {
|
|
||||||
throw new TypeError();
|
|
||||||
}
|
|
||||||
|
|
||||||
var t = Object(this);
|
|
||||||
var len = t.length >>> 0;
|
|
||||||
|
|
||||||
if (len === 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var n = 0;
|
|
||||||
if (arguments.length > 0) {
|
|
||||||
n = Number(arguments[1]);
|
|
||||||
if (n !== n) { // shortcut for verifying if it's NaN
|
|
||||||
n = 0;
|
|
||||||
} else if (n !== 0 && n !== (Infinity) && n !== -(Infinity)) {
|
|
||||||
n = (n > 0 || -1) * Math.floor(Math.abs(n));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n >= len) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var k = n >= 0
|
|
||||||
? n
|
|
||||||
: Math.max(len - Math.abs(n), 0);
|
|
||||||
|
|
||||||
for (; k < len; k++) {
|
|
||||||
if (k in t && t[k] === searchElement) {
|
|
||||||
return k;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Instantiate the object
|
|
||||||
window.I18n = {};
|
|
||||||
|
|
||||||
// Set default locale to english
|
|
||||||
I18n.defaultLocale = "en";
|
|
||||||
|
|
||||||
// Set default handling of translation fallbacks to false
|
|
||||||
I18n.fallbacks = false;
|
|
||||||
|
|
||||||
// Set default separator
|
|
||||||
I18n.defaultSeparator = ".";
|
|
||||||
|
|
||||||
// Set current locale to null
|
|
||||||
I18n.locale = null;
|
|
||||||
|
|
||||||
// Set the placeholder format. Accepts `{{placeholder}}` and `%{placeholder}`.
|
|
||||||
I18n.PLACEHOLDER = /(?:\{\{|%\{)(.*?)(?:\}\}?)/gm;
|
|
||||||
|
|
||||||
I18n.fallbackRules = {
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.pluralizationRules = {
|
|
||||||
en: function (n) {
|
|
||||||
return n == 0 ? ["zero", "none", "other"] : n == 1 ? "one" : "other";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.getFallbacks = function(locale) {
|
|
||||||
if (locale === I18n.defaultLocale) {
|
|
||||||
return [];
|
|
||||||
} else if (!I18n.fallbackRules[locale]) {
|
|
||||||
var rules = []
|
|
||||||
, components = locale.split("-");
|
|
||||||
|
|
||||||
for (var l = 1; l < components.length; l++) {
|
|
||||||
rules.push(components.slice(0, l).join("-"));
|
|
||||||
}
|
|
||||||
|
|
||||||
rules.push(I18n.defaultLocale);
|
|
||||||
|
|
||||||
I18n.fallbackRules[locale] = rules;
|
|
||||||
}
|
|
||||||
|
|
||||||
return I18n.fallbackRules[locale];
|
|
||||||
}
|
|
||||||
|
|
||||||
I18n.isValidNode = function(obj, node, undefined) {
|
|
||||||
return obj[node] !== null && obj[node] !== undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.lookup = function(scope, options) {
|
|
||||||
var options = options || {}
|
|
||||||
, lookupInitialScope = scope
|
|
||||||
, translations = this.prepareOptions(I18n.translations)
|
|
||||||
, locale = options.locale || I18n.currentLocale()
|
|
||||||
, messages = translations[locale] || {}
|
|
||||||
, options = this.prepareOptions(options)
|
|
||||||
, currentScope
|
|
||||||
;
|
|
||||||
|
|
||||||
if (typeof(scope) == "object") {
|
|
||||||
scope = scope.join(this.defaultSeparator);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.scope) {
|
|
||||||
scope = options.scope.toString() + this.defaultSeparator + scope;
|
|
||||||
}
|
|
||||||
|
|
||||||
scope = scope.split(this.defaultSeparator);
|
|
||||||
|
|
||||||
while (messages && scope.length > 0) {
|
|
||||||
currentScope = scope.shift();
|
|
||||||
messages = messages[currentScope];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!messages) {
|
|
||||||
if (I18n.fallbacks) {
|
|
||||||
var fallbacks = this.getFallbacks(locale);
|
|
||||||
for (var fallback = 0; fallback < fallbacks.length; fallbacks++) {
|
|
||||||
messages = I18n.lookup(lookupInitialScope, this.prepareOptions({locale: fallbacks[fallback]}, options));
|
|
||||||
if (messages) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!messages && this.isValidNode(options, "defaultValue")) {
|
|
||||||
messages = options.defaultValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return messages;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Merge serveral hash options, checking if value is set before
|
|
||||||
// overwriting any value. The precedence is from left to right.
|
|
||||||
//
|
|
||||||
// I18n.prepareOptions({name: "John Doe"}, {name: "Mary Doe", role: "user"});
|
|
||||||
// #=> {name: "John Doe", role: "user"}
|
|
||||||
//
|
|
||||||
I18n.prepareOptions = function() {
|
|
||||||
var options = {}
|
|
||||||
, opts
|
|
||||||
, count = arguments.length
|
|
||||||
;
|
|
||||||
|
|
||||||
for (var i = 0; i < count; i++) {
|
|
||||||
opts = arguments[i];
|
|
||||||
|
|
||||||
if (!opts) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var key in opts) {
|
|
||||||
if (!this.isValidNode(options, key)) {
|
|
||||||
options[key] = opts[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return options;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.interpolate = function(message, options) {
|
|
||||||
options = this.prepareOptions(options);
|
|
||||||
var matches = message.match(this.PLACEHOLDER)
|
|
||||||
, placeholder
|
|
||||||
, value
|
|
||||||
, name
|
|
||||||
;
|
|
||||||
|
|
||||||
if (!matches) {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; placeholder = matches[i]; i++) {
|
|
||||||
name = placeholder.replace(this.PLACEHOLDER, "$1");
|
|
||||||
|
|
||||||
value = options[name];
|
|
||||||
|
|
||||||
if (!this.isValidNode(options, name)) {
|
|
||||||
value = "[missing " + placeholder + " value]";
|
|
||||||
}
|
|
||||||
|
|
||||||
regex = new RegExp(placeholder.replace(/\{/gm, "\\{").replace(/\}/gm, "\\}"));
|
|
||||||
message = message.replace(regex, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return message;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.translate = function(scope, options) {
|
|
||||||
options = this.prepareOptions(options);
|
|
||||||
var translation = this.lookup(scope, options);
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (typeof(translation) == "object") {
|
|
||||||
if (typeof(options.count) == "number") {
|
|
||||||
return this.pluralize(options.count, scope, options);
|
|
||||||
} else {
|
|
||||||
return translation;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return this.interpolate(translation, options);
|
|
||||||
}
|
|
||||||
} catch(err) {
|
|
||||||
return this.missingTranslation(scope);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.localize = function(scope, value) {
|
|
||||||
switch (scope) {
|
|
||||||
case "currency":
|
|
||||||
return this.toCurrency(value);
|
|
||||||
case "number":
|
|
||||||
scope = this.lookup("number.format");
|
|
||||||
return this.toNumber(value, scope);
|
|
||||||
case "percentage":
|
|
||||||
return this.toPercentage(value);
|
|
||||||
default:
|
|
||||||
if (scope.match(/^(date|time)/)) {
|
|
||||||
return this.toTime(scope, value);
|
|
||||||
} else {
|
|
||||||
return value.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.parseDate = function(date) {
|
|
||||||
var matches, convertedDate;
|
|
||||||
|
|
||||||
// we have a date, so just return it.
|
|
||||||
if (typeof(date) == "object") {
|
|
||||||
return date;
|
|
||||||
};
|
|
||||||
|
|
||||||
// it matches the following formats:
|
|
||||||
// yyyy-mm-dd
|
|
||||||
// yyyy-mm-dd[ T]hh:mm::ss
|
|
||||||
// yyyy-mm-dd[ T]hh:mm::ss
|
|
||||||
// yyyy-mm-dd[ T]hh:mm::ssZ
|
|
||||||
// yyyy-mm-dd[ T]hh:mm::ss+0000
|
|
||||||
//
|
|
||||||
matches = date.toString().match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2}))?(Z|\+0000)?/);
|
|
||||||
|
|
||||||
if (matches) {
|
|
||||||
for (var i = 1; i <= 6; i++) {
|
|
||||||
matches[i] = parseInt(matches[i], 10) || 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// month starts on 0
|
|
||||||
matches[2] -= 1;
|
|
||||||
|
|
||||||
if (matches[7]) {
|
|
||||||
convertedDate = new Date(Date.UTC(matches[1], matches[2], matches[3], matches[4], matches[5], matches[6]));
|
|
||||||
} else {
|
|
||||||
convertedDate = new Date(matches[1], matches[2], matches[3], matches[4], matches[5], matches[6]);
|
|
||||||
}
|
|
||||||
} else if (typeof(date) == "number") {
|
|
||||||
// UNIX timestamp
|
|
||||||
convertedDate = new Date();
|
|
||||||
convertedDate.setTime(date);
|
|
||||||
} else if (date.match(/\d+ \d+:\d+:\d+ [+-]\d+ \d+/)) {
|
|
||||||
// a valid javascript format with timezone info
|
|
||||||
convertedDate = new Date();
|
|
||||||
convertedDate.setTime(Date.parse(date))
|
|
||||||
} else {
|
|
||||||
// an arbitrary javascript string
|
|
||||||
convertedDate = new Date();
|
|
||||||
convertedDate.setTime(Date.parse(date));
|
|
||||||
}
|
|
||||||
|
|
||||||
return convertedDate;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.toTime = function(scope, d) {
|
|
||||||
var date = this.parseDate(d)
|
|
||||||
, format = this.lookup(scope)
|
|
||||||
;
|
|
||||||
|
|
||||||
if (date.toString().match(/invalid/i)) {
|
|
||||||
return date.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!format) {
|
|
||||||
return date.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.strftime(date, format);
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.strftime = function(date, format) {
|
|
||||||
var options = this.lookup("date");
|
|
||||||
|
|
||||||
if (!options) {
|
|
||||||
return date.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
options.meridian = options.meridian || ["AM", "PM"];
|
|
||||||
|
|
||||||
var weekDay = date.getDay()
|
|
||||||
, day = date.getDate()
|
|
||||||
, year = date.getFullYear()
|
|
||||||
, month = date.getMonth() + 1
|
|
||||||
, hour = date.getHours()
|
|
||||||
, hour12 = hour
|
|
||||||
, meridian = hour > 11 ? 1 : 0
|
|
||||||
, secs = date.getSeconds()
|
|
||||||
, mins = date.getMinutes()
|
|
||||||
, offset = date.getTimezoneOffset()
|
|
||||||
, absOffsetHours = Math.floor(Math.abs(offset / 60))
|
|
||||||
, absOffsetMinutes = Math.abs(offset) - (absOffsetHours * 60)
|
|
||||||
, timezoneoffset = (offset > 0 ? "-" : "+") + (absOffsetHours.toString().length < 2 ? "0" + absOffsetHours : absOffsetHours) + (absOffsetMinutes.toString().length < 2 ? "0" + absOffsetMinutes : absOffsetMinutes)
|
|
||||||
;
|
|
||||||
|
|
||||||
if (hour12 > 12) {
|
|
||||||
hour12 = hour12 - 12;
|
|
||||||
} else if (hour12 === 0) {
|
|
||||||
hour12 = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
var padding = function(n) {
|
|
||||||
var s = "0" + n.toString();
|
|
||||||
return s.substr(s.length - 2);
|
|
||||||
};
|
|
||||||
|
|
||||||
var f = format;
|
|
||||||
f = f.replace("%a", options.abbr_day_names[weekDay]);
|
|
||||||
f = f.replace("%A", options.day_names[weekDay]);
|
|
||||||
f = f.replace("%b", options.abbr_month_names[month]);
|
|
||||||
f = f.replace("%B", options.month_names[month]);
|
|
||||||
f = f.replace("%d", padding(day));
|
|
||||||
f = f.replace("%e", day);
|
|
||||||
f = f.replace("%-d", day);
|
|
||||||
f = f.replace("%H", padding(hour));
|
|
||||||
f = f.replace("%-H", hour);
|
|
||||||
f = f.replace("%I", padding(hour12));
|
|
||||||
f = f.replace("%-I", hour12);
|
|
||||||
f = f.replace("%m", padding(month));
|
|
||||||
f = f.replace("%-m", month);
|
|
||||||
f = f.replace("%M", padding(mins));
|
|
||||||
f = f.replace("%-M", mins);
|
|
||||||
f = f.replace("%p", options.meridian[meridian]);
|
|
||||||
f = f.replace("%S", padding(secs));
|
|
||||||
f = f.replace("%-S", secs);
|
|
||||||
f = f.replace("%w", weekDay);
|
|
||||||
f = f.replace("%y", padding(year));
|
|
||||||
f = f.replace("%-y", padding(year).replace(/^0+/, ""));
|
|
||||||
f = f.replace("%Y", year);
|
|
||||||
f = f.replace("%z", timezoneoffset);
|
|
||||||
|
|
||||||
return f;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.toNumber = function(number, options) {
|
|
||||||
options = this.prepareOptions(
|
|
||||||
options,
|
|
||||||
this.lookup("number.format"),
|
|
||||||
{precision: 3, separator: ".", delimiter: ",", strip_insignificant_zeros: false}
|
|
||||||
);
|
|
||||||
|
|
||||||
var negative = number < 0
|
|
||||||
, string = Math.abs(number).toFixed(options.precision).toString()
|
|
||||||
, parts = string.split(".")
|
|
||||||
, precision
|
|
||||||
, buffer = []
|
|
||||||
, formattedNumber
|
|
||||||
;
|
|
||||||
|
|
||||||
number = parts[0];
|
|
||||||
precision = parts[1];
|
|
||||||
|
|
||||||
while (number.length > 0) {
|
|
||||||
buffer.unshift(number.substr(Math.max(0, number.length - 3), 3));
|
|
||||||
number = number.substr(0, number.length -3);
|
|
||||||
}
|
|
||||||
|
|
||||||
formattedNumber = buffer.join(options.delimiter);
|
|
||||||
|
|
||||||
if (options.precision > 0) {
|
|
||||||
formattedNumber += options.separator + parts[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (negative) {
|
|
||||||
formattedNumber = "-" + formattedNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.strip_insignificant_zeros) {
|
|
||||||
var regex = {
|
|
||||||
separator: new RegExp(options.separator.replace(/\./, "\\.") + "$")
|
|
||||||
, zeros: /0+$/
|
|
||||||
};
|
|
||||||
|
|
||||||
formattedNumber = formattedNumber
|
|
||||||
.replace(regex.zeros, "")
|
|
||||||
.replace(regex.separator, "")
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
return formattedNumber;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.toCurrency = function(number, options) {
|
|
||||||
options = this.prepareOptions(
|
|
||||||
options,
|
|
||||||
this.lookup("number.currency.format"),
|
|
||||||
this.lookup("number.format"),
|
|
||||||
{unit: "$", precision: 2, format: "%u%n", delimiter: ",", separator: "."}
|
|
||||||
);
|
|
||||||
|
|
||||||
number = this.toNumber(number, options);
|
|
||||||
number = options.format
|
|
||||||
.replace("%u", options.unit)
|
|
||||||
.replace("%n", number)
|
|
||||||
;
|
|
||||||
|
|
||||||
return number;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.toHumanSize = function(number, options) {
|
|
||||||
var kb = 1024
|
|
||||||
, size = number
|
|
||||||
, iterations = 0
|
|
||||||
, unit
|
|
||||||
, precision
|
|
||||||
;
|
|
||||||
|
|
||||||
while (size >= kb && iterations < 4) {
|
|
||||||
size = size / kb;
|
|
||||||
iterations += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iterations === 0) {
|
|
||||||
unit = this.t("number.human.storage_units.units.byte", {count: size});
|
|
||||||
precision = 0;
|
|
||||||
} else {
|
|
||||||
unit = this.t("number.human.storage_units.units." + [null, "kb", "mb", "gb", "tb"][iterations]);
|
|
||||||
precision = (size - Math.floor(size) === 0) ? 0 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
options = this.prepareOptions(
|
|
||||||
options,
|
|
||||||
{precision: precision, format: "%n%u", delimiter: ""}
|
|
||||||
);
|
|
||||||
|
|
||||||
number = this.toNumber(size, options);
|
|
||||||
number = options.format
|
|
||||||
.replace("%u", unit)
|
|
||||||
.replace("%n", number)
|
|
||||||
;
|
|
||||||
|
|
||||||
return number;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.toPercentage = function(number, options) {
|
|
||||||
options = this.prepareOptions(
|
|
||||||
options,
|
|
||||||
this.lookup("number.percentage.format"),
|
|
||||||
this.lookup("number.format"),
|
|
||||||
{precision: 3, separator: ".", delimiter: ""}
|
|
||||||
);
|
|
||||||
|
|
||||||
number = this.toNumber(number, options);
|
|
||||||
return number + "%";
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.pluralizer = function(locale) {
|
|
||||||
pluralizer = this.pluralizationRules[locale];
|
|
||||||
if (pluralizer !== undefined) return pluralizer;
|
|
||||||
return this.pluralizationRules["en"];
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.findAndTranslateValidNode = function(keys, translation) {
|
|
||||||
for (i = 0; i < keys.length; i++) {
|
|
||||||
key = keys[i];
|
|
||||||
if (this.isValidNode(translation, key)) return translation[key];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.pluralize = function(count, scope, options) {
|
|
||||||
var translation;
|
|
||||||
|
|
||||||
try {
|
|
||||||
translation = this.lookup(scope, options);
|
|
||||||
} catch (error) {}
|
|
||||||
|
|
||||||
if (!translation) {
|
|
||||||
return this.missingTranslation(scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
var message;
|
|
||||||
options = this.prepareOptions(options);
|
|
||||||
options.count = count.toString();
|
|
||||||
|
|
||||||
pluralizer = this.pluralizer(this.currentLocale());
|
|
||||||
key = pluralizer(Math.abs(count));
|
|
||||||
keys = ((typeof key == "object") && (key instanceof Array)) ? key : [key];
|
|
||||||
|
|
||||||
message = this.findAndTranslateValidNode(keys, translation);
|
|
||||||
if (message == null) message = this.missingTranslation(scope, keys[0]);
|
|
||||||
|
|
||||||
return this.interpolate(message, options);
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.missingTranslation = function() {
|
|
||||||
var message = '[missing "' + this.currentLocale()
|
|
||||||
, count = arguments.length
|
|
||||||
;
|
|
||||||
|
|
||||||
for (var i = 0; i < count; i++) {
|
|
||||||
message += "." + arguments[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
message += '" translation]';
|
|
||||||
|
|
||||||
return message;
|
|
||||||
};
|
|
||||||
|
|
||||||
I18n.currentLocale = function() {
|
|
||||||
return (I18n.locale || I18n.defaultLocale);
|
|
||||||
};
|
|
||||||
|
|
||||||
// shortcuts
|
|
||||||
I18n.t = I18n.translate;
|
|
||||||
I18n.l = I18n.localize;
|
|
||||||
I18n.p = I18n.pluralize;
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ $color-bg-log-hover: $gray-dark-2
|
||||||
$color-bg-log-highlight: $gray-dark-3
|
$color-bg-log-highlight: $gray-dark-3
|
||||||
$color-bg-log-fold-highlight: $gray-dark-4
|
$color-bg-log-fold-highlight: $gray-dark-4
|
||||||
$color-bg-slider: $slate-blue-3
|
$color-bg-slider: $slate-blue-3
|
||||||
$color-bg-left: $gray-light-4
|
$color-bg-left: #fbfbfa
|
||||||
$color-bg-list-odd: $white
|
$color-bg-list-odd: $white
|
||||||
$color-bg-list-even: $gray-light-3
|
$color-bg-list-even: $gray-light-3
|
||||||
$color-bg-hooks-odd: $slate-blue-4
|
$color-bg-hooks-odd: $slate-blue-4
|
||||||
|
|
|
@ -10,22 +10,29 @@
|
||||||
|
|
||||||
img
|
img
|
||||||
float: left
|
float: left
|
||||||
width: 48px
|
width: 100px
|
||||||
height: 48px
|
height: 100px
|
||||||
margin: 3px 20px 0 0
|
margin: 3px 20px 0 0
|
||||||
@include border-radius(4px)
|
@include border-radius(100px)
|
||||||
background-color: $color-bg-light
|
background-color: $color-bg-light
|
||||||
|
|
||||||
dl.profile
|
dl.profile
|
||||||
display: table
|
display: table
|
||||||
|
font-size: 18px
|
||||||
|
line-height: 30px
|
||||||
margin: 0 0 20px 0
|
margin: 0 0 20px 0
|
||||||
div
|
div
|
||||||
display: table-row
|
display: table-row
|
||||||
dt
|
dt
|
||||||
|
color: #939386
|
||||||
|
font-weight: 600
|
||||||
display: table-cell
|
display: table-cell
|
||||||
padding-right: 20px
|
padding-right: 20px
|
||||||
dd
|
dd
|
||||||
margin-left: 0
|
margin-left: 0
|
||||||
|
color: #337389
|
||||||
|
a
|
||||||
|
color: #337389
|
||||||
|
|
||||||
form
|
form
|
||||||
clear: left
|
clear: left
|
||||||
|
|
Loading…
Reference in New Issue
Block a user