dashstrap 0.1.0 → 0.2.0

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/dashstrap/application.js +4 -1
  3. data/app/assets/javascripts/dashstrap/modules/list-view.js +0 -1
  4. data/app/assets/stylesheets/dashstrap/ltr/application.css +1 -0
  5. data/app/assets/stylesheets/dashstrap/main.css.scss +1 -0
  6. data/app/assets/stylesheets/dashstrap/rtl/application.css +1 -0
  7. data/app/views/angular/403.html +12 -0
  8. data/app/views/angular/404.html +11 -0
  9. data/app/views/angular/auth/groups/new.html.slim +12 -0
  10. data/app/views/angular/fields/datepicker/datepicker.html +10 -5
  11. data/app/views/angular/fields/datetime/date.html +7 -0
  12. data/app/views/angular/fields/datetime/datetime.html +5 -8
  13. data/app/views/angular/fields/datetime/time.html +5 -23
  14. data/app/views/angular/fields/file/file.html.slim +1 -0
  15. data/app/views/angular/fields/file/file_upload.html +1 -0
  16. data/app/views/angular/list-view/index.html +0 -2
  17. data/app/views/devise/shared/_links.erb +5 -5
  18. data/app/views/layouts/faalis/dashboard.html.erb +1 -0
  19. data/dashstrap.gemspec +2 -0
  20. data/lib/dashstrap/engine.rb +3 -0
  21. data/lib/dashstrap/version.rb +1 -1
  22. data/lib/dashstrap.rb +1 -0
  23. data/lib/generators/dashstrap/install_generator.rb +10 -0
  24. data/lib/generators/templates/js/list_view/details.html.erb +30 -16
  25. data/lib/generators/templates/js/list_view/index.html.erb +1 -0
  26. data/lib/generators/templates/js/list_view/partials/add_controller.js.erb +2 -2
  27. data/lib/generators/templates/js/list_view/partials/index_controller.js.erb +5 -1
  28. data/lib/tasks/grunt/Gruntfile.js +2 -2
  29. metadata +35 -3
  30. data/app/assets/stylesheets/dashstrap/rtl/#application.css# +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 673d4c2977f43c1b868a6e4d0f4083b2317a0ced
4
- data.tar.gz: d74998f44274e37010bef670f4068a1a6275ad09
3
+ metadata.gz: 67a75d970b42e6bcde4d783185a504215252a98f
4
+ data.tar.gz: 8021b257f4b733337df26e29e804071dfe2eeee6
5
5
  SHA512:
6
- metadata.gz: be29bc7ad27e5abb78860583dd4aac519018b122c845cf5d6f4e234516998779373e22cc4109895a1dfe1f06a43149fef0b0de126d7d6b504c833a23733a338c
7
- data.tar.gz: b6c42121a9dc2f458dd5367b411b90a75911fa49aa463b0dbed149c34566dfdf720cf052e50adbea4edfcd34a1a7695cc60877375a9c16a29369af479f112249
6
+ metadata.gz: 36c25625f0d58f286d136bed705a92ddba840da38999f3fde69968595ff1bcfbc11d71f068fa35122ec6560937a52ad26708ef2d314af4b784593d232d7915f5
7
+ data.tar.gz: dd2bebd265233a7f50aef6c9e0ab5ee8aec72b4af88524e828beae028e0bff816759e763e8b8869723fbcfa9d1eaac4c5eb9e6467d7b2db784f5c97e1e3e7ede
@@ -1,2 +1,5 @@
1
- //= require dashstrap/functions
2
1
  //= require_tree ./modules
