Projects
Kolab:16:Enterprise
kolab-hkccp
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 16
View file
kolab-hkccp.spec
Changed
@@ -14,6 +14,11 @@ Patch0: kolab-hkccp-0.7.4-bootstrap.css.map.patch +Patch0001: 0001-Round-invoice-amount-for-Stripe-API.patch +Patch0002: 0002-Fix-handling-user.password-response.patch +Patch0003: 0003-Fix-alignment-of-some-form-buttons.patch +Patch0004: 0004-Improve-list-widget-to-look-better-and-work-on-mobil.patch + BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -34,6 +39,11 @@ %patch0 -p1 +%patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 + %build %install
View file
0001-Round-invoice-amount-for-Stripe-API.patch
Added
@@ -0,0 +1,63 @@ +From fe277982b92158afad7aeafaa84f237f00929339 Mon Sep 17 00:00:00 2001 +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Fri, 28 Jun 2019 10:28:20 +0200 +Subject: [PATCH 1/5] Round invoice amount for Stripe API + +The value is in centimes so should not have a decimal point. +--- + lib/Kolab/Payment/Stripe/API.php | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +diff --git a/lib/Kolab/Payment/Stripe/API.php b/lib/Kolab/Payment/Stripe/API.php +index f81fd61..e66c3d5 100644 +--- a/lib/Kolab/Payment/Stripe/API.php ++++ b/lib/Kolab/Payment/Stripe/API.php +@@ -295,8 +295,8 @@ EOF; + + try { + $request = array( +- 'amount' => $this->auth_request['AMOUNT'] * 100, +- 'currency' => $this->auth_request['CURRENCY'], ++ 'amount' => round($this->auth_request['AMOUNT'] * 100), ++ 'currency' => $this->auth_request['CURRENCY'], + 'description' => $this->auth_request['DESCRIPTION'] + ); + +@@ -315,11 +315,11 @@ EOF; + + if ($charge->paid) { + return array( +- 'ID' => $charge->id, +- 'AMOUNT' => round($charge->amount / 100, 2), +- 'CURRENCY' => strtoupper($charge->currency), ++ 'ID' => $charge->id, ++ 'AMOUNT' => round($charge->amount / 100, 2), ++ 'CURRENCY' => strtoupper($charge->currency), + 'TIMESTAMP' => $charge->created, +- 'CARDREF' => $this->cardref, ++ 'CARDREF' => $this->cardref, + ); + } + else { +@@ -329,8 +329,8 @@ EOF; + catch(\Stripe_Error $e) { + Log::error('Stripe API Error', array( + 'request' => $request, +- 'status' => $e->getHttpStatus(), +- 'body' => $e->getHttpBody(), ++ 'status' => $e->getHttpStatus(), ++ 'body' => $e->getHttpBody(), + )); + $this->set_error($e->getCode()); + $this->error_message = $e->getMessage(); +@@ -358,5 +358,4 @@ EOF; + { + return $this->error_message ?: parent::get_error_message(); + } +- +-} +\ No newline at end of file ++} +-- +2.20.1 +
View file
0002-Fix-handling-user.password-response.patch
Added
@@ -0,0 +1,35 @@ +From 4d175c1ee4216fc28f6dd4514e2b11fc12f4dc93 Mon Sep 17 00:00:00 2001 +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Tue, 2 Jul 2019 16:14:59 +0200 +Subject: [PATCH 2/5] Fix handling user.password response + +--- + lib/Kolab/Hosted/Model/KolabUser.php | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/Kolab/Hosted/Model/KolabUser.php b/lib/Kolab/Hosted/Model/KolabUser.php +index 6737b14..b27bce3 100644 +--- a/lib/Kolab/Hosted/Model/KolabUser.php ++++ b/lib/Kolab/Hosted/Model/KolabUser.php +@@ -619,7 +619,8 @@ class KolabUser extends SQL\DBI + $api->login($config->get('kolab_wap.backend_auth_dn'), $config->get('kolab_wap.backend_auth_pw')); + $api->select_domain($domain); + +- $success = self::parse_api_result($api->post('user.password', array(), $post), 'user.password', $api_error); ++ $result = self::parse_api_result($api->post('user.password', array(), $post), 'user.password', $api_error); ++ $success = $result === false ? false : true; + + if (!$success && $api_error) { + $errors = self::parse_api_error($api_error); +@@ -627,7 +628,7 @@ class KolabUser extends SQL\DBI + + $api->logout(); + +- Audit::log($this->account, $this->UUID, 'kolabuser.password-reset', (bool) $success); ++ Audit::log($this->account, $this->UUID, 'kolabuser.password-reset', $success); + + return $success; + } +-- +2.20.1 +
View file
0003-Fix-alignment-of-some-form-buttons.patch
Added
@@ -0,0 +1,62 @@ +From 17e362436e49af5894d20743cadb929d340a7e34 Mon Sep 17 00:00:00 2001 +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Wed, 3 Jul 2019 13:36:37 +0200 +Subject: [PATCH 3/5] Fix alignment of some form buttons + +--- + public_html/skins/default/templates/admin.accounts.edit.html | 4 ++-- + public_html/skins/default/templates/hosting.user.add.html | 2 +- + public_html/skins/default/templates/hosting.user.edit.html | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/public_html/skins/default/templates/admin.accounts.edit.html b/public_html/skins/default/templates/admin.accounts.edit.html +index db9e705..3674342 100644 +--- a/public_html/skins/default/templates/admin.accounts.edit.html ++++ b/public_html/skins/default/templates/admin.accounts.edit.html +@@ -8,7 +8,7 @@ + {% block content %} + <div class="row"> + <div class="col-sm-12"> +- ++ + <h1 class="pagetitle">{{ title }}</h1> + + <form action="{{ url() }}" method="post" class="form-horizontal" id="signupform"> +@@ -28,7 +28,7 @@ + + {{ hosting.kolabuserform(attribform) }} + +- <div class="col-sm-6 col-sm-offset-4 form-actions"> ++ <div class="col-sm-12 text-center form-actions"> + <input type="submit" name="update" value="{{ T('form.update') }}" class="btn btn-primary" /> + <a href="{{ url('/admin/accounts/show', account.ID) }}" class="btn btn-default">{{ T('form.cancel') }}</a> + </div> +diff --git a/public_html/skins/default/templates/hosting.user.add.html b/public_html/skins/default/templates/hosting.user.add.html +index f47d469..2b737a3 100644 +--- a/public_html/skins/default/templates/hosting.user.add.html ++++ b/public_html/skins/default/templates/hosting.user.add.html +@@ -54,7 +54,7 @@ + + <p class="hint">{{ T('hosting.addcostswarning') }}</p> + +-<div class="col-sm-6 col-sm-offset-4 form-actions"> ++<div class="col-sm-12 text-center form-actions"> + <input type="submit" name="create" value="{{ T('form.create') }}" class="btn btn-primary" /> + <a href="{{ url('/hosting') }}" class="btn btn-default">{{ T('form.cancel') }}</a> + </div> +diff --git a/public_html/skins/default/templates/hosting.user.edit.html b/public_html/skins/default/templates/hosting.user.edit.html +index 485391c..1dae7e0 100644 +--- a/public_html/skins/default/templates/hosting.user.edit.html ++++ b/public_html/skins/default/templates/hosting.user.edit.html +@@ -66,7 +66,7 @@ + <p class="hint">{{ T('hosting.costswarning') }}</p> + {% endif %} + +-<div class="col-sm-6 col-sm-offset-4 form-actions"> ++<div class="col-sm-12 text-center form-actions"> + <input type="submit" name="update" value="{{ T('form.update') }}" class="btn btn-primary" /> + <a href="{{ returnurl }}" class="btn btn-default">{{ T('form.cancel') }}</a> + </div> +-- +2.20.1 +
View file
0004-Improve-list-widget-to-look-better-and-work-on-mobil.patch
Added
@@ -0,0 +1,154 @@ +From c0f3bed1d062113725379838845d7007ec47c6c9 Mon Sep 17 00:00:00 2001 +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Wed, 3 Jul 2019 15:40:34 +0200 +Subject: [PATCH 4/5] Improve list-widget to look better and work on mobile + +--- + public_html/skins/default/css/styles.css | 21 +++++------- + public_html/skins/default/js/hostedadmin.js | 33 ++++++++++--------- + .../default/templates/include/forms.twig | 20 +++++++---- + 3 files changed, 39 insertions(+), 35 deletions(-) + +diff --git a/public_html/skins/default/css/styles.css b/public_html/skins/default/css/styles.css +index dd22ead..e453ebf 100644 +--- a/public_html/skins/default/css/styles.css ++++ b/public_html/skins/default/css/styles.css +@@ -310,8 +310,14 @@ label.inline, + } + + .list-widget .btn { +- margin-left: 5px; +- padding: 4px 8px; ++ padding: 7px 8px 6px 8px; ++ line-height: 1; ++ background: none; ++ border-color: #ccc; ++} ++ ++.list-widget .btn i { ++ width: 1em; + } + + .control-group.error .list-widget input { +@@ -481,14 +487,3 @@ table.domains td.domain { + table.users td.actions { + text-align: right; + } +- +-div.list-widget input.form-control { +- width: 90%; +- float: left; +-} +- +-div.list-widget-row input { +- width: 90%; +- float: left; +-} +- +diff --git a/public_html/skins/default/js/hostedadmin.js b/public_html/skins/default/js/hostedadmin.js +index 187a9cf..497ce7a 100644 +--- a/public_html/skins/default/js/hostedadmin.js ++++ b/public_html/skins/default/js/hostedadmin.js +@@ -441,26 +441,30 @@ function hostedadmin() + elem = $(elem); + + // Add button +- var add_button = elem.children('a.btn'); ++ var add_button = elem.find('a.btn').first(), ++ del_click = function(e) { ++ var row = $(e.target).closest('.list-widget-row'); ++ row.next('.formerror').remove() ++ row.remove(); ++ e.preventDefault(); ++ }; + + add_button.on('click', function(e) { +- var parent = $(this).parent(), input = parent.children('input'); ++ var input = elem.find('input').first(); + + if (input.val()) { +- var admin = hostedadmin.get_instance(), +- name = input.attr('id').replace(/^ff/, '').replace(/[0-9]+$/, ''), ++ var name = input.attr('id').replace(/^ff/, '').replace(/[0-9]+$/, ''), + num = (new Date).getTime(), + clone = input.clone(), +- div = $('<div class="list-widget-row"></div>'), +- btn = $('<a href="#" class="btn btn-mini"></a>') ++ div = $('<div class="list-widget-row input-group"></div>'), ++ btn = $('<a href="#" class="btn btn-default btn-mini"></a>') + .attr('title', env.texts['form.delete']) +- .on('click', function(e) { $(this).parent().remove(); e.preventDefault(); }) ++ .on('click', del_click) + .append($('<i class="glyphicon glyphicon-trash"></i>')); + + clone.attr({id: 'ff' + name + num, name: name + '[' + num + ']'}); +- div.append(clone).append(btn); +- parent.append(div); +- ++ div.append(clone).append($('<span class="input-group-btn">').append(btn)); ++ elem.append(div); + input.val(''); + } + +@@ -468,7 +472,7 @@ function hostedadmin() + }); + + // main input +- elem.children('input').on('keydown', function(e) { ++ elem.find('input').first().on('keydown', function(e) { + if (e.which == 13 && this.value) { + add_button.click(); + return false; +@@ -476,11 +480,8 @@ function hostedadmin() + }); + + // Delete button(s) action +- $('div.list-widget-row > .btn').each(function() { +- $(this).on('click', function(e) { +- $(this).parent().remove(); +- e.preventDefault(); +- }); ++ $('div.list-widget-row .btn').each(function() { ++ $(this).on('click', del_click); + }); + } + +diff --git a/public_html/skins/default/templates/include/forms.twig b/public_html/skins/default/templates/include/forms.twig +index 9c96809..ecde2dc 100644 +--- a/public_html/skins/default/templates/include/forms.twig ++++ b/public_html/skins/default/templates/include/forms.twig +@@ -9,17 +9,25 @@ + {% set fieldtype = type in ['password','email','hidden'] ? type : 'text' %} + {% autoescape false %} + <div class="list-widget"> +-<input type="{{ fieldtype }}" name="{{ name }}[0]" id="ff{{ name }}0" value="" class="{{ class|trim }}{% if errors is string %} has-error{% endif %}" {{ required ? 'required="required"' : '' }} {{ placeholder ? 'placeholder="' ~ placeholder|e ~ '"' : '' }} /><a href="#" class="btn btn-mini" title="{{ T('form.add') }}"><i class="glyphicon glyphicon-plus"></i></a> ++ <span class="input-group"> ++ <input type="{{ fieldtype }}" name="{{ name }}[0]" id="ff{{ name }}0" value="" class="{{ class|trim }}{% if errors is string %} has-error{% endif %}" {{ required ? 'required="required"' : '' }} {{ placeholder ? 'placeholder="' ~ placeholder|e ~ '"' : '' }} /> ++ <span class="input-group-btn"> ++ <a href="#" class="btn btn-default btn-mini" title="{{ T('form.add') }}"><i class="glyphicon glyphicon-plus"></i></a> ++ </span> ++ </span> + {% if errors is string %} + <span class="help-block formerror">{{ errors }}</span> + {% endif %} + {% for val in value %} +- <div class="list-widget-row"> +- <input type="{{ fieldtype }}" name="{{ name }}[{{ loop.index }}]" id="ff{{ name ~ loop.index }}" value="{{ val|e }}" class="{{ class }}{% if attribute(errors, loop.index0) %} error{% endif %}" {{ required ? 'required="required"' : '' }} /><a href="#" class="btn btn-mini" title="{{ T('form.delete') }}"><i class="glyphicon glyphicon-trash"></i></a> +- {% if errors is not string and attribute(errors, loop.index0) %} +- <span class="help-block formerror">{{ attribute(errors, loop.index0) }}</span> +- {% endif %} ++ <div class="list-widget-row input-group"> ++ <input type="{{ fieldtype }}" name="{{ name }}[{{ loop.index }}]" id="ff{{ name ~ loop.index }}" value="{{ val|e }}" class="{{ class }}{% if attribute(errors, loop.index0) %} error{% endif %}" {{ required ? 'required="required"' : '' }} /> ++ <span class="input-group-btn"> ++ <a href="#" class="btn btn-default btn-mini" title="{{ T('form.delete') }}"><i class="glyphicon glyphicon-trash"></i></a> ++ </span> + </div> ++ {% if errors is not string and attribute(errors, loop.index0) %} ++ <span class="help-block formerror">{{ attribute(errors, loop.index0) }}</span> ++ {% endif %} + {% endfor %} + </div> + {% endautoescape %} +-- +2.20.1 +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.