Plugin Directory

Changeset 2752006


Ignore:
Timestamp:
07/05/2022 09:35:52 AM (4 years ago)
Author:
heygov
Message:

V1.4 - forms embed

Location:
heygov
Files:
36 added
6 edited

Legend:

Unmodified
Added
Removed
  • heygov/trunk/assets/css/heygov-site.css

    r2668903 r2752006  
     1*[class*='heygov-'] {
     2    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"!important;
     3}
     4
     5.heygov-h6 {
     6    font-weight: 600;
     7    font-size: 16px;
     8    line-height: 100%;
     9    letter-spacing: 0.3px;
     10    color: black;
     11    text-decoration: none;
     12    margin: 0!important;
     13
     14}
     15.heygov-h3 {
     16    font-weight: 600;
     17    font-size: 22px;
     18    line-height: 36px;
     19    letter-spacing: 0.3px;
     20    color:rgba(0, 0, 13);
     21    text-decoration: none;
     22    margin: 0!important;
     23}
     24
     25@media (max-width: 567px ) {
     26    h3.heygov-h3 {
     27        font-size: 16px!important;
     28    }
     29    h6.heygov-h6 {
     30        font-size: 12px!important;
     31    }
     32    article .entry-wrap  {
     33        padding: 0!important;
     34    }
     35   
     36}
    137
    238.heygov-apps-banner-wrapper {
     
    87123    }
    88124}
     125.heygov-row {
     126    display:flex;
     127    flex-direction:row;
     128    flex-wrap:wrap;
     129    width:calc(100% + 20px);
     130    margin:0 -10px 5px;
     131}
     132
     133.heygov-col {
     134    display:flex; 
     135    flex-direction:column;
     136    flex-basis:100%;
     137    flex:1; 
     138    padding-left:10px;
     139    padding-right:10px; 
     140}
     141
     142
     143
     144.heygov-justify-content-center {
     145    justify-content:center;
     146}
     147.heygov-row-cols-2 {
     148    flex: 0 0 auto;
     149    width: 50%;
     150}
     151
     152@media (min-width: 992px) {
     153    .heygov-row-cols-lg-5 {
     154        flex: 0 0 auto;
     155        width: 20%!important;
     156    }
     157    .heygov-row-cols-lg-4 {
     158        flex: 0 0 auto;
     159        width: 25%!important;
     160    }
     161    .heygov-row-cols-lg-3 {
     162        flex: 0 0 auto;
     163        width: 33.333%!important;
     164    }
     165    .heygov-row-cols-lg-2 {
     166        flex: 0 0 auto;
     167        width: 50%!important;
     168    }
     169}
     170@media (min-width: 768px) {
     171    .heygov-row-cols-md-4 {
     172        flex: 0 0 auto;
     173        width: 25%;
     174    }
     175    .heygov-row-cols-md-3 {
     176        flex: 0 0 auto;
     177        width: 33.333%;
     178    }
     179}   
     180.heygov-mb-3 {
     181    margin-bottom: 1.5rem!important;
     182}
     183.heygov-mt-3 {
     184    margin-top: 1.5rem!important;
     185}
     186.heygov-p-1 {
     187    padding: 0.5rem!important;
     188}
     189.heygov-p-2 {
     190    padding: 1rem!important;
     191}
     192
     193.heygov-p-3 {
     194    padding: 1.5rem!important;
     195}
     196.heygov-pt-3 {
     197    padding-top: 1.5rem!important;
     198}
     199.heygov-my-2 {
     200    margin-top: 0.5rem!important;
     201    margin-bottom: 0.5rem!important;
     202}
     203.heygov-m-2 {
     204    margin: 0.5rem!important;
     205}
     206.heygov-mx-2 {
     207    margin-left: 1rem!important;
     208    margin-right: 1rem!important;
     209}
     210.heygov-mx-1 {
     211    margin-left: 0.5rem!important;
     212    margin-right: 0.5rem!important;
     213}
     214.heygov-px-3 {
     215    padding-right: 1rem!important;
     216    padding-left: 1rem!important;
     217}
     218.heygov-card {
     219    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
     220    transition:  0px 2px 10px rgba(0, 0, 0, 0.1) 0.2s ease-in-out;
     221    border-radius: 30px;
     222    overflow: hidden;
     223    width: 100%;
     224}
     225
     226.heygov-card-header {
     227    border-radius: 30px 30px 0 0;
     228    padding: 1rem 1.5rem;
     229}
     230
     231.heygov-card-body {
     232    padding: 1rem;
     233}
     234
     235.heygov-card-title {
     236    margin-bottom: 0.5rem;
     237    position: relative;
     238}
     239.heygov-border-1 {
     240    border-width: 0.5px!important;
     241}
     242
     243.heygov-text-dark   {
     244    color: black!important;
     245    text-decoration: none;
     246}
     247.heygov-text-dark:hover {
     248    color: black!important;
     249    text-decoration: none;
     250}
     251.heygov-ratio {
     252    position: relative;
     253    width: 100%;
     254}
     255.heygov-ratio-1x1 {
     256    aspect-ratio: 1/1;
     257}
     258
     259.heygov-card-form {
     260    overflow: hidden;
     261}
     262
     263.heygov-card.has-icon {
     264    background-color: rgba(224, 224, 224, 0.4);
     265}
     266.heygov-card.has-department {
     267    background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3));
     268}
     269.heygov-card .heygov-form-price {
     270    position: absolute;
     271    bottom: 0.2rem;
     272}
     273
     274.heygov-card-form .heygov-card-body .heygov-form-icon {
     275    right: -1rem!important;
     276    top: -0.5rem!important;
     277    position: absolute;
     278    left: auto;
     279    color: #e0e0e0;
     280    opacity: 0.05!important;
     281    overflow: hidden;
     282    width: 8rem;
     283    height: 8rem;
     284
     285}
     286
     287@media (max-width: 575.98px) {
     288    .heygov-card-form .heygov-card-body .heygov-form-icon {
     289        width: 6rem;
     290    }
     291}
  • heygov/trunk/heygov.php

    r2745131 r2752006  
    44Plugin URI: https://heygov.com
    55Description: Manage the HeyGov widget on your municipality WordPress website
    6 Version: 1.3.1
     6Version: 1.4.0
    77Requires at least: 5.0
    88Requires PHP: 7.0
     
    4242}
    4343
     44
     45
    4446class HeyGov {
    4547
     
    5557            add_action('wp_footer', array($resource, 'load_widget'));
    5658            add_action('wp_footer', array($resource, 'load_apps_banner'));
     59            add_shortcode('heygov-forms', array($resource, 'heygov_forms_shortcode'));
    5760            add_shortcode('heygov-widget', array($setting, 'heygov_shortcode'));
     61           
    5862        }
    5963
  • heygov/trunk/includes/class/heygov-resource.php

    r2668903 r2752006  
    44
    55    public function load_admin_includes() {
    6         wp_enqueue_style('heygov-admin', HEYGOV_URL . 'assets/css/heygov-admin.css');
    7         wp_enqueue_style('heygov-site', HEYGOV_URL . 'assets/css/heygov-site.css');
    8         wp_enqueue_script('heygov-admin', HEYGOV_URL . 'assets/heygov-admin.js');
     6        wp_enqueue_style('heygov-admin', HEYGOV_URL . 'assets/css/heygov-admin.css', [], '1.4');
     7        wp_enqueue_style('heygov-site', HEYGOV_URL . 'assets/css/heygov-site.css', [], '1.4');
     8        wp_enqueue_script('heygov-admin', HEYGOV_URL . 'assets/heygov-admin.js', [], '1.4', true);     
    99
    1010        wp_localize_script('heygov-admin', 'HeyGov', [
     
    1515
    1616    public function load_site_includes() {
    17         wp_enqueue_style('heygov-site', HEYGOV_URL . 'assets/css/heygov-site.css');
     17        wp_enqueue_style('heygov-site', HEYGOV_URL . 'assets/css/heygov-site.css', [], '1.4');
    1818    }
    1919
     
    5151    }
    5252
     53    public function heygov_forms_shortcode( $atts = array()) {
     54        $args = shortcode_atts( array(
     55            'maxcolumns' => '5',
     56            'department' => ''
     57        ), $atts );
     58
     59        $maxcolumns = $args['maxcolumns'];
     60        $calc_medium = $maxcolumns - 1;
     61        $department = $args['department'];
     62
     63        $heygov_id = get_option('heygov_id');
     64        $forceUpdate = isset($_REQUEST['heygov-refresh-forms']);
     65
     66        // Get any existing copy of our transient data
     67        if ( false === ( $forms = get_transient( 'forms' ) ) || $forceUpdate ) {
     68            // It wasn't there, so regenerate the data and save the transient
     69            $forms = wp_remote_get('https://api.heygov.com/' . $heygov_id . '/forms?status=public&expand=department');
     70
     71            if (is_wp_error($forms)) {
     72                $forms = [];
     73            } else {
     74                $forms = wp_remote_retrieve_body($forms);
     75                $forms = json_decode($forms);
     76                set_transient( 'forms', $forms, 12 * HOUR_IN_SECONDS );
     77            }
     78        }
     79
     80        if(!empty($department)) {
     81            $forms = array_filter($forms, function($form) use($department) {
     82                return $form->department_id == $department || $form->department->slug == $department || $form->department->name == $department;
     83            });
     84        }
     85
     86        // generate forms HTML
     87        ob_start();
     88
     89        require_once HEYGOV_DIR . 'includes/view/show-heygov-muni-forms.php';
     90
     91        $forms = ob_get_contents();
     92        ob_end_clean();
     93
     94        return $forms;
     95    }
     96
    5397}
  • heygov/trunk/includes/class/heygov-settings.php

    r2668903 r2752006  
    3131    }
    3232
     33
     34 
     35
    3336}
  • heygov/trunk/includes/view/show-heygov-settings.php

    r2745131 r2752006  
    207207        </div>
    208208
     209        <!-- Adding forms from heygov to muni website -->
     210        <div class="heygov-feature">
     211            <h3 class="heygov-h3">Display heygov forms on your website</h3>
     212            <p>Copy shortcode from below ⬇️ & paste on to the page where you want the HeyGov forms to be displayed </p>
     213            <code>[heygov-forms]</code>
     214
     215            <div class="heygov-pt-3">
     216                <h6 class="heygov-h6">Shortcode filter examples</h6>
     217                <div>
     218                    <!-- Container size shortcode filter -->
     219                    <p><b>Container size</b></p>
     220                    <code>[heygov-forms maxcolumns="4"]</code>
     221                    <p>Maxcolumns number is the number of forms card  that will be displayed on large screen</p>
     222                </div>
     223                <div>
     224                    <!-- Department filter -->
     225                    <p><b>Department id, slug or name </b></p>
     226                    <p><code>[heygov-forms department="4"]</code></p>
     227                    <p><code>[heygov-forms department="parks-and-rec"]</code></p>
     228                    <p><code>[heygov-forms department="Parks and Rec"]</code></p>
     229                </div>
     230            </div>
     231           
     232           
     233        </div>
     234
    209235        <script type="text/javascript">
    210236        const $banners = document.querySelectorAll('.heygov-apps-banner')
  • heygov/trunk/readme.txt

    r2745131 r2752006  
    33Tags: heygov, issue reporting, reporting, forms, permits
    44Requires at least: 5.0
    5 Tested up to: 5.9
     5Tested up to: 6.0
    66Requires PHP: 7.0
    7 Stable tag: 1.3.1
     7Stable tag: 1.4.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1818- report issues or requests in your city or town
    1919- submit applications for permits and licenses
     20- reserve local venues for your events
    2021- search for information, meeting agendas and other documents in your city or town
    2122
     
    3536
    3637== Changelog ==
     38
     39= 1.4.0 =
     40* Added - Shortcode to display jurisdictions forms
    3741
    3842= 1.3.1 =
Note: See TracChangeset for help on using the changeset viewer.