2
+ //= require dashstrap/functions
3
+ //= require moment
4
+ //= require moment/fa
5
+ //= require bootstrap-datetimepicker
@@ -155,7 +155,6 @@ ListView.directive('listView', ["$filter", "gettext", "UserPermissions", functio
155
155
  };
156
156
 
157
157
  scope.delete_items = function(){
158
-
159
158
  var len = scope.selected_count();
160
159
  var objects_to_delete = [];
161
160
 
@@ -15,3 +15,4 @@ bootstrap3-wysihtml5
15
15
  //= require dashstrap/ltr/ltr
16
16
  //= require select2/select2
17
17
  //= require select2/select2-bootstrap
18
+ //= require bootstrap-datetimepicker
@@ -61,3 +61,4 @@ $tools_link_color: #3f3f3f;
61
61
  padding-right: 1em;
62
62
 
63
63
  }
64
+ .datepicker{z-index:1151 !important;}
@@ -16,3 +16,4 @@ bootstrap3-wysihtml5
16
16
  //= require dashstrap/rtl/rtl
17
17
  //= require select2/select2
18
18
  //= require select2/select2-bootstrap
19
+ //= require bootstrap-datetimepicker
@@ -0,0 +1,12 @@
1
+ <div class="error-page">
2
+ <h2 class="headline text-red">403</h2>
3
+ <div class="error-content">
4
+ <h3><i class="fa fa-warning text-red"></i> Oops! You have do not have permission.</h3>
5
+ <p>
6
+ You do not have permission to access this page.
7
+ Meanwhile, you may <a href="/#">return to dashboard</a>.
8
+ </p>
9
+
10
+ </form>
11
+ </div>
12
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="error-page">
2
+ <h2 class="headline text-yellow"> 404</h2>
3
+ <div class="error-content">
4
+ <h3><i class="fa fa-warning text-yellow"></i> Oops! Page not found.</h3>
5
+ <p translate>
6
+ We could not find the page you were looking for.
7
+ Meanwhile, you may <a href="/#">return to dashboard</a>.
8
+ </p>
9
+
10
+ </div><!-- /.error-content -->
11
+ </div>
@@ -42,3 +42,15 @@
42
42
 
43
43
  .box-body
44
44
  .row
45
+ .col-xs-12
46
+ table.table.table-striped
47
+ tbody
48
+ tr
49
+ th
50
+ = _('Entity Name')
51
+ th
52
+ = _('Permission')
53
+ tr ng-repeat="perm in resource.permissions.all()"
54
+ th
55
+ | {{ perm }}
56
+ th
@@ -1,5 +1,10 @@
1
- <div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">
2
- <daypicker ng-switch-when="day" tabindex="0"></daypicker>
3
- <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>
4
- <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>
5
- </div>
1
+ <div>
2
+ <!-- TODO: Find out why disable-timepicker and timepicker does not work together -->
3
+ <div ng-if="timepicker">
4
+ <quick-datepicker disable-timepicker="true" id="{{ element_id }}" ng-model="model" class="{{cssClasses}}" ng-required="required" name="{{ field }}" placeholder="{{ 'Click to pick a date' | translate }}" />
5
+ </div>
6
+ <div ng-if="!timepicker">
7
+ <quick-datepicker id="{{ element_id }}" ng-model="model" class="{{cssClasses}}" ng-required="required" name="{{ field }}" placeholder="{{ 'Click to pick a date' | translate }}" />
8
+ </div>
9
+ <small id="{{ msg_element_id }}"></small>
10
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="form-group">
2
+ <div class='input-group date' id="{{element_id}}">
3
+ <input type='text' class="form-control" ng-model="model"/>
4
+ <span class="input-group-addon"><span class="fa fa-calendar"></span>
5
+ </span>
6
+ </div>
7
+ </div>
@@ -1,10 +1,7 @@
1
- <div>
2
- <!-- TODO: Find out why disable-timepicker and timepicker does not work together -->
3
- <div ng-if="timepicker">
4
- <quick-datepicker disable-timepicker="true" id="{{ element_id }}" ng-model="model" class="{{cssClasses}}" ng-required="required" name="{{ field }}" placeholder="{{ 'Click to pick a date' | translate }}" />
1
+ <div class="form-group">
2
+ <div class='input-group date' id="{{element_id}}" >
3
+ <input type='text' class="form-control" ng-model="model" />
4
+ <span class="input-group-addon"><span class="fa fa-calendar"></span>
5
+ </span>
5
6
  </div>
6
- <div ng-if="!timepicker">
7
- <quick-datepicker id="{{ element_id }}" ng-model="model" class="{{cssClasses}}" ng-required="required" name="{{ field }}" placeholder="{{ 'Click to pick a date' | translate }}" />
8
- </div>
9
- <small id="{{ msg_element_id }}"></small>
10
7
  </div>
@@ -1,25 +1,7 @@
1
- <div class="timeSelectorDirective" >
2
- <div class="section hours">
3
- <div class="increase" ng-click="increaseHours()">
4
- <i class="icon fa fa-caret-up"></i>
5
- </div>
6
- <div class="display">
7
- <input type="text" ng-model="hours" ng-change="change('hour')">
8
- </div>
9
- <div class="decrease" ng-click="decreaseHours()">
10
- <i class="icon fa fa-caret-down"></i>
11
- </div>
12
- </div>
13
- <div class="section minutes">
14
- <div class="increase" ng-click="increaseMinutes()">
15
- <i class="icon fa fa-caret-up"></i>
16
- </div>
17
- <div class="display">
18
- <input type="text" ng-model="minutes" ng-model-onblur ng-change="update('minute')">
19
- </div>
20
- <div class="decrease" ng-click="decreaseMinutes()">
21
- <i class="icon fa fa-caret-down">
22
- </i>
23
- </div>
1
+ <div class="form-group">
2
+ <div class='input-group date' id="{{element_id}}" >
3
+ <input type='text' class="form-control" ng-model="model" />
4
+ <span class="input-group-addon"><span class="fa fa-clock-o"></span>
5
+ </span>
24
6
  </div>
25
7
  </div>
@@ -0,0 +1 @@
1
+ input multiple="" type="file"
@@ -0,0 +1 @@
1
+ <input multiple="" type="file" />
@@ -5,8 +5,6 @@
5
5
 
6
6
 
7
7
 
8
-
9
-
10
8
  <div class="row">
11
9
  <div class="col-xs-12">
12
10
  <div class="box">
@@ -1,19 +1,19 @@
1
1
  <%- if controller_name != 'sessions' %>
2
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
2
+ <%= link_to _("Sign in"), new_session_path(resource_name) %><br />
3
3
  <% end -%>
4
4
 
5
5
  <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
6
+ <%= link_to _("Sign up"), new_registration_path(resource_name) %><br />
7
7
  <% end -%>
8
8
 
9
9
  <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
10
+ <%= link_to _("Forgot your password?"), new_password_path(resource_name) %><br />
11
11
  <% end -%>
12
12
 
13
13
  <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
14
+ <%= link_to _("Didn't receive confirmation instructions?"), new_confirmation_path(resource_name) %><br />
15
15
  <% end -%>
16
16
 
17
17
  <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
18
+ <%= link_to _("Didn't receive unlock instructions?"), new_unlock_path(resource_name) %><br />
19
19
  <% end -%>
@@ -19,6 +19,7 @@
19
19
  <%= yield %>
20
20
 
21
21
  <%= javascript_include_tag Faalis::Engine.dashboard_js_manifest %>
22
+
22
23
  <%= javascript_include_tag "locales/#{::I18n.locale}" %>
23
24
 
24
25
  </body>
data/dashstrap.gemspec CHANGED
@@ -36,4 +36,6 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency 'select2-rails'
37
37
 
38
38
 
39
+ spec.add_dependency 'momentjs-rails', '>= 2.8.1'
40
+ spec.add_dependency 'bootstrap3-datetimepicker-rails', '~> 4.7'
39
41
  end
@@ -2,6 +2,9 @@ require 'faalis/extension'
2
2
  require 'jquery-ui-rails'
3
3
  require 'font-awesome-rails'
4
4
  require 'select2-rails'
5
+ require 'momentjs-rails'
6
+ require 'bootstrap3-datetimepicker-rails'
7
+
5
8
 
6
9
  module Dashstrap
7
10
  class TemplateEngine < ::Rails::Engine
@@ -1,3 +1,3 @@
1
1
  module Dashstrap
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/dashstrap.rb CHANGED
@@ -2,3 +2,4 @@ module Dashstrap
2
2
  end
3
3
 
4
4
  require 'dashstrap/engine'
5
+ require 'dashstrap/version'
@@ -9,6 +9,16 @@ module Dashstrap
9
9
  def copy_scss_manifest
10
10
  directory 'stylesheets', 'app/assets/stylesheets'
11
11
  end
12
+
13
+ def assets_patch
14
+ append_file 'config/initializers/assets.rb' do
15
+ %Q(Rails.application.config.assets.precompile += ['fontawesome-webfont.eot',
16
+ 'fontawesome-webfont.woff',
17
+ 'fontawesome-webfont.ttf',
18
+ 'fontawesome-webfont.svg'])
19
+
20
+ end
21
+ end
12
22
  end
13
23
  end
14
24
  end
@@ -1,25 +1,39 @@
1
1
  <div class="row">
2
- <div class="col-sm-12 col-md-8">
2
+ <div class="col-sm-12 col-md-9">
3
3
 
4
4
  <div class="details">
5
- <% fields.each do |f, field_type| %>
6
- <dl>
7
- <% case field_type
8
- when "belongs_to" %> <dt translate><%= f.capitalize %> :</dt> <dd clas="detail field value">{{object.<%= f %>.name}}</dd>
9
- <% when "has_many" %><dl>
10
- <dt translate><%= f.capitalize %> :</dt>
11
- <ul>
12
- <li ng-repeat="item in object.<%= f %>"> {{ item.name }}</li>
13
- </ul>
14
- </dl>
15
- <% else %><dt translate><%= f.capitalize %> :</dt> <dd clas="detail field value">{{object.<%= f %>}}</dd>
16
- <% end %></dl>
17
- <% end %>
5
+ <% fields.each do |f, field_type| %>
6
+ <dl>
7
+ <% case field_type
8
+ when "belongs_to" %> <dt translate><%= f.capitalize %> :</dt> <dd clas="detail field value">{{object.<%= f %>.name}}</dd>
9
+ <% when "has_many" %><dl>
10
+ <dt translate><%= f.capitalize %> :</dt>
11
+ <ul>
12
+ <li ng-repeat="item in object.<%= f %>"> {{ item.name }}</li>
13
+ </ul>
14
+ </dl>
15
+ <% else %><dt translate><%= f.capitalize %> :</dt> <dd clas="detail field value">{{object.<%= f %>}}</dd>
16
+ <% end %></dl>
17
+ <% end %>
18
18
  </div>
19
19
 
20
-
21
20
  </div>
22
21
 
23
- <div class="col-sm-12 col-md-4">
22
+ <div class="col-sm-12 col-md-3">
23
+ <% if resource_data["childs"] %>
24
+ <div class="box box-solid">
25
+ <div class="box-body text-center">
26
+ <div class="btn-group-vertical">
27
+ <% resource_data["childs"].each do |item| %>
28
+ <a class="btn btn-info" ng-href="#/<%= resource_url %>/{{ object.id }}/<%= item.pluralize %>" translate>
29
+ <%= item.titleize %>
30
+ </a>
31
+ <% end %>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ <% end %>
36
+
24
37
  </div>
25
38
  </div>
39
+ </div>
@@ -1,6 +1,7 @@
1
1
  <% unless no_filter? %>
2
2
  <filter config="filter_config" result="<%= resource.pluralize.underscore %>"></filter>
3
3
  <% end %>
4
+
4
5
  <% unless no_bulk? %>
5
6
  <div class="row">
6
7
  <div class="col-sm-12">
@@ -78,7 +78,7 @@
78
78
  $(".form input").val("");
79
79
  }
80
80
  else {
81
- $state.go("<%= resource.pluralize.underscore %>");
81
+ $state.go("<%= resource.pluralize.underscore %>", {}, { reload: true });
82
82
  }
83
83
  }, function(data){
84
84
  catch_error(data);
@@ -92,7 +92,7 @@
92
92
  $(".form input").val("");
93
93
  }
94
94
  else {
95
- $state.go("<%= resource.pluralize.underscore %>");
95
+ $state.go("<%= resource.pluralize.underscore %>", {}, { reload: true });
96
96
  }
97
97
  }, function(data){
98
98
  catch_error(data);
@@ -3,6 +3,7 @@
3
3
  <%= resource.pluralize %>.controller("<%= resource %>Controller", ["$rootScope", "$scope", "gettext", "Restangular", "catch_error", "$state", "$stateParams", function($rootScope, $scope, _, API, catch_error, $state, $stateParams){
4
4
 
5
5
  $rootScope.section_name = _("<%= resource.underscore.pluralize.titleize %>");
6
+
6
7
  $rootScope.section_slug = _("List");
7
8
 
8
9
  <% parents.each do |parent| %>
@@ -25,6 +26,7 @@
25
26
  list: <% if parent? %>API.<% parents.each do |parent| %>one("<%= parent %>", $scope.<%= parent %>_id)<% end %>.all("<%= resource.pluralize.underscore %>")<% else %>API.all("<%= resource.pluralize.underscore %>")<% end %>
26
27
  };
27
28
  $scope.<%= resource.pluralize.underscore %> = [];<% end %>
29
+
28
30
  <% unless no_bulk? %>// Cache object for each field name possible values
29
31
  $scope.cache = {};
30
32
 
@@ -85,6 +87,7 @@
85
87
  },
86
88
 
87
89
  },<% end %>
90
+ <% unless no_duplicate? %>
88
91
  {
89
92
  title: _("Duplicate"),
90
93
  icon: "fa fa-files-o",
@@ -106,6 +109,7 @@
106
109
  }
107
110
  }
