public inbox for [email protected]  
help / color / mirror / Atom feed
From: Murtuza Zabuawala <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: PATCH: Added Note Backform control (pgAdmin4).
Date: Wed, 27 Apr 2016 18:19:48 +0530
Message-ID: <CAKKotZTMhxP=V06JJ2kgQ9qHaZkJzFptmGp-8Mrda+SdDccATg@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-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

view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: PATCH: Added Note Backform control (pgAdmin4).
  In-Reply-To: <CAKKotZTMhxP=V06JJ2kgQ9qHaZkJzFptmGp-8Mrda+SdDccATg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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