lalala 4.0.0.dev.219 → 4.0.0.dev.224

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2969d2b645a0bab2323339ced97cf5002d00d8ac
4
- data.tar.gz: e7e9af80812c9dd7f86e04e07b0ccc5b31a51bcc
3
+ metadata.gz: a7314e8f7a9befcc525c6329eeba49e2b2086ac9
4
+ data.tar.gz: 8e22778b81fc3a18e08931add4f53da8a11aa6d2
5
5
  SHA512:
6
- metadata.gz: 7a8efe82b6c8a32d7e88a10fb6db2e8a3c5eb01b78828210c872593a48f7d2a5e436c049ac939b03f250ab22fc32579709bc98e58174015b94b8016fd9b790f4
7
- data.tar.gz: d8a16664d3f1695c191cf6d26ef3e74d7d395de146ae147eebfaa9be0cb0bf8a6e9b6c89454f8a9c99975f85f55216474c23420ff10b7910e97479b009db3f2b
6
+ metadata.gz: 511a431c0045a716b6cd1a1814e36045dfb00262246c32dcc09c4d9fb8d003f915198322f56b3a9299f57a8a24a12a56de43d045aa96f4ea872e3480c8d9c297
7
+ data.tar.gz: 408a133d383a8c593b37e12389237d7318f8a18c5fd3afa6ae359e34009978dec815e9ff1f055e42a72aa9cdc78ec576da3b3696812e10591cf84f3ce7758030
@@ -0,0 +1,40 @@
1
+ //
2
+ // Debounce (from underscore.js)
3
+ //
4
+ exports.debounce = function(func, wait, immediate) {
5
+ var timeout, args, context, timestamp, result;
6
+
7
+ // get time helper
8
+ var getTime = (Date.now || function() {
9
+ return new Date().getTime();
10
+ });
11
+
12
+ // debounce
13
+ return function() {
14
+ context = this;
15
+ args = arguments;
16
+ timestamp = getTime();
17
+ var later = function() {
18
+ var last = getTime() - timestamp;
19
+ if (last < wait) {
20
+ timeout = setTimeout(later, wait - last);
21
+ } else {
22
+ timeout = null;
23
+ if (!immediate) {
24
+ result = func.apply(context, args);
25
+ context = args = null;
26
+ }
27
+ }
28
+ };
29
+ var callNow = immediate && !timeout;
30
+ if (!timeout) {
31
+ timeout = setTimeout(later, wait);
32
+ }
33
+ if (callNow) {
34
+ result = func.apply(context, args);
35
+ context = args = null;
36
+ }
37
+
38
+ return result;
39
+ };
40
+ };
@@ -3,9 +3,11 @@ var console = require('browser/console'),
3
3
  editor = require('lalala/modules/editor'),
4
4
  grid = require('lalala/modules/grid'),
5
5
  locale_chooser = require("lalala/modules/locale_chooser"),
6
- sorted_pages_tree = require("lalala/modules/sorted_pages_tree");
6
+ sorted_pages_tree = require("lalala/modules/sorted_pages_tree"),
7
+ login = require("lalala/modules/login");
7
8
 
8
- $(function(){
9
+ $(function() {
10
+ login.init();
9
11
  locale_chooser.init();
10
12
  editor.init();
11
13
  calendar.init();
@@ -1,6 +1,7 @@
1
1
  var storage = require("lalala/modules/storage"),
2
2
  $chooser;
3
3
 
4
+
4
5
  exports.init = function(){
5
6
  $chooser = $('.locale_chooser select').first();
6
7
 
@@ -9,6 +10,7 @@ exports.init = function(){
9
10
  }
10
11
  };
11
12
 
13
+
12
14
  function setup() {
13
15
  var locale = storage.locale,
14
16
  default_locale;
@@ -35,10 +37,12 @@ function setup() {
35
37
  $chooser.on('change', on_switch_locale);
36
38
  }
37
39
 
40
+
38
41
  function on_switch_locale(e) {
39
42
  switch_locale($(this).val());
40
43
  }
41
44
 
45
+
42
46
  function switch_locale(locale) {
43
47
  var translated = $(".translated[data-locale]"),
44
48
  current = translated.filter("*[data-locale="+locale+"]"),
@@ -0,0 +1,66 @@
1
+ var Helpers = require("./helpers");
2
+
3
+
4
+
5
+ function Login(el) {
6
+ this.$el = $(el);
7
+ this.$tryout = this.$el.find(".text.tryout");
8
+
9
+ this.bind_events();
10
+ this.$el.find("input").trigger("change");
11
+ }
12
+
13
+
14
+
15
+ //
16
+ // Events
17
+ //
18
+ Login.prototype.bind_events = function() {
19
+ this.$el.on("change", "input", $.proxy(this.input_change_handler, this));
20
+ this.$el.on("keyup", "input", Helpers.debounce($.proxy(this.input_keyup_handler, this), 250));
21
+ };
22
+
23
+
24
+ Login.prototype.input_change_handler = function(e) {
25
+ var $trgt, text, width;
26
+
27
+ // input element
28
+ $trgt = $(e.currentTarget);
29
+
30
+ // text
31
+ text = $trgt.val();
32
+
33
+ if ($trgt.attr("type") == "password") {
34
+ text = new Array(text.length + 1).join("⦁");
35
+ }
36
+
37
+ this.$tryout.text(text);
38
+
39
+ // width
40
+ if (!e.currentTarget.original_width) {
41
+ e.currentTarget.original_width = $trgt.width();
42
+ }
43
+
44
+ width = this.$tryout.width();
45
+ if (width < e.currentTarget.original_width) {
46
+ width = e.currentTarget.original_width;
47
+ }
48
+
49
+ $trgt.width(width);
50
+ };
51
+
52
+
53
+ Login.prototype.input_keyup_handler = function(e) {
54
+ $(e.currentTarget).trigger("change");
55
+ };
56
+
57
+
58
+
59
+ //
60
+ // Exports
61
+ //
62
+ exports.init = function() {
63
+ $(".mod-login").each(function() {
64
+ new Login(this);
65
+ });
66
+ };
@@ -55,3 +55,22 @@
55
55
  right: $offset;
56
56
  top: $offset;
57
57
  }
58
+
59
+
60
+ //
61
+ // PLACEHOLDER STYLES (mixin)
62
+ // ----------------------
63
+ //
64
+ // Apply styles to the placeholder
65
+ //
66
+ // Usage:
67
+ // input, textarea {
68
+ // @include placeholder-styles { color: #aaa; }
69
+ // }
70
+ //
71
+ @mixin placeholder-styles {
72
+ &::-webkit-input-placeholder { @content }
73
+ &:-moz-placeholder { @content }
74
+ &::-moz-placeholder { @content }
75
+ &:-ms-input-placeholder { @content }
76
+ }
@@ -1,61 +1,183 @@
1
1
  .active_admin.logged_out.new {
2
2
 
3
- #wrapper {
4
- height: 400px;
5
- left: 50%;
6
- margin: -200px 0 0 -200px;
7
- overflow: visible;
8
- position: absolute;
9
- top: 50%;
10
- width: 400px;
3
+ //
4
+ // Containers
5
+ //
6
+ #wrapper, #content_wrapper, #active_admin_content {
7
+ @include spiderman;
11
8
  }
12
9
 
13
10
  #active_admin_content {
14
11
  background-color: transparent;
15
12
  padding: 0;
13
+ text-align: center;
16
14
  width: auto;
17
15
  }
18
16
 
19
- h2 {
20
- @include text-shadow( 1px 1px 0 rgba(0,0,0, 0.2) );
17
+ #active_admin_content:before {
18
+ content: '';
19
+ display: inline-block;
20
+ height: 100%;
21
+ vertical-align: middle;
22
+ margin-right: -0.25em; /* Adjusts for spacing */
23
+ }
24
+
25
+ .mod-login {
26
+ display: inline-block;
27
+ text-align: left;
28
+ vertical-align: middle;
29
+ width: 650px;
30
+ }
31
+
32
+
33
+ //
34
+ // Text
35
+ //
36
+ .text {
21
37
  color: white;
22
- font-size: 40px;
38
+ font-size: 50px;
23
39
  font-weight: bold;
40
+ line-height: 52px;
41
+ margin-bottom: 10px;
42
+ text-shadow: 1px 1px rgba(black, .325);
24
43
  }
25
44
 
26
- label {
27
- width: 120px;
45
+ span.text {
46
+ display: inline-block;
47
+ }
48
+
49
+ .text.tryout {
50
+ left: 0;
51
+ position: fixed;
52
+ top: 99%;
53
+ top: -moz-calc(100% - 1px);
54
+ top: -webkit-calc(100% - 1px);
55
+ top: calc(100% - 1px);
56
+ visibility: hidden;
57
+ width: auto;
58
+ }
59
+
60
+ label,
61
+ .flash {
62
+ display: none;
63
+ }
64
+
65
+ //
66
+ // Input fields
67
+ //
68
+ .input {
69
+ margin: -4px 0 0;
70
+ }
71
+
72
+ .inputs {
73
+ margin: 14px 0 0;
74
+ white-space: nowrap;
75
+ }
76
+
77
+ .inputs > ol > li {
78
+ display: inline-block;
79
+ margin-right: 13px;
80
+ }
81
+
82
+ .inputs .text {
83
+ position: relative;
84
+ top: -2px;
28
85
  }
29
86
 
30
- input[type=email],
31
- input[type=password] {
32
- @include transition( background-color 300ms );
33
- background-color: rgba(0,0,0, 0.1);
34
- font-size: 35px;
87
+ input[type="email"],
88
+ input[type="password"] {
89
+ @include box-sizing(border-box);
90
+ @include transition(background-color 600ms, border-color 600ms);
91
+
92
+ background: none;
93
+ border: 0;
94
+ border-bottom: 2px solid rgba($blue, .5);
95
+ border-radius: 0;
96
+ box-shadow: none;
97
+ color: lighten($blue, 10);
98
+ display: inline-block;
99
+ font-size: 50px;
35
100
  font-weight: bold;
36
- padding: 10px 20px;
101
+ height: 66px;
102
+ line-height: 56px;
103
+ padding: 0;
104
+ position: relative;
105
+ top: -2px;
106
+ width: 120px;
37
107
 
38
- &:focus {
39
- background-color: transparentize($yellow, 0.9);
40
- color: darken($yellow, 50%);
108
+ @include placeholder-styles {
109
+ @include transition(color 600ms, text-shadow 600ms);
110
+ color: white;
111
+ text-shadow: 1px 1px rgba(black, .325);
112
+ text-transform: lowercase;
41
113
  }
114
+ }
42
115
 
116
+ input[type="password"] {
117
+ width: 233px;
43
118
  }
44
119
 
45
- #admin_user_remember_me_input {
46
- display: none;
120
+ input[type="email"],
121
+ input[type="password"] { &:focus {
122
+ @include placeholder-styles {
123
+ color: rgba(white, .75);
124
+ text-shadow: 1px 1px rgba(black, .05);
125
+ }
126
+ }}
127
+
128
+ //
129
+ // Actions
130
+ //
131
+ .actions {
132
+ margin: 90px 0 0 -50px;
133
+ position: relative;
134
+
135
+ button, .version {
136
+ @include transition(background-color 600ms);
137
+ }
47
138
  }
48
139
 
49
- input[name="commit"] {
50
- background-image: none;
51
- font-size: 20px;
52
- margin-top: 10px;
53
- padding-left: 12px;
140
+ .actions button {
141
+ background: #bbb image-url("lalala/overlay-logo.png") 0 0;
142
+ border: 0;
143
+ border-radius: 10px;
144
+ cursor: pointer;
145
+ display: block;
146
+ height: 90px;
147
+ outline: none;
148
+ text-indent: -9999px;
149
+ width: 280px;
54
150
  }
55
151
 
56
- .flash {
152
+ .actions button.error {
153
+ &, & + .version { background-color: $button_red; }
154
+ }
155
+
156
+ .actions button.glow,
157
+ .actions button:focus,
158
+ .actions button:hover { &, & + .version {
159
+ background-color: rgba($blue, .5);
160
+ }}
161
+
162
+ .actions .version {
163
+ @include background-image(
164
+ linear-gradient(rgba(black, 0), rgba(black, .125))
165
+ );
166
+
167
+ background-color: #bbb;
168
+ border-bottom: 1px solid rgba(black, .25);
169
+ border-radius: 10px;
170
+ color: white;
171
+ display: inline-block;
172
+ font-size: 10px;
173
+ font-weight: bold;
174
+ height: 16px;
175
+ left: 235px;
176
+ line-height: 16px;
177
+ padding: 1px 9px 0;
57
178
  position: absolute;
58
- top: -70px;
179
+ text-shadow: 1px 1px rgba(black, .3);
180
+ top: -19px;
59
181
  }
60
182
 
61
183
  }
@@ -30,8 +30,31 @@
30
30
  }
31
31
 
32
32
  .locale_chooser {
33
+ border-left: 1px solid #dcdcdc;
33
34
  float: right;
34
- padding: 14px 12px 14px 0;
35
+ }
36
+ }
37
+
38
+ //
39
+ // Locale chooser
40
+ //
41
+ .locale_chooser select {
42
+ @include appearance(none);
43
+
44
+ border: 0;
45
+ border-radius: 0;
46
+ color: black;
47
+ cursor: pointer;
48
+ display: inline-block;
49
+ font-weight: bold;
50
+ height: $top_nav_height;
51
+ line-height: $top_nav_height + 2;
52
+ padding: 0 24px;
53
+ vertical-align: top;
54
+
55
+ &:focus {
56
+ border: none;
57
+ box-shadow: none;
35
58
  }
36
59
  }
37
60
 
@@ -59,7 +82,7 @@
59
82
  }
60
83
 
61
84
  //
62
- // Current page title
85
+ // Current page title
63
86
  //
64
87
  h2 {
65
88
  color: gray(211);
@@ -0,0 +1,43 @@
1
+ <div class="mod-login">
2
+ <% scope = Devise::Mapping.find_scope!(resource_name) %>
3
+ <%= active_admin_form_for(resource, :as => resource_name, :url => send(:"#{scope}_session_path"), :html => { :id => "session_new" }) do |f|
4
+ alert = flash.now[:alert]
5
+ button_css_class = (alert && alert.to_s.downcase.include?("invalid")) ? "error" : ""
6
+
7
+ f.form_buffers.last << raw(<<-EOS
8
+ <div class="text">
9
+ #{ t("login.a") }
10
+ </div>
11
+ EOS
12
+ )
13
+
14
+ f.inputs do
15
+ resource.class.authentication_keys.each { |key|
16
+ f.input key, input_html: {
17
+ placeholder: t('active_admin.devise.login.title'),
18
+ autofocus: true
19
+ }
20
+ }
21
+
22
+ f.form_buffers.last << raw("<span class=\"text\">#{ t("login.b") }</span>")
23
+ f.form_buffers.last << raw("<br>")
24
+
25
+ f.input :password, input_html: {
26
+ placeholder: "Password"
27
+ }
28
+
29
+ f.form_buffers.last << raw("<span class=\"text\">#{ t("login.c") }</span>")
30
+ end
31
+
32
+ f.form_buffers.last << raw(<<-EOS
33
+ <fieldset class="actions">
34
+ <button type="submit" class="#{ button_css_class }">#{ t('active_admin.devise.login.submit') }</button>
35
+ <span class="version">VERSION #{ Lalala::BUILD_VERSION }</span>
36
+ </fieldset>
37
+ EOS
38
+ )
39
+ end
40
+ %>
41
+
42
+ <div class="text tryout"></div>
43
+ </div>
@@ -0,0 +1,512 @@
1
+ en:
2
+ login:
3
+ a: "Hello you,<br> can I have your"
4
+ b: "and"
5
+ c: "?"
6
+
7
+ i18n:
8
+ languages:
9
+ ab: "Abkhazian"
10
+ ace: "Achinese"
11
+ ach: "Acoli"
12
+ ada: "Adangme"
13
+ ady: "Adyghe"
14
+ ae: "Avestan"
15
+ af: "Afrikaans"
16
+ afa: "Afro-Asiatic Language"
17
+ afh: "Afrihili"
18
+ ain: "Ainu"
19
+ ak: "Akan"
20
+ akk: "Akkadian"
21
+ ale: "Aleut"
22
+ alg: "Algonquian Language"
23
+ alt: "Southern Altai"
24
+ am: "Amharic"
25
+ an: "Aragonese"
26
+ ang: "Old English"
27
+ anp: "Angika"
28
+ apa: "Apache Language"
29
+ ar: "Arabic"
30
+ arc: "Aramaic"
31
+ arn: "Araucanian"
32
+ arp: "Arapaho"
33
+ art: "Artificial Language"
34
+ arw: "Arawak"
35
+ as: "Assamese"
36
+ ast: "Asturian"
37
+ ath: "Athapascan Language"
38
+ aus: "Australian Language"
39
+ av: "Avaric"
40
+ awa: "Awadhi"
41
+ ay: "Aymara"
42
+ az: "Azerbaijani"
43
+ ba: "Bashkir"
44
+ bad: "Banda"
45
+ bai: "Bamileke Language"
46
+ bal: "Baluchi"
47
+ ban: "Balinese"
48
+ bas: "Basa"
49
+ bat: "Baltic Language"
50
+ be: "Belarusian"
51
+ bej: "Beja"
52
+ bem: "Bemba"
53
+ ber: "Berber"
54
+ bg: "Bulgarian"
55
+ bh: "Bihari"
56
+ bho: "Bhojpuri"
57
+ bi: "Bislama"
58
+ bik: "Bikol"
59
+ bin: "Bini"
60
+ bla: "Siksika"
61
+ bm: "Bambara"
62
+ bn: "Bengali"
63
+ bnt: "Bantu"
64
+ bo: "Tibetan"
65
+ br: "Breton"
66
+ bra: "Braj"
67
+ bs: "Bosnian"
68
+ btk: "Batak"
69
+ bua: "Buriat"
70
+ bug: "Buginese"
71
+ byn: "Blin"
72
+ ca: "Catalan"
73
+ cad: "Caddo"
74
+ cai: "Central American Indian Language"
75
+ car: "Carib"
76
+ cau: "Caucasian Language"
77
+ cch: "Atsam"
78
+ ce: "Chechen"
79
+ ceb: "Cebuano"
80
+ cel: "Celtic Language"
81
+ ch: "Chamorro"
82
+ chb: "Chibcha"
83
+ chg: "Chagatai"
84
+ chk: "Chuukese"
85
+ chm: "Mari"
86
+ chn: "Chinook Jargon"
87
+ cho: "Choctaw"
88
+ chp: "Chipewyan"
89
+ chr: "Cherokee"
90
+ chy: "Cheyenne"
91
+ cmc: "Chamic Language"
92
+ co: "Corsican"
93
+ cop: "Coptic"
94
+ cpe: "English-based Creole or Pidgin"
95
+ cpf: "French-based Creole or Pidgin"
96
+ cpp: "Portuguese-based Creole or Pidgin"
97
+ cr: "Cree"
98
+ crh: "Crimean Turkish"
99
+ crp: "Creole or Pidgin"
100
+ cs: "Czech"
101
+ csb: "Kashubian"
102
+ cu: "Church Slavic"
103
+ cus: "Cushitic Language"
104
+ cv: "Chuvash"
105
+ cy: "Welsh"
106
+ da: "Danish"
107
+ dak: "Dakota"
108
+ dar: "Dargwa"
109
+ day: "Dayak"
110
+ de: "German"
111
+ "de-AT": "Austrian German"
112
+ "de-CH": "Swiss High German"
113
+ del: "Delaware"
114
+ den: "Slave"
115
+ dgr: "Dogrib"
116
+ din: "Dinka"
117
+ doi: "Dogri"
118
+ dra: "Dravidian Language"
119
+ dsb: "Lower Sorbian"
120
+ dua: "Duala"
121
+ dum: "Middle Dutch"
122
+ dv: "Divehi"
123
+ dyu: "Dyula"
124
+ dz: "Dzongkha"
125
+ ee: "Ewe"
126
+ efi: "Efik"
127
+ egy: "Ancient Egyptian"
128
+ eka: "Ekajuk"
129
+ el: "Greek"
130
+ elx: "Elamite"
131
+ en: "English"
132
+ "en-AU": "Australian English"
133
+ "en-CA": "Canadian English"
134
+ "en-GB": "British English"
135
+ "en-US": "U.S. English"
136
+ enm: "Middle English"
137
+ eo: "Esperanto"
138
+ es: "Spanish"
139
+ "es-ES": "Iberian Spanish"
140
+ et: "Estonian"
141
+ eu: "Basque"
142
+ ewo: "Ewondo"
143
+ fa: "Persian"
144
+ fan: "Fang"
145
+ fat: "Fanti"
146
+ ff: "Fulah"
147
+ fi: "Finnish"
148
+ fil: "Filipino"
149
+ fiu: "Finno-Ugrian Language"
150
+ fj: "Fijian"
151
+ fo: "Faroese"
152
+ fon: "Fon"
153
+ fr: "French"
154
+ "fr-CA": "Canadian French"
155
+ "fr-CH": "Swiss French"
156
+ frm: "Middle French"
157
+ fro: "Old French"
158
+ frr: "Northern Frisian"
159
+ frs: "Eastern Frisian"
160
+ fur: "Friulian"
161
+ fy: "Western Frisian"
162
+ ga: "Irish"
163
+ gaa: "Ga"
164
+ gay: "Gayo"
165
+ gba: "Gbaya"
166
+ gd: "Scottish Gaelic"
167
+ gem: "Germanic Language"
168
+ gez: "Geez"
169
+ gil: "Gilbertese"
170
+ gl: "Galician"
171
+ gmh: "Middle High German"
172
+ gn: "Guarani"
173
+ goh: "Old High German"
174
+ gon: "Gondi"
175
+ gor: "Gorontalo"
176
+ got: "Gothic"
177
+ grb: "Grebo"
178
+ grc: "Ancient Greek"
179
+ gsw: "Swiss German"
180
+ gu: "Gujarati"
181
+ gv: "Manx"
182
+ gwi: "Gwichʼin"
183
+ ha: "Hausa"
184
+ hai: "Haida"
185
+ haw: "Hawaiian"
186
+ he: "Hebrew"
187
+ hi: "Hindi"
188
+ hil: "Hiligaynon"
189
+ him: "Himachali"
190
+ hit: "Hittite"
191
+ hmn: "Hmong"
192
+ ho: "Hiri Motu"
193
+ hr: "Croatian"
194
+ hsb: "Upper Sorbian"
195
+ ht: "Haitian"
196
+ hu: "Hungarian"
197
+ hup: "Hupa"
198
+ hy: "Armenian"
199
+ hz: "Herero"
200
+ ia: "Interlingua"
201
+ iba: "Iban"
202
+ id: "Indonesian"
203
+ ie: "Interlingue"
204
+ ig: "Igbo"
205
+ ii: "Sichuan Yi"
206
+ ijo: "Ijo"
207
+ ik: "Inupiaq"
208
+ ilo: "Iloko"
209
+ inc: "Indic Language"
210
+ ine: "Indo-European Language"
211
+ inh: "Ingush"
212
+ io: "Ido"
213
+ ira: "Iranian Language"
214
+ iro: "Iroquoian Language"
215
+ is: "Icelandic"
216
+ it: "Italian"
217
+ iu: "Inuktitut"
218
+ ja: "Japanese"
219
+ jbo: "Lojban"
220
+ jpr: "Judeo-Persian"
221
+ jrb: "Judeo-Arabic"
222
+ jv: "Javanese"
223
+ ka: "Georgian"
224
+ kaa: "Kara-Kalpak"
225
+ kab: "Kabyle"
226
+ kac: "Kachin"
227
+ kaj: "Jju"
228
+ kam: "Kamba"
229
+ kar: "Karen"
230
+ kaw: "Kawi"
231
+ kbd: "Kabardian"
232
+ kcg: "Tyap"
233
+ kfo: "Koro"
234
+ kg: "Kongo"
235
+ kha: "Khasi"
236
+ khi: "Khoisan Language"
237
+ kho: "Khotanese"
238
+ ki: "Kikuyu"
239
+ kj: "Kuanyama"
240
+ kk: "Kazakh"
241
+ kl: "Kalaallisut"
242
+ km: "Khmer"
243
+ kmb: "Kimbundu"
244
+ kn: "Kannada"
245
+ ko: "Korean"
246
+ kok: "Konkani"
247
+ kos: "Kosraean"
248
+ kpe: "Kpelle"
249
+ kr: "Kanuri"
250
+ krc: "Karachay-Balkar"
251
+ krl: "Karelian"
252
+ kro: "Kru"
253
+ kru: "Kurukh"
254
+ ks: "Kashmiri"
255
+ ku: "Kurdish"
256
+ kum: "Kumyk"
257
+ kut: "Kutenai"
258
+ kv: "Komi"
259
+ kw: "Cornish"
260
+ ky: "Kirghiz"
261
+ la: "Latin"
262
+ lad: "Ladino"
263
+ lah: "Lahnda"
264
+ lam: "Lamba"
265
+ lb: "Luxembourgish"
266
+ lez: "Lezghian"
267
+ lg: "Ganda"
268
+ li: "Limburgish"
269
+ ln: "Lingala"
270
+ lo: "Lao"
271
+ lol: "Mongo"
272
+ loz: "Lozi"
273
+ lt: "Lithuanian"
274
+ lu: "Luba-Katanga"
275
+ lua: "Luba-Lulua"
276
+ lui: "Luiseno"
277
+ lun: "Lunda"
278
+ luo: "Luo"
279
+ lus: "Lushai"
280
+ lv: "Latvian"
281
+ mad: "Madurese"
282
+ mag: "Magahi"
283
+ mai: "Maithili"
284
+ mak: "Makasar"
285
+ man: "Mandingo"
286
+ map: "Austronesian Language"
287
+ mas: "Masai"
288
+ mdf: "Moksha"
289
+ mdr: "Mandar"
290
+ men: "Mende"
291
+ mg: "Malagasy"
292
+ mga: "Middle Irish"
293
+ mh: "Marshallese"
294
+ mi: "Maori"
295
+ mic: "Micmac"
296
+ min: "Minangkabau"
297
+ mis: "Miscellaneous Language"
298
+ mk: "Macedonian"
299
+ mkh: "Mon-Khmer Language"
300
+ ml: "Malayalam"
301
+ mn: "Mongolian"
302
+ mnc: "Manchu"
303
+ mni: "Manipuri"
304
+ mno: "Manobo Language"
305
+ mo: "Moldavian"
306
+ moh: "Mohawk"
307
+ mos: "Mossi"
308
+ mr: "Marathi"
309
+ ms: "Malay"
310
+ mt: "Maltese"
311
+ mul: "Multiple Languages"
312
+ mun: "Munda Language"
313
+ mus: "Creek"
314
+ mwl: "Mirandese"
315
+ mwr: "Marwari"
316
+ my: "Burmese"
317
+ myn: "Mayan Language"
318
+ myv: "Erzya"
319
+ na: "Nauru"
320
+ nah: "Nahuatl"
321
+ nai: "North American Indian Language"
322
+ nap: "Neapolitan"
323
+ nb: "Norwegian Bokmål"
324
+ nd: "North Ndebele"
325
+ nds: "Low German"
326
+ ne: "Nepali"
327
+ new: "Newari"
328
+ ng: "Ndonga"
329
+ nia: "Nias"
330
+ nic: "Niger-Kordofanian Language"
331
+ niu: "Niuean"
332
+ nl: "Dutch"
333
+ "nl-BE": "Flemish"
334
+ nn: "Norwegian Nynorsk"
335
+ no: "Norwegian"
336
+ nog: "Nogai"
337
+ non: "Old Norse"
338
+ nqo: "N’Ko"
339
+ nr: "South Ndebele"
340
+ nso: "Northern Sotho"
341
+ nub: "Nubian Language"
342
+ nv: "Navajo"
343
+ nwc: "Classical Newari"
344
+ ny: "Nyanja"
345
+ nym: "Nyamwezi"
346
+ nyn: "Nyankole"
347
+ nyo: "Nyoro"
348
+ nzi: "Nzima"
349
+ oc: "Occitan"
350
+ oj: "Ojibwa"
351
+ om: "Oromo"
352
+ or: "Oriya"
353
+ os: "Ossetic"
354
+ osa: "Osage"
355
+ ota: "Ottoman Turkish"
356
+ oto: "Otomian Language"
357
+ pa: "Punjabi"
358
+ paa: "Papuan Language"
359
+ pag: "Pangasinan"
360
+ pal: "Pahlavi"
361
+ pam: "Pampanga"
362
+ pap: "Papiamento"
363
+ pau: "Palauan"
364
+ peo: "Old Persian"
365
+ phi: "Philippine Language"
366
+ phn: "Phoenician"
367
+ pi: "Pali"
368
+ pl: "Polish"
369
+ pon: "Pohnpeian"
370
+ pra: "Prakrit Language"
371
+ pro: "Old Provençal"
372
+ ps: "Pashto"
373
+ pt: "Portuguese"
374
+ "pt-BR": "Brazilian Portuguese"
375
+ "pt-PT": "Iberian Portuguese"
376
+ qu: "Quechua"
377
+ raj: "Rajasthani"
378
+ rap: "Rapanui"
379
+ rar: "Rarotongan"
380
+ rm: "Rhaeto-Romance"
381
+ rn: "Rundi"
382
+ ro: "Romanian"
383
+ roa: "Romance Language"
384
+ rom: "Romany"
385
+ ru: "Russian"
386
+ rup: "Aromanian"
387
+ rw: "Kinyarwanda"
388
+ sa: "Sanskrit"
389
+ sad: "Sandawe"
390
+ sah: "Yakut"
391
+ sai: "South American Indian Language"
392
+ sal: "Salishan Language"
393
+ sam: "Samaritan Aramaic"
394
+ sas: "Sasak"
395
+ sat: "Santali"
396
+ sc: "Sardinian"
397
+ scn: "Sicilian"
398
+ sco: "Scots"
399
+ sd: "Sindhi"
400
+ se: "Northern Sami"
401
+ sel: "Selkup"
402
+ sem: "Semitic Language"
403
+ sg: "Sango"
404
+ sga: "Old Irish"
405
+ sgn: "Sign Language"
406
+ sh: "Serbo-Croatian"
407
+ shn: "Shan"
408
+ si: "Sinhala"
409
+ sid: "Sidamo"
410
+ sio: "Siouan Language"
411
+ sit: "Sino-Tibetan Language"
412
+ sk: "Slovak"
413
+ sl: "Slovenian"
414
+ sla: "Slavic Language"
415
+ sm: "Samoan"
416
+ sma: "Southern Sami"
417
+ smi: "Sami Language"
418
+ smj: "Lule Sami"
419
+ smn: "Inari Sami"
420
+ sms: "Skolt Sami"
421
+ sn: "Shona"
422
+ snk: "Soninke"
423
+ so: "Somali"
424
+ sog: "Sogdien"
425
+ son: "Songhai"
426
+ sq: "Albanian"
427
+ sr: "Serbian"
428
+ srn: "Sranan Tongo"
429
+ srr: "Serer"
430
+ ss: "Swati"
431
+ ssa: "Nilo-Saharan Language"
432
+ st: "Southern Sotho"
433
+ su: "Sundanese"
434
+ suk: "Sukuma"
435
+ sus: "Susu"
436
+ sux: "Sumerian"
437
+ sv: "Swedish"
438
+ sw: "Swahili"
439
+ syc: "Classical Syriac"
440
+ syr: "Syriac"
441
+ ta: "Tamil"
442
+ tai: "Tai Language"
443
+ te: "Telugu"
444
+ tem: "Timne"
445
+ ter: "Tereno"
446
+ tet: "Tetum"
447
+ tg: "Tajik"
448
+ th: "Thai"
449
+ ti: "Tigrinya"
450
+ tig: "Tigre"
451
+ tiv: "Tiv"
452
+ tk: "Turkmen"
453
+ tkl: "Tokelau"
454
+ tl: "Tagalog"
455
+ tlh: "Klingon"
456
+ tli: "Tlingit"
457
+ tmh: "Tamashek"
458
+ tn: "Tswana"
459
+ to: "Tonga"
460
+ tog: "Nyasa Tonga"
461
+ tpi: "Tok Pisin"
462
+ tr: "Turkish"
463
+ trv: "Taroko"
464
+ ts: "Tsonga"
465
+ tsi: "Tsimshian"
466
+ tt: "Tatar"
467
+ tum: "Tumbuka"
468
+ tup: "Tupi Language"
469
+ tut: "Altaic Language"
470
+ tvl: "Tuvalu"
471
+ tw: "Twi"
472
+ ty: "Tahitian"
473
+ tyv: "Tuvinian"
474
+ udm: "Udmurt"
475
+ ug: "Uighur"
476
+ uga: "Ugaritic"
477
+ uk: "Ukrainian"
478
+ umb: "Umbundu"
479
+ und: "Unknown or Invalid Language"
480
+ ur: "Urdu"
481
+ uz: "Uzbek"
482
+ vai: "Vai"
483
+ ve: "Venda"
484
+ vi: "Vietnamese"
485
+ vo: "Volapük"
486
+ vot: "Votic"
487
+ wa: "Walloon"
488
+ wak: "Wakashan Language"
489
+ wal: "Walamo"
490
+ war: "Waray"
491
+ was: "Washo"
492
+ wen: "Sorbian Language"
493
+ wo: "Wolof"
494
+ xal: "Kalmyk"
495
+ xh: "Xhosa"
496
+ yao: "Yao"
497
+ yap: "Yapese"
498
+ yi: "Yiddish"
499
+ yo: "Yoruba"
500
+ ypk: "Yupik Language"
501
+ za: "Zhuang"
502
+ zap: "Zapotec"
503
+ zbl: "Blissymbols"
504
+ zen: "Zenaga"
505
+ zh: "Chinese"
506
+ zh-Hans: "Simplified Chinese"
507
+ zh-Hant: "Traditional Chinese"
508
+ znd: "Zande"
509
+ zu: "Zulu"
510
+ zun: "Zuni"
511
+ zxx: "No linguistic content"
512
+ zza: "Zaza"
@@ -5,4 +5,5 @@ module Lalala::ExtI18n
5
5
  autoload :NegotiationAdapter
6
6
  autoload :TestNegotiationAdapter
7
7
  autoload :LocaleSource
8
+ autoload :NameForLocale
8
9
  end
@@ -0,0 +1,9 @@
1
+ module Lalala::ExtI18n::NameForLocale
2
+
3
+ def self.name_for_locale(locale)
4
+ I18n.backend.translate(locale, "i18n.languages.#{locale}", default: locale.to_s)
5
+ rescue I18n::MissingTranslationData
6
+ locale.to_s
7
+ end
8
+
9
+ end
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "219"
3
+ BUILD = "224"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
@@ -14,14 +14,14 @@ class Lalala::Views::TitleBar < ActiveAdmin::Views::TitleBar
14
14
  locales.sort!
15
15
 
16
16
  div :class => "locale_chooser" do
17
- select do
17
+ select(class: "bypass-chosen") do
18
18
 
19
19
  locales.each do |locale|
20
20
  opts = { :value => locale.to_s }
21
21
  opts[:'data-default'] = "true" if I18n.default_locale == locale
22
22
  opts[:'data-current'] = "true" if I18n.locale == locale
23
23
  option opts do
24
- text_node locale.to_s
24
+ text_node Lalala::ExtI18n::NameForLocale.name_for_locale(locale)
25
25
  end
26
26
  end
27
27
 
@@ -3,7 +3,10 @@ class Article < ActiveRecord::Base
3
3
 
4
4
  has_one_asset :image
5
5
 
6
- validates :title,
7
- presence: true
6
+ # Translations
7
+ translates :title, :body
8
+
9
+ # Validations
10
+ validates :title, presence: true
8
11
 
9
12
  end
@@ -27,7 +27,8 @@ module Dummy
27
27
 
28
28
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
29
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
- # config.i18n.default_locale = :de
30
+ config.i18n.default_locale = :en
31
+ config.i18n.available_locales = [:en, :nl]
31
32
 
32
33
  # Configure the default encoding used in templates for Ruby 1.9.
33
34
  config.encoding = "utf-8"
@@ -1,5 +1,2 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
1
  en:
5
2
  hello: "Hello world"
@@ -0,0 +1,2 @@
1
+ nl:
2
+ hello: "Hallo wereld"
@@ -0,0 +1,19 @@
1
+ class MakeArticlesTranslatable < ActiveRecord::Migration
2
+ def up
3
+ change_table :articles do |t|
4
+ t.remove :title
5
+ t.remove :body
6
+ end
7
+
8
+ Article.create_translation_table!(title: :string, body: :text)
9
+ end
10
+
11
+ def down
12
+ change_table :articles do |t|
13
+ t.string :title
14
+ t.text :body
15
+ end
16
+
17
+ drop_table :article_translations
18
+ end
19
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20131113134503) do
14
+ ActiveRecord::Schema.define(:version => 20131121092946) do
15
15
 
16
16
  create_table "active_admin_comments", :force => true do |t|
17
17
  t.string "resource_id", :null => false
@@ -47,11 +47,21 @@ ActiveRecord::Schema.define(:version => 20131113134503) do
47
47
  add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true
48
48
  add_index "admin_users", ["reset_password_token"], :name => "index_admin_users_on_reset_password_token", :unique => true
49
49
 
50
- create_table "articles", :force => true do |t|
50
+ create_table "article_translations", :force => true do |t|
51
+ t.integer "article_id"
52
+ t.string "locale"
51
53
  t.string "title"
52
54
  t.text "body"
53
55
  t.datetime "created_at", :null => false
54
56
  t.datetime "updated_at", :null => false
57
+ end
58
+
59
+ add_index "article_translations", ["article_id"], :name => "index_article_translations_on_article_id"
60
+ add_index "article_translations", ["locale"], :name => "index_article_translations_on_locale"
61
+
62
+ create_table "articles", :force => true do |t|
63
+ t.datetime "created_at", :null => false
64
+ t.datetime "updated_at", :null => false
55
65
  t.string "category"
56
66
  end
57
67
 
@@ -7,11 +7,11 @@ class ArticlesTest < ActionDispatch::IntegrationTest
7
7
  end
8
8
 
9
9
  test 'list articles' do
10
- Article.create!(title: "Hello World")
10
+ article = Article.create!(title: "Hello World")
11
11
 
12
12
  click_on('Articles')
13
13
  assert_equal 200, page.status_code
14
- assert page.has_text?('Hello World')
14
+ assert page.assert_selector('a.resource_id_link', text: article.id.to_s)
15
15
  end
16
16
 
17
17
  test 'create article' do
@@ -19,7 +19,7 @@ class ArticlesTest < ActionDispatch::IntegrationTest
19
19
  click_on('New Article')
20
20
  assert_equal('/lalala/articles/new', current_path)
21
21
 
22
- fill_in('Title', with: 'My Article')
22
+ first('input[name="article[translations_writer][en][title]"]').set('My Article')
23
23
  attach_file('Image', File.expand_path('../../fixtures/files/image.png', __FILE__))
24
24
  click_on('Create Article')
25
25
  page.save_page
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.219
4
+ version: 4.0.0.dev.224
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-11-13 00:00:00.000000000 Z
16
+ date: 2013-11-21 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activeadmin
@@ -1294,6 +1294,7 @@ files:
1294
1294
  - app/assets/images/lalala/icons/zoom.png
1295
1295
  - app/assets/images/lalala/icons/zoom_in.png
1296
1296
  - app/assets/images/lalala/icons/zoom_out.png
1297
+ - app/assets/images/lalala/overlay-logo.png
1297
1298
  - app/assets/images/lalala/users/default.jpg
1298
1299
  - app/assets/javascripts/browser/console.module.js
1299
1300
  - app/assets/javascripts/browser/document.module.js
@@ -1311,8 +1312,10 @@ files:
1311
1312
  - app/assets/javascripts/lalala/modules/calendar.module.js
1312
1313
  - app/assets/javascripts/lalala/modules/editor.module.js
1313
1314
  - app/assets/javascripts/lalala/modules/grid.module.js
1315
+ - app/assets/javascripts/lalala/modules/helpers.module.js
1314
1316
  - app/assets/javascripts/lalala/modules/init.module.js
1315
1317
  - app/assets/javascripts/lalala/modules/locale_chooser.module.js
1318
+ - app/assets/javascripts/lalala/modules/login.module.js
1316
1319
  - app/assets/javascripts/lalala/modules/sorted_pages_tree.module.js
1317
1320
  - app/assets/javascripts/lalala/modules/storage.module.js
1318
1321
  - app/assets/stylesheets/lalala/_base.css.scss
@@ -1354,6 +1357,7 @@ files:
1354
1357
  - app/models/lalala/file_asset.rb
1355
1358
  - app/models/lalala/image_asset.rb
1356
1359
  - app/models/lalala/page.rb
1360
+ - app/views/active_admin/devise/sessions/new.html.erb
1357
1361
  - app/views/lalala/markdown/cheatsheet.html.erb
1358
1362
  - app/views/lalala/markdown/preview.html.erb
1359
1363
  - app/views/lalala/public/errors/internal_server_error.html.erb
@@ -1365,6 +1369,7 @@ files:
1365
1369
  - config/initializers/carrierwave.rb
1366
1370
  - config/initializers/database.rb
1367
1371
  - config/initializers/devise.rb
1372
+ - config/locales/en.yml
1368
1373
  - config/routes.rb
1369
1374
  - db/migrate/20130321140345_devise_create_admin_users.rb
1370
1375
  - db/migrate/20130321140351_create_admin_notes.rb
@@ -1421,6 +1426,7 @@ files:
1421
1426
  - lib/lalala/ext_i18n.rb
1422
1427
  - lib/lalala/ext_i18n/input_helper.rb
1423
1428
  - lib/lalala/ext_i18n/locale_source.rb
1429
+ - lib/lalala/ext_i18n/name_for_locale.rb
1424
1430
  - lib/lalala/ext_i18n/negotiation_adapter.rb
1425
1431
  - lib/lalala/ext_i18n/test_negotiation_adapter.rb
1426
1432
  - lib/lalala/ext_rack.rb
@@ -1501,11 +1507,13 @@ files:
1501
1507
  - test/dummy/config/initializers/session_store.rb
1502
1508
  - test/dummy/config/initializers/wrap_parameters.rb
1503
1509
  - test/dummy/config/locales/en.yml
1510
+ - test/dummy/config/locales/nl.yml
1504
1511
  - test/dummy/config/routes.rb
1505
1512
  - test/dummy/db/.gitkeep
1506
1513
  - test/dummy/db/migrate/20130528092721_create_articles.rb
1507
1514
  - test/dummy/db/migrate/20130729125648_create_home_page.rb
1508
1515
  - test/dummy/db/migrate/20131113134503_add_category_to_articles.rb
1516
+ - test/dummy/db/migrate/20131121092946_make_articles_translatable.rb
1509
1517
  - test/dummy/db/schema.rb
1510
1518
  - test/dummy/lib/assets/.gitkeep
1511
1519
  - test/dummy/log/.gitkeep
@@ -1544,7 +1552,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1544
1552
  version: 1.3.1
1545
1553
  requirements: []
1546
1554
  rubyforge_project:
1547
- rubygems_version: 2.0.3
1555
+ rubygems_version: 2.1.11
1548
1556
  signing_key:
1549
1557
  specification_version: 4
1550
1558
  summary: 'Lalala: Probably the best CMS in the world.'
@@ -1592,11 +1600,13 @@ test_files:
1592
1600
  - test/dummy/config/initializers/session_store.rb
1593
1601
  - test/dummy/config/initializers/wrap_parameters.rb
1594
1602
  - test/dummy/config/locales/en.yml
1603
+ - test/dummy/config/locales/nl.yml
1595
1604
  - test/dummy/config/routes.rb
1596
1605
  - test/dummy/db/.gitkeep
1597
1606
  - test/dummy/db/migrate/20130528092721_create_articles.rb
1598
1607
  - test/dummy/db/migrate/20130729125648_create_home_page.rb
1599
1608
  - test/dummy/db/migrate/20131113134503_add_category_to_articles.rb
1609
+ - test/dummy/db/migrate/20131121092946_make_articles_translatable.rb
1600
1610
  - test/dummy/db/schema.rb
1601
1611
  - test/dummy/lib/assets/.gitkeep
1602
1612
  - test/dummy/log/.gitkeep