108
111
  }
112
+ <% end %>
109
113
 
110
114
  ];<% unless no_bulk? %>
111
115
 
@@ -178,7 +182,7 @@
178
182
  API.<% parents.each do |p| %>all("<%=p %>").<% end %>all("<%= resource.pluralize.underscore %>").customDELETE(query.join(","))
179
183
  .then(function(data) {
180
184
 
181
- $scope.<%= resource.pluralize.underscore %> = _.filter($scope.<%= resource.pluralize.underscore %>, function(x){
185
+ $scope.<%= resource.pluralize.underscore %> = $scope.<%= resource.pluralize.underscore %>.filter(function(x){
182
186
  return !(query.indexOf(x.id) != -1);
183
187
  });
184
188
  success_message(data.msg);
@@ -3,8 +3,8 @@ module.exports = function (grunt) {
3
3
  nggettext_extract: {
4
4
  pot: {
5
5
  files: {
6
- 'app/assets/locales/templates.pot': ['app/views/angularjs_templates/**/*.html',
7
- 'app/views/angularjs_templates/**/*.html.erb',
6
+ 'app/assets/locales/templates.pot': ['app/views/angular/**/*.html',
7
+ 'app/views/angular/**/*.html.erb',
8
8
  'app/assets/javascripts/**/*.js',
9
9
  'app/assets/javascripts/**/*.js',
10
10
  'app/assets/javascripts/**/*.coffee',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Rahmani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -192,6 +192,34 @@ dependencies:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: momentjs-rails
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: 2.8.1
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: 2.8.1
209
+ - !ruby/object:Gem::Dependency
210
+ name: bootstrap3-datetimepicker-rails
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '4.7'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '4.7'
195
223
  description: 'An awesome dashboard template for Faalis platform. '
196
224
  email:
197
225
  - lxsameer@gnu.org
@@ -222,7 +250,6 @@ files:
222
250
  - app/assets/stylesheets/dashstrap/ltr/application.css
223
251
  - app/assets/stylesheets/dashstrap/ltr/ltr.scss
224
252
  - app/assets/stylesheets/dashstrap/main.css.scss
225
- - app/assets/stylesheets/dashstrap/rtl/#application.css#
226
253
  - app/assets/stylesheets/dashstrap/rtl/application.css
227
254
  - app/assets/stylesheets/dashstrap/rtl/rtl.scss
228
255
  - app/assets/stylesheets/dashstrap/share.scss
@@ -232,6 +259,8 @@ files:
232
259
  - app/assets/stylesheets/simple/rtl/application.css
233
260
  - app/assets/stylesheets/simple/rtl/rtl.scss
234
261
  - app/assets/stylesheets/simple/share.scss
262
+ - app/views/angular/403.html
263
+ - app/views/angular/404.html
235
264
  - app/views/angular/auth/groups/details.html
236
265
  - app/views/angular/auth/groups/index.html.slim
237
266
  - app/views/angular/auth/groups/new.html.slim
@@ -252,8 +281,11 @@ files:
252
281
  - app/views/angular/fields/datepicker/month.html
253
282
  - app/views/angular/fields/datepicker/popup.html
254
283
  - app/views/angular/fields/datepicker/year.html
284
+ - app/views/angular/fields/datetime/date.html
255
285
  - app/views/angular/fields/datetime/datetime.html
256
286
  - app/views/angular/fields/datetime/time.html
287
+ - app/views/angular/fields/file/file.html.slim
288
+ - app/views/angular/fields/file/file_upload.html
257
289
  - app/views/angular/fields/float/float.html
258
290
  - app/views/angular/fields/image/image.html
259
291
  - app/views/angular/fields/integer/integer.html
@@ -1,4 +0,0 @@
1
- //= require dashstrap/main
2
- //= require dashstrap/rtl/rtl
3
-
4
-