From 595e5f9d32c9dda8f7b6c0dd5e7e4fba4693eca4 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 20 Mar 2013 17:08:14 +0100 Subject: basic Ember.js setup --- app/controllers/switchboards_controller.rb | 3 +++ app/views/switchboards/app.js | 8 ++++++++ app/views/switchboards/show-old.html.haml | 21 +++++++++++++++++++++ app/views/switchboards/show.html.erb | 23 +++++++++++++++++++++++ app/views/switchboards/show.html.haml | 21 --------------------- 5 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 app/views/switchboards/app.js create mode 100644 app/views/switchboards/show-old.html.haml create mode 100644 app/views/switchboards/show.html.erb delete mode 100644 app/views/switchboards/show.html.haml (limited to 'app') diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb index 98008c1..c499c69 100644 --- a/app/controllers/switchboards_controller.rb +++ b/app/controllers/switchboards_controller.rb @@ -8,6 +8,9 @@ class SwitchboardsController < ApplicationController end def show + if @user.nil? + @user = current_user + end @switchboard = @user.switchboards.find(params[:id]) @switchboard_entries = @switchboard.switchboard_entries spread_breadcrumbs diff --git a/app/views/switchboards/app.js b/app/views/switchboards/app.js new file mode 100644 index 0000000..a4aa100 --- /dev/null +++ b/app/views/switchboards/app.js @@ -0,0 +1,8 @@ +window.App = Ember.Application.create({ + rootElement: '#xxxyyy', + + ready: function() { + App.view.appendTo('#xxxyyy'); + } +}); + diff --git a/app/views/switchboards/show-old.html.haml b/app/views/switchboards/show-old.html.haml new file mode 100644 index 0000000..a825806 --- /dev/null +++ b/app/views/switchboards/show-old.html.haml @@ -0,0 +1,21 @@ +- content_for :title, "Switchboard #{@switchboard.name}" + +.row + .span12 + = render :partial => "current_user_dashboard", :current_user => current_user + + %ul.thumbnails + = render :partial => "switchboard_entries/switchboard_entry", :collection => @switchboard_entries + + - if can? :edit, @switchboard + .row + .span12 + %a.btn.btn-small.btn-warning{:href => switchboard_switchboard_entries_path(@switchboard) } + %i.icon-edit.icon-white + %span.hidden-phone + =t("switchboard_entries.index.page_title") + + .span6 + + += subscribe_to "/switchboards/#{@switchboard.id}" \ No newline at end of file diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb new file mode 100644 index 0000000..337d00c --- /dev/null +++ b/app/views/switchboards/show.html.erb @@ -0,0 +1,23 @@ +<% content_for :title, "Switchboard #{@switchboard.name}" %> + +
+
+
+ +
+ + + + + +
+
+ + + + + diff --git a/app/views/switchboards/show.html.haml b/app/views/switchboards/show.html.haml deleted file mode 100644 index a825806..0000000 --- a/app/views/switchboards/show.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -- content_for :title, "Switchboard #{@switchboard.name}" - -.row - .span12 - = render :partial => "current_user_dashboard", :current_user => current_user - - %ul.thumbnails - = render :partial => "switchboard_entries/switchboard_entry", :collection => @switchboard_entries - - - if can? :edit, @switchboard - .row - .span12 - %a.btn.btn-small.btn-warning{:href => switchboard_switchboard_entries_path(@switchboard) } - %i.icon-edit.icon-white - %span.hidden-phone - =t("switchboard_entries.index.page_title") - - .span6 - - -= subscribe_to "/switchboards/#{@switchboard.id}" \ No newline at end of file -- cgit v1.2.3 From 877364c24ef9c7954f0e193456bb3f2d39169977 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 25 Mar 2013 10:26:49 +0100 Subject: First try --- app/controllers/switchboard_entries_controller.rb | 13 +++++++++++-- app/controllers/switchboards_controller.rb | 13 +++++++++++++ app/serializers/switchboard_entry_serializer.rb | 3 +++ app/serializers/switchboard_serializer.rb | 6 ++++++ app/views/switchboards/show.html.erb | 19 +++++++++++++------ 5 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 app/serializers/switchboard_entry_serializer.rb create mode 100644 app/serializers/switchboard_serializer.rb (limited to 'app') diff --git a/app/controllers/switchboard_entries_controller.rb b/app/controllers/switchboard_entries_controller.rb index ef6c72e..32ca9bb 100644 --- a/app/controllers/switchboard_entries_controller.rb +++ b/app/controllers/switchboard_entries_controller.rb @@ -8,8 +8,17 @@ class SwitchboardEntriesController < ApplicationController end def show - @switchboard_entry = @switchboard.switchboard_entries.find(params[:id]) - spread_breadcrumbs + if @switchboard + @switchboard_entry = @switchboard.switchboard_entries.find(params[:id]) + spread_breadcrumbs + else + @switchboard_entry = SwitchboardEntry.find(params[:id]) + end + + respond_to do |format| + format.html + format.json { render json: @switchboard_entry } + end end def new diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb index c499c69..8ceb96d 100644 --- a/app/controllers/switchboards_controller.rb +++ b/app/controllers/switchboards_controller.rb @@ -3,8 +3,16 @@ class SwitchboardsController < ApplicationController authorize_resource :switchboard, :through => :user def index + if @user.nil? + @user = current_user + end @switchboards = @user.switchboards spread_breadcrumbs + + respond_to do |format| + format.html + format.json { render json: @switchboards } + end end def show @@ -14,6 +22,11 @@ class SwitchboardsController < ApplicationController @switchboard = @user.switchboards.find(params[:id]) @switchboard_entries = @switchboard.switchboard_entries spread_breadcrumbs + + respond_to do |format| + format.html + format.json { render json: @switchboard } + end end def new diff --git a/app/serializers/switchboard_entry_serializer.rb b/app/serializers/switchboard_entry_serializer.rb new file mode 100644 index 0000000..dace1c5 --- /dev/null +++ b/app/serializers/switchboard_entry_serializer.rb @@ -0,0 +1,3 @@ +class SwitchboardEntrySerializer < ActiveModel::Serializer + attributes :id, :name +end diff --git a/app/serializers/switchboard_serializer.rb b/app/serializers/switchboard_serializer.rb new file mode 100644 index 0000000..c460add --- /dev/null +++ b/app/serializers/switchboard_serializer.rb @@ -0,0 +1,6 @@ +class SwitchboardSerializer < ActiveModel::Serializer + embed :ids, :include => true + + attributes :id, :name + has_many :switchboard_entries, :key => :switchboard_entry_ids, :root => :switchboardEntrys +end diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb index 337d00c..a4bdae0 100644 --- a/app/views/switchboards/show.html.erb +++ b/app/views/switchboards/show.html.erb @@ -1,19 +1,26 @@ <% content_for :title, "Switchboard #{@switchboard.name}" %> + +
-
- -
+
+ -
-- cgit v1.2.3 From 64653a9149eca977c16233abb0a472730b94a464 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 26 Mar 2013 16:55:08 +0100 Subject: Store reload interval in the Switchboard table. --- app/controllers/switchboard_entries_controller.rb | 13 ++++++-- app/controllers/switchboards_controller.rb | 5 ++- app/models/switchboard.rb | 21 ++++++++++++ app/models/switchboard_entry.rb | 2 ++ app/serializers/switchboard_entry_serializer.rb | 2 ++ app/serializers/switchboard_serializer.rb | 7 ++-- app/views/switchboards/_form_core.html.haml | 3 ++ app/views/switchboards/app.js | 8 ----- app/views/switchboards/show.html.erb | 40 ++++++++++++++++++----- 9 files changed, 79 insertions(+), 22 deletions(-) delete mode 100644 app/views/switchboards/app.js (limited to 'app') diff --git a/app/controllers/switchboard_entries_controller.rb b/app/controllers/switchboard_entries_controller.rb index 32ca9bb..3f82976 100644 --- a/app/controllers/switchboard_entries_controller.rb +++ b/app/controllers/switchboard_entries_controller.rb @@ -3,8 +3,17 @@ class SwitchboardEntriesController < ApplicationController authorize_resource :switchboard_entry, :through => :switchboard, :except => [:sort] def index - @switchboard_entries = @switchboard.switchboard_entries - spread_breadcrumbs + if @switchboard + @switchboard_entries = @switchboard.switchboard_entries + spread_breadcrumbs + else + @switchboard_entries = SwitchboardEntry.where(:id => params[:ids]) + end + + respond_to do |format| + format.html + format.json { render json: @switchboard_entries } + end end def show diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb index 8ceb96d..d3424ad 100644 --- a/app/controllers/switchboards_controller.rb +++ b/app/controllers/switchboards_controller.rb @@ -31,6 +31,9 @@ class SwitchboardsController < ApplicationController def new @switchboard = @user.switchboards.build + @switchboard.show_avatars = true + @switchboard.entry_width = 2 + @switchboard.reload_interval = 2000 spread_breadcrumbs end @@ -68,7 +71,7 @@ class SwitchboardsController < ApplicationController private def switchboard_params - params.require(:switchboard).permit(:name) + params.require(:switchboard).permit(:name, :reload_interval, :show_avatars, :entry_width) end def spread_breadcrumbs diff --git a/app/models/switchboard.rb b/app/models/switchboard.rb index 74e2767..360de70 100644 --- a/app/models/switchboard.rb +++ b/app/models/switchboard.rb @@ -6,11 +6,32 @@ class Switchboard < ActiveRecord::Base :presence => true, :uniqueness => {:scope => :user_id} + validates :reload_interval, + :numericality => { :only_integer => true, + :greater_than => 250, + :allow_nil => true + } + + validates :entry_width, + :numericality => { :only_integer => true, + :greater_than => 0, + :less_than => 5 + } + belongs_to :user, :touch => true has_many :switchboard_entries, :dependent => :destroy has_many :sip_accounts, :through => :switchboard_entries + before_validation :convert_0_to_nil + def to_s self.name.to_s end + + private + def convert_0_to_nil + if self.reload_interval == 0 + self.reload_interval = nil + end + end end diff --git a/app/models/switchboard_entry.rb b/app/models/switchboard_entry.rb index 76d002f..faeba8c 100644 --- a/app/models/switchboard_entry.rb +++ b/app/models/switchboard_entry.rb @@ -5,6 +5,8 @@ class SwitchboardEntry < ActiveRecord::Base belongs_to :switchboard, :touch => true belongs_to :sip_account, :touch => true + has_many :phone_numbers, :through => :sip_account + validates :switchboard, :presence => true diff --git a/app/serializers/switchboard_entry_serializer.rb b/app/serializers/switchboard_entry_serializer.rb index dace1c5..0b5f4c1 100644 --- a/app/serializers/switchboard_entry_serializer.rb +++ b/app/serializers/switchboard_entry_serializer.rb @@ -1,3 +1,5 @@ class SwitchboardEntrySerializer < ActiveModel::Serializer attributes :id, :name + + has_many :phone_numbers, embed: :ids end diff --git a/app/serializers/switchboard_serializer.rb b/app/serializers/switchboard_serializer.rb index c460add..2912a56 100644 --- a/app/serializers/switchboard_serializer.rb +++ b/app/serializers/switchboard_serializer.rb @@ -1,6 +1,7 @@ class SwitchboardSerializer < ActiveModel::Serializer - embed :ids, :include => true - attributes :id, :name - has_many :switchboard_entries, :key => :switchboard_entry_ids, :root => :switchboardEntrys + + embed :ids + + has_many :switchboard_entries, :key => :switchboard_entrys end diff --git a/app/views/switchboards/_form_core.html.haml b/app/views/switchboards/_form_core.html.haml index 61b5934..59a2442 100644 --- a/app/views/switchboards/_form_core.html.haml +++ b/app/views/switchboards/_form_core.html.haml @@ -1,2 +1,5 @@ .inputs = f.input :name, :label => t('switchboards.form.name.label'), :hint => conditional_hint('switchboards.form.name.hint'), :autofocus => true + = f.input :reload_interval, :label => t('switchboards.form.reload_interval.label'), :hint => conditional_hint('switchboards.form.reload_interval.hint') + = f.input :show_avatars, :label => t('switchboards.form.show_avatars.label'), :hint => conditional_hint('switchboards.form.show_avatars.hint') + = f.input :entry_width, :label => t('switchboards.form.entry_width.label'), :hint => conditional_hint('switchboards.form.entry_width.hint') diff --git a/app/views/switchboards/app.js b/app/views/switchboards/app.js deleted file mode 100644 index a4aa100..0000000 --- a/app/views/switchboards/app.js +++ /dev/null @@ -1,8 +0,0 @@ -window.App = Ember.Application.create({ - rootElement: '#xxxyyy', - - ready: function() { - App.view.appendTo('#xxxyyy'); - } -}); - diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb index a4bdae0..87bb551 100644 --- a/app/views/switchboards/show.html.erb +++ b/app/views/switchboards/show.html.erb @@ -2,23 +2,47 @@
-
- -
-- cgit v1.2.3 From cea2cc3c1cc1e48fc4600c698d52dfda2bde4505 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 3 Apr 2013 22:08:19 +0200 Subject: Massive changes to the switchboard. --- app/controllers/api/v1/phone_numbers_controller.rb | 23 +++++++++++++++ app/controllers/api/v1/sip_accounts_controller.rb | 23 +++++++++++++++ .../api/v1/switchboard_entries_controller.rb | 23 +++++++++++++++ app/controllers/api/v1/switchboards_controller.rb | 21 ++++++++++++++ app/controllers/switchboard_entries_controller.rb | 26 +++-------------- app/controllers/switchboards_controller.rb | 16 ----------- app/models/switchboard.rb | 3 +- app/models/switchboard_entry.rb | 33 ++++++++++++++++++++++ app/serializers/phone_number_serializer.rb | 3 ++ app/serializers/sip_account_serializer.rb | 6 ++++ app/serializers/switchboard_entry_serializer.rb | 13 +++++++-- app/serializers/switchboard_serializer.rb | 9 +++--- app/views/switchboards/show.html.erb | 20 ++++++------- 13 files changed, 163 insertions(+), 56 deletions(-) create mode 100644 app/controllers/api/v1/phone_numbers_controller.rb create mode 100644 app/controllers/api/v1/sip_accounts_controller.rb create mode 100644 app/controllers/api/v1/switchboard_entries_controller.rb create mode 100644 app/controllers/api/v1/switchboards_controller.rb create mode 100644 app/serializers/phone_number_serializer.rb create mode 100644 app/serializers/sip_account_serializer.rb (limited to 'app') diff --git a/app/controllers/api/v1/phone_numbers_controller.rb b/app/controllers/api/v1/phone_numbers_controller.rb new file mode 100644 index 0000000..ff58fd3 --- /dev/null +++ b/app/controllers/api/v1/phone_numbers_controller.rb @@ -0,0 +1,23 @@ +module Api + module V1 + class PhoneNumbersController < ApplicationController + respond_to :json + + def index + if params[:ids] + @phone_numbers = PhoneNumber.where(:id => params[:ids]) + else + @phone_numbers = PhoneNumber.all + end + + respond_with @phone_numbers + end + + def show + @phone_number = PhoneNumber.find(params[:id]) + + respond_with @phone_number + end + end + end +end diff --git a/app/controllers/api/v1/sip_accounts_controller.rb b/app/controllers/api/v1/sip_accounts_controller.rb new file mode 100644 index 0000000..6f305a4 --- /dev/null +++ b/app/controllers/api/v1/sip_accounts_controller.rb @@ -0,0 +1,23 @@ +module Api + module V1 + class SipAccountsController < ApplicationController + respond_to :json + + def index + if params[:ids] + @sip_accounts = SipAccount.where(:id => params[:ids]) + else + @sip_accounts = SipAccount.all + end + + respond_with @sip_accounts + end + + def show + @sip_account = SipAccount.find(params[:id]) + + respond_with @sip_account + end + end + end +end diff --git a/app/controllers/api/v1/switchboard_entries_controller.rb b/app/controllers/api/v1/switchboard_entries_controller.rb new file mode 100644 index 0000000..688f108 --- /dev/null +++ b/app/controllers/api/v1/switchboard_entries_controller.rb @@ -0,0 +1,23 @@ +module Api + module V1 + class SwitchboardEntriesController < ApplicationController + respond_to :json + + def index + if params[:ids] + @switchboard_entries = SwitchboardEntry.where(:id => params[:ids]) + else + @switchboard_entries = SwitchboardEntry.all + end + + respond_with @switchboard_entries + end + + def show + @switchboard_entry = SwitchboardEntry.find(params[:id]) + + respond_with @switchboard_entry + end + end + end +end \ No newline at end of file diff --git a/app/controllers/api/v1/switchboards_controller.rb b/app/controllers/api/v1/switchboards_controller.rb new file mode 100644 index 0000000..e6996ca --- /dev/null +++ b/app/controllers/api/v1/switchboards_controller.rb @@ -0,0 +1,21 @@ +module Api + module V1 + class SwitchboardsController < ApplicationController + respond_to :json + + def index + @user = current_user + @switchboards = @user.switchboards + + respond_with @switchboards + end + + def show + @user = current_user + @switchboard = @user.switchboards.find(params[:id]) + + respond_with @switchboard + end + end + end +end diff --git a/app/controllers/switchboard_entries_controller.rb b/app/controllers/switchboard_entries_controller.rb index 3f82976..ef6c72e 100644 --- a/app/controllers/switchboard_entries_controller.rb +++ b/app/controllers/switchboard_entries_controller.rb @@ -3,31 +3,13 @@ class SwitchboardEntriesController < ApplicationController authorize_resource :switchboard_entry, :through => :switchboard, :except => [:sort] def index - if @switchboard - @switchboard_entries = @switchboard.switchboard_entries - spread_breadcrumbs - else - @switchboard_entries = SwitchboardEntry.where(:id => params[:ids]) - end - - respond_to do |format| - format.html - format.json { render json: @switchboard_entries } - end + @switchboard_entries = @switchboard.switchboard_entries + spread_breadcrumbs end def show - if @switchboard - @switchboard_entry = @switchboard.switchboard_entries.find(params[:id]) - spread_breadcrumbs - else - @switchboard_entry = SwitchboardEntry.find(params[:id]) - end - - respond_to do |format| - format.html - format.json { render json: @switchboard_entry } - end + @switchboard_entry = @switchboard.switchboard_entries.find(params[:id]) + spread_breadcrumbs end def new diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb index d3424ad..f48e7fb 100644 --- a/app/controllers/switchboards_controller.rb +++ b/app/controllers/switchboards_controller.rb @@ -3,30 +3,14 @@ class SwitchboardsController < ApplicationController authorize_resource :switchboard, :through => :user def index - if @user.nil? - @user = current_user - end @switchboards = @user.switchboards spread_breadcrumbs - - respond_to do |format| - format.html - format.json { render json: @switchboards } - end end def show - if @user.nil? - @user = current_user - end @switchboard = @user.switchboards.find(params[:id]) @switchboard_entries = @switchboard.switchboard_entries spread_breadcrumbs - - respond_to do |format| - format.html - format.json { render json: @switchboard } - end end def new diff --git a/app/models/switchboard.rb b/app/models/switchboard.rb index 360de70..53f69a4 100644 --- a/app/models/switchboard.rb +++ b/app/models/switchboard.rb @@ -8,7 +8,7 @@ class Switchboard < ActiveRecord::Base validates :reload_interval, :numericality => { :only_integer => true, - :greater_than => 250, + :greater_than => 249, :allow_nil => true } @@ -21,6 +21,7 @@ class Switchboard < ActiveRecord::Base belongs_to :user, :touch => true has_many :switchboard_entries, :dependent => :destroy has_many :sip_accounts, :through => :switchboard_entries + has_many :phone_numbers, :through => :sip_accounts before_validation :convert_0_to_nil diff --git a/app/models/switchboard_entry.rb b/app/models/switchboard_entry.rb index faeba8c..44de7fd 100644 --- a/app/models/switchboard_entry.rb +++ b/app/models/switchboard_entry.rb @@ -30,4 +30,37 @@ class SwitchboardEntry < ActiveRecord::Base self.name.to_s end end + + def avatar_src + if self.sip_account.sip_accountable.class == User + if self.sip_account.sip_accountable.image? + self.sip_account.sip_accountable.image_url(:profile) + else + if self.sip_account.sip_accountable.male? + '/assets/icons/user-male-16x.png' + else + '/assets/icons/user-female-16x.png' + end + end + else + nil + end + end + + def callstate + if self.sip_account.call_legs.where(callstate: 'ACTIVE').any? || self.sip_account.b_call_legs.where(b_callstate: 'ACTIVE').any? + 'ACTIVE' + else + if self.sip_account.call_legs.where(callstate: 'EARLY').any? + 'EARLY' + else + if self.sip_account.call_legs.where(callstate: 'RINGING').any? + 'RINGING' + else + nil + end + end + end + end + end diff --git a/app/serializers/phone_number_serializer.rb b/app/serializers/phone_number_serializer.rb new file mode 100644 index 0000000..865534b --- /dev/null +++ b/app/serializers/phone_number_serializer.rb @@ -0,0 +1,3 @@ +class PhoneNumberSerializer < ActiveModel::Serializer + attributes :id, :name, :number +end diff --git a/app/serializers/sip_account_serializer.rb b/app/serializers/sip_account_serializer.rb new file mode 100644 index 0000000..c85c8a0 --- /dev/null +++ b/app/serializers/sip_account_serializer.rb @@ -0,0 +1,6 @@ +class SipAccountSerializer < ActiveModel::Serializer + embed :ids, :include => true + + attributes :id, :auth_name, :caller_name, :sip_accountable_id + has_many :phone_numbers +end diff --git a/app/serializers/switchboard_entry_serializer.rb b/app/serializers/switchboard_entry_serializer.rb index 0b5f4c1..1b6c761 100644 --- a/app/serializers/switchboard_entry_serializer.rb +++ b/app/serializers/switchboard_entry_serializer.rb @@ -1,5 +1,14 @@ class SwitchboardEntrySerializer < ActiveModel::Serializer - attributes :id, :name + attributes :id, :name, :path_to_user, :avatar_src, :callstate - has_many :phone_numbers, embed: :ids + has_one :sip_account, embed: :ids + has_one :switchboard, embed: :ids + + def path_to_user + if object.sip_account && object.sip_account.sip_accountable_type == 'User' + "/tenants/#{object.sip_account.sip_accountable.current_tenant.id}/users/#{object.sip_account.sip_accountable.id}" + else + nil + end + end end diff --git a/app/serializers/switchboard_serializer.rb b/app/serializers/switchboard_serializer.rb index 2912a56..600c79a 100644 --- a/app/serializers/switchboard_serializer.rb +++ b/app/serializers/switchboard_serializer.rb @@ -1,7 +1,8 @@ class SwitchboardSerializer < ActiveModel::Serializer - attributes :id, :name - - embed :ids + embed :ids, :include => true - has_many :switchboard_entries, :key => :switchboard_entrys + attributes :id, :name + has_many :switchboard_entries + has_many :sip_accounts, :through => :switchboard_entries + has_many :phone_numbers end diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb index 87bb551..1fd9d9a 100644 --- a/app/views/switchboards/show.html.erb +++ b/app/views/switchboards/show.html.erb @@ -22,20 +22,18 @@ {{#each switchboardEntry in switchboardEntrys}}
  • - - User-male-16x - + {{avatar_img switchboardEntry.avatar_src}}

    - {{switchboardEntry.name}} -
    - - 33 - + {{switchboardEntry.name}}
    + + {{#each phoneNumber in switchboardEntry.sipAccount.phoneNumbers}} + + {{phoneNumber.number}} + + {{/each}}
    - - - + {{show_callstate switchboardEntry.callstate}}

    -- cgit v1.2.3