chr 0.4.13 → 0.4.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78fff44ae30cacabc5c9ad629bd9524c59f6aa43
4
- data.tar.gz: 1a2c7b4f80cf9014d7bec93a353e34afc6dac650
3
+ metadata.gz: 8e17c570888d2652d32bce1a7735271077be4209
4
+ data.tar.gz: a751e96a3132dd42d96990fb32b2380f84039477
5
5
  SHA512:
6
- metadata.gz: 09513cd3c2b323fbffdc1f1c21b136b0f10aa6ddff4824871e7d81acc47c967bbf22adab2853ebf446d0e4adae63b87e9c277df98b8cece601f82f61274bd4a8
7
- data.tar.gz: 21c87d145c886ff97d9215c7dc6fdb70b7617fd2fd83c9f513c0783c5b17e52a65c6649b028c0ef0678f151be26c3523efec99586e250b72b709d0d1e9153e6d
6
+ metadata.gz: bd8018b063db8d922b99215764de74064919f0f68a9473d72df5edae7be18378b2f4ae641e195da163460669a587774689bd285b8a875587bac6d2306f1d4d3d
7
+ data.tar.gz: c05d08fdd10382d47fa18c3396d5dcc38437e03ebc23a8814d772b0ad26653e3a57f9476a95f8fc56394535fd907e54635d0ca60a18dd4e011de3077a6d8838f
@@ -26,6 +26,9 @@
26
26
  # showSpinner()
27
27
  # hideSpinner()
28
28
  #
29
+ # Dependencies:
30
+ #= require ./view_tabs
31
+ #
29
32
  # -----------------------------------------------------------------------------
30
33
  class @View
31
34
  constructor: (@module, @config, @closePath, @listName) ->
@@ -149,6 +152,8 @@ class @View
149
152
  @form.initializePlugins()
150
153
 
151
154
  @_add_delete_button()
155
+ if @config.viewTabs
156
+ @_build_tabs()
152
157
  @config.onViewShow?(@)
153
158
 
154
159
 
@@ -194,6 +199,8 @@ class @View
194
199
  else
195
200
  @store.loadObject(objectId, callbacks)
196
201
 
202
+ include(View, viewTabs)
203
+
197
204
 
198
205
 
199
206
 
@@ -0,0 +1,51 @@
1
+ # -----------------------------------------------------------------------------
2
+ # VIEW TABS
3
+ # -----------------------------------------------------------------------------
4
+
5
+ @viewTabs =
6
+
7
+ # PRIVATE ===============================================
8
+
9
+ _build_tabs: ->
10
+ @$title.addClass 'title-with-tabs'
11
+
12
+ @_create_tabs()
13
+ @_activate_tab(0)
14
+
15
+
16
+ _create_tabs: ->
17
+ @tabGroups = []
18
+ groupsHash = {}
19
+
20
+ for g in @form.groups
21
+ groupsHash[g.klassName] = g
22
+
23
+ @$tabs =$ "<aside class='header-tabs'></aside>"
24
+ @$title.after @$tabs
25
+
26
+ for tab_id, tab_title of @config.viewTabs
27
+ @tabGroups.push(groupsHash[tab_id])
28
+ @$tabs.append(@_create_button(tab_title))
29
+
30
+
31
+ _create_button: (name) ->
32
+ $tabButton =$ "<a href='#'>#{ name }</a>"
33
+ $tabButton.on 'click', (e) =>
34
+ @_on_tab_click($(e.currentTarget))
35
+ e.preventDefault()
36
+ return $tabButton
37
+
38
+
39
+ _on_tab_click: ($link) ->
40
+ index = @$tabs.children().index($link)
41
+ @_activate_tab(index)
42
+
43
+
44
+ _activate_tab: (index) ->
45
+ @$tabs.children().removeClass('active')
46
+ @$tabs.find(":nth-child(#{ index + 1 })").addClass('active')
47
+
48
+ for g in @tabGroups
49
+ g.$el.hide()
50
+
51
+ @tabGroups[index].$el.show()
@@ -22,8 +22,9 @@ class @ObjectStore
22
22
 
23
23
  # PUBLIC ================================================
24
24
 
25
- loadObject: ->
26
- @_data
25
+ loadObject: (callbacks={}) ->
26
+ callbacks.onSuccess ?= $.noop
27
+ callbacks.onSuccess(@_data)
27
28
 
28
29
 
29
30
  update: (id, value, callback) ->
@@ -115,6 +115,19 @@ a { text-decoration: none; }
115
115
  .view-saving .save { visibility : hidden; }
116
116
  .view-saving .spinner { visibility : visible; }
117
117
 
118
+ .title.title-with-tabs { display: none; }
119
+
120
+ .header-tabs {
121
+ @include position(relative, 0.45em null null null);
122
+ border-radius : 4px;
123
+ overflow : hidden;
124
+ display : inline-block;
125
+ z-index : 1;
126
+
127
+ a { display : inline-block; }
128
+ }
129
+
130
+
118
131
 
119
132
  /* Mobile ------------------------------------------------------------------ */
120
133
  .header {
@@ -92,6 +92,31 @@ a {
92
92
  }
93
93
  }
94
94
 
95
+ .header-tabs {
96
+ border : 1px solid $positive-color;
97
+
98
+ a {
99
+ border-right : 1px solid $positive-color;
100
+ font-weight : $regular;
101
+ line-height : 1;
102
+ font-size : .8em;
103
+ padding : .45em .75em .55em;
104
+ color : $positive-color;
105
+
106
+ &:last-child {
107
+ border-right : none;
108
+ }
109
+
110
+ &.active {
111
+ background-color : $positive-color;
112
+ color : white;
113
+ &:hover {
114
+ color : white;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
95
120
  /* Sign in ----------------------------------------------------------------- */
96
121
 
97
122
  .signin-modal {
@@ -39,7 +39,7 @@ module Chr
39
39
 
40
40
 
41
41
  def provide_dev_prime_task
42
- copy_file 'development_seeds.rb', 'lib/tasks/development_seeds.rake'
42
+ copy_file 'dev.rake', 'lib/tasks/dev.rake'
43
43
  end
44
44
 
45
45
 
data/lib/chr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Chr
2
2
  RAILS_VERSION = "~> 4.2.4"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
- VERSION = "0.4.13"
4
+ VERSION = "0.4.14"
5
5
  end
@@ -16,7 +16,7 @@ if [ ! -f .env ]; then
16
16
  fi
17
17
 
18
18
  # Set up database and add any development seed data
19
- bundle exec rake db:setup dev:prime
19
+ bin/rake dev:prime
20
20
 
21
21
  # Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
22
22
  mkdir -p .git/safe
@@ -27,8 +27,7 @@ if ! grep --quiet --no-messages --fixed-strings 'port' .foreman; then
27
27
  fi
28
28
 
29
29
  if ! command -v foreman > /dev/null; then
30
- printf 'Foreman is not installed.\n'
31
- printf 'See https://github.com/ddollar/foreman for install instructions.\n'
30
+ gem install foreman
32
31
  fi
33
32
 
34
33
  # Only if this isn't CI
File without changes
data/templates/puma.rb CHANGED
@@ -3,8 +3,8 @@
3
3
  # The environment variable WEB_CONCURRENCY may be set to a default value based
4
4
  # on dyno size. To manually configure this value use heroku config:set
5
5
  # WEB_CONCURRENCY.
6
- workers Integer(ENV.fetch("WEB_CONCURRENCY", 3))
7
- threads_count = Integer(ENV.fetch("MAX_THREADS", 5))
6
+ workers Integer(ENV.fetch("WEB_CONCURRENCY", 2))
7
+ threads_count = Integer(ENV.fetch("MAX_THREADS", 2))
8
8
  threads(threads_count, threads_count)
9
9
 
10
10
  preload_app!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.13
4
+ version: 0.4.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-10 00:00:00.000000000 Z
13
+ date: 2015-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -297,6 +297,7 @@ files:
297
297
  - app/assets/javascripts/chr/module.coffee
298
298
  - app/assets/javascripts/chr/utils.coffee
299
299
  - app/assets/javascripts/chr/view.coffee
300
+ - app/assets/javascripts/chr/view_tabs.coffee
300
301
  - app/assets/javascripts/stores/array.coffee
301
302
  - app/assets/javascripts/stores/object.coffee
302
303
  - app/assets/javascripts/stores/rails-array.coffee
@@ -345,7 +346,7 @@ files:
345
346
  - templates/character_admin_index.html.erb
346
347
  - templates/character_admin_layout.html.erb.erb
347
348
  - templates/character_base_controller.rb
348
- - templates/development_seeds.rb
349
+ - templates/dev.rake
349
350
  - templates/devise_overrides_passwords_controller.rb
350
351
  - templates/devise_overrides_passwords_edit.html.erb
351
352
  - templates/devise_overrides_passwords_new.html.erb