public inbox for [email protected]  
help / color / mirror / Atom feed
PATCH: Added Note Backform control (pgAdmin4).
3+ messages / 2 participants
[nested] [flat]

* PATCH: Added Note Backform control (pgAdmin4).
@ 2016-04-27 12:49  Murtuza Zabuawala <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Murtuza Zabuawala @ 2016-04-27 12:49 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

This patch will allow us to provide annotate(s) on Form/Dialog.

Use in schema:

id: 'server_note', label: '{{ _('Note') }}',
text: '{{ _('The backup format will be PLAIN') }}',
type: 'note'


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] Backform_Note_Control_v1.patch (1.9K, 3-Backform_Note_Control_v1.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css
index 662805d..2809364 100755
--- a/web/pgadmin/static/css/overrides.css
+++ b/web/pgadmin/static/css/overrides.css
@@ -1092,4 +1092,20 @@ span.button-label {
 }
 button.ajs-button.btn.btn-primary {
     margin: 2px!important;
+}
+
+.backform_control_notes {
+    background-color: #f5f5f5;
+    border: 1px solid #ccc;
+    border-radius: 3px;
+    color: #333;
+    display: block;
+    font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
+    font-size: 12px;
+    line-height: 1.42857;
+    margin: 0 0 10px;
+    overflow: auto;
+    padding: 0;
+    word-break: break-all;
+    word-wrap: break-word;
 }
\ No newline at end of file
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index f463341..d24d6d7 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -67,7 +67,8 @@
     'collection': ['sub-node-collection', 'sub-node-collection', 'string'],
     'uniqueColCollection': ['unique-col-collection', 'unique-col-collection', 'string'],
     'switch' : 'switch',
-    'select2': 'select2'
+    'select2': 'select2',
+    'note': 'note'
   };
 
   var getMappedControl = Backform.getMappedControl = function(type, mode) {
@@ -2014,5 +2015,21 @@
     }
   });
 
+  // We will use this control just as a annotate in Backform
+  var NoteControl = Backform.NoteControl = Backform.Control.extend({
+    defaults: {
+      label: '',
+      text: '',
+      extraClasses: [],
+      noteClass: 'backform_control_notes'
+    },
+    template: _.template([
+      '<div class="<%=noteClass%>">',
+      '<label class=" <%=extraClasses.join(\' \')%>" style="padding: 5px;">',
+      '<strong><%=label%>:</strong></label>',
+      '<span><%=text%></span></div>'
+    ].join("\n"))
+  });
+
   return Backform;
 }));


  [image/png] Screen Shot 2016-04-27 at 6.18.50 pm.png (99.1K, 4-Screen%20Shot%202016-04-27%20at%206.18.50%20pm.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PATCH: Added Note Backform control (pgAdmin4).
@ 2016-04-28 06:01  Ashesh Vashi <[email protected]>
  parent: Murtuza Zabuawala <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Ashesh Vashi @ 2016-04-28 06:01 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers

I've update the patch a little bit.
Please test it at your end.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com;


*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi;

On Wed, Apr 27, 2016 at 6:19 PM, Murtuza Zabuawala <
[email protected]> wrote:

> Hi,
>
> This patch will allow us to provide annotate(s) on Form/Dialog.
>
> Use in schema:
>
> id: 'server_note', label: '{{ _('Note') }}',
> text: '{{ _('The backup format will be PLAIN') }}',
> type: 'note'
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] note_conrol_v2.patch (2.6K, 3-note_conrol_v2.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/templates/browser/js/messages.js b/web/pgadmin/browser/templates/browser/js/messages.js
index d7b97bc..01a23d0 100644
--- a/web/pgadmin/browser/templates/browser/js/messages.js
+++ b/web/pgadmin/browser/templates/browser/js/messages.js
@@ -22,7 +22,8 @@ function(_, S, pgAdmin) {
     'NODE_HAS_NO_SQL': "{{ _("No SQL could be generated for the selected object.") }}",
     'NODE_HAS_NO_STATISTICS': "{{ _("No statistics are available for the selected object!") }}",
     'TRUE': "{{ _("True") }}",
-    'FALSE': "{{ _("False") }}"
+    'FALSE': "{{ _("False") }}",
+    'NOTE_CTRL_LABEL': "{{ _("Note") }}",
   };
 
   return pgBrowser.messages;
diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css
index 2e91ae7..495bb76 100755
--- a/web/pgadmin/static/css/overrides.css
+++ b/web/pgadmin/static/css/overrides.css
@@ -1094,3 +1094,21 @@ button.pg-alertify-button {
   font: normal normal normal 18px/1 FontAwesome;
   margin-right: 5px;
 }
+.backform_control_notes {
+  background-color: #f5f5f5;
+  border: 1px solid #ccc;
+  border-radius: 3px;
+  color: #333;
+  display: block;
+  font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
+  font-size: 12px;
+  line-height: 1.42857;
+  margin: 0 0 10px;
+  overflow: auto;
+  padding: 5px 10px;
+  word-break: break-all;
+  word-wrap: break-word;}
+}
+.backform_control_notes .control-label {
+  min-width: 0px;
+}
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index 544d574..5972978 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -67,7 +67,8 @@
     'collection': ['sub-node-collection', 'sub-node-collection', 'string'],
     'uniqueColCollection': ['unique-col-collection', 'unique-col-collection', 'string'],
     'switch' : 'switch',
-    'select2': 'select2'
+    'select2': 'select2',
+    'note': 'note'
   };
 
   var getMappedControl = Backform.getMappedControl = function(type, mode) {
@@ -2015,5 +2016,20 @@
     }
   });
 
+  // We will use this control just as a annotate in Backform
+  var NoteControl = Backform.NoteControl = Backform.Control.extend({
+    defaults: {
+      label: window.pgAdmin.Browser.messages.NOTE_CTRL_LABEL,
+      text: '',
+      extraClasses: [],
+      noteClass: 'backform_control_notes'
+    },
+    template: _.template([
+      '<div class="<%=noteClass%> col-xs-12 <%=extraClasses.join(\' \')%>">',
+      '<label class="control-label"><%=label%>:</label>',
+      '<span><%=text%></span></div>'
+    ].join("\n"))
+  });
+
   return Backform;
 }));


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PATCH: Added Note Backform control (pgAdmin4).
@ 2016-04-28 06:25  Ashesh Vashi <[email protected]>
  parent: Ashesh Vashi <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Ashesh Vashi @ 2016-04-28 06:25 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers

Checked-in with some more twicks (resolved a typo in my modified patch).

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com;


*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi;

On Thu, Apr 28, 2016 at 11:31 AM, Ashesh Vashi <
[email protected]> wrote:

> I've update the patch a little bit.
> Please test it at your end.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> <http://www.enterprisedb.com;
>
>
> *http://www.linkedin.com/in/asheshvashi*
> <http://www.linkedin.com/in/asheshvashi;
>
> On Wed, Apr 27, 2016 at 6:19 PM, Murtuza Zabuawala <
> [email protected]> wrote:
>
>> Hi,
>>
>> This patch will allow us to provide annotate(s) on Form/Dialog.
>>
>> Use in schema:
>>
>> id: 'server_note', label: '{{ _('Note') }}',
>> text: '{{ _('The backup format will be PLAIN') }}',
>> type: 'note'
>>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list ([email protected])
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-04-28 06:25 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-27 12:49 PATCH: Added Note Backform control (pgAdmin4). Murtuza Zabuawala <[email protected]>
2016-04-28 06:01 ` Ashesh Vashi <[email protected]>
2016-04-28 06:25   ` Ashesh Vashi <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox