Ado

 view release on metacpan or  search on metacpan

.perltidyrc  view on Meta::CPAN

# Perl Best Practices (plus errata) .perltidyrc file
-l=98    # Max line width is 98 cols
-i=4     # Indent level is 4 cols
-ci=2    # Continuation indent is 4 cols
#-st     # Output to STDOUT
-se      # Errors to STDERR
-vt=2    # Maximal vertical tightness
-cti=0   # No extra indentation for closing brackets
-pt=1    # Medium parenthesis tightness
-bt=1    # Medium brace tightness
-sbt=1   # Medium square bracket tightness
-bbt=1   # Medium block brace tightness
-nsfs    # No space before semicolons
-nolq    # Don't outdent long quoted strings
-wbb="% + - * / x != == >= <= =~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
         # Break before all operators

# Extras/overrides/deviations from Perl Best Practices
--warning-output                      # Show warnings
--maximum-consecutive-blank-lines=2   # Default is 1
--nohanging-side-comments             # Troublesome for commented out code

-isbc   # Block comments may only be indented if they have some space characters before the #
# We use version control, so just rewrite the file and do not keep backup if there are no errors
-b -bext='/'

# For the up-tight folk :)
-pt=2    # High parenthesis tightness
-bt=2    # High brace tightness
-sbt=2   # High square bracket tightness

lib/Ado/Build.pm  view on Meta::CPAN

package Ado::Build;
use 5.014;
use strict;
use warnings FATAL => 'all';
use File::Spec::Functions qw(catdir catfile);
use File::Path qw(make_path);
use File::Copy qw(copy);
use ExtUtils::Installed;
use ExtUtils::Install;
use parent 'Module::Build';
use Exporter qw( import );    #export functionality to Ado::BuildPlugin etc..
our @EXPORT_OK = qw(
  create_build_script process_etc_files do_create_readme
  process_public_files process_templates_files
  ACTION_perltidy ACTION_submit PERL_DIRS);

sub PERL_DIRS {
    state $dirs = [map { catdir($_[0]->base_dir, $_) } qw(bin lib etc t)];
    return @$dirs;
}

lib/Ado/BuildPlugin.pm  view on Meta::CPAN

package Ado::BuildPlugin;
use 5.014;
use strict;
use warnings FATAL => 'all';
use parent 'Module::Build';
use Ado::Build qw(
  process_etc_files process_public_files do_create_readme
  process_templates_files create_build_script
  ACTION_perltidy ACTION_submit PERL_DIRS);

1;

=pod

=encoding utf8

lib/Ado/Command/adduser.pm  view on Meta::CPAN

    'l|last_name=s'      #user's last name (mandatory)
    'start_date=s'       #format: %Y-%m-%d (optional, today by default)

=head1 METHODS

L<Ado::Command::adduser> inherits all methods from
L<Ado::Command> and implements the following new ones.

=head2 init

Calls the default parent L<Ado::Command/init> and parses the arguments
passed on the command-line. Returns true on success.
Croaks with L</usage> message on failure.


=head2 adduser

The default and only action this command implements.
Makes logical checks for existing user and group and calls
L<Ado::Model::Users/adduser> and L<Ado::Model::Users/add_to_group>
depending on parsed arguments.

lib/Ado/Model.pm  view on Meta::CPAN

package Ado::Model;    #The schema/base class
use 5.010001;
use strict;
use warnings;
use utf8;
use parent qw(DBIx::Simple::Class);
use Carp;
use DBIx::Simple::Class::Schema;

our $VERSION = '0.01';
sub is_base_class { return 1 }

sub dbix {

    # Singleton DBIx::Simple instance
    state $DBIx;

lib/Ado/Model/Domains.pm  view on Meta::CPAN

package Ado::Model::Domains;    #A table/row class
use 5.010001;
use strict;
use warnings;
use utf8;
use parent qw(Ado::Model);

sub is_base_class { return 0 }
my $TABLE_NAME = 'domains';

sub TABLE       { return $TABLE_NAME }
sub PRIMARY_KEY { return 'id' }
my $COLUMNS = ['id', 'domain', 'site_name', 'description', 'owner_id', 'group_id', 'permissions',
    'published'];

sub COLUMNS { return $COLUMNS }

lib/Ado/Model/Groups.pm  view on Meta::CPAN

package Ado::Model::Groups;    #A table/row class
use 5.010001;
use strict;
use warnings;
use utf8;
use parent qw(Ado::Model);

sub is_base_class { return 0 }
my $TABLE_NAME = 'groups';

sub TABLE       { return $TABLE_NAME }
sub PRIMARY_KEY { return 'id' }
my $COLUMNS = ['id', 'name', 'description', 'created_by', 'changed_by', 'disabled'];

sub COLUMNS { return $COLUMNS }
my $ALIASES = {};

lib/Ado/Model/Sessions.pm  view on Meta::CPAN

package Ado::Model::Sessions;    #A table/row class
use 5.010001;
use strict;
use warnings;
use utf8;
use parent qw(Ado::Model);

sub is_base_class { return 0 }
my $TABLE_NAME = 'sessions';

sub TABLE       { return $TABLE_NAME }
sub PRIMARY_KEY { return 'id' }
my $COLUMNS = ['id', 'tstamp', 'sessiondata'];

sub COLUMNS { return $COLUMNS }
my $ALIASES = {};

lib/Ado/Model/SessionsOld.pm  view on Meta::CPAN

package Ado::Model::SessionsOld;    #A table/row class
use 5.010001;
use strict;
use warnings;
use utf8;
use parent qw(Ado::Model);

sub is_base_class { return 0 }
my $TABLE_NAME = 'sessions_old';

sub TABLE       { return $TABLE_NAME }
sub PRIMARY_KEY { return 'id' }
my $COLUMNS = ['id', 'user_id', 'tstamp', 'sessiondata'];

sub COLUMNS { return $COLUMNS }
my $ALIASES = {};

lib/Ado/Model/UserGroup.pm  view on Meta::CPAN

package Ado::Model::UserGroup;    #A table/row class
use 5.010001;
use strict;
use warnings;
use utf8;
use parent qw(Ado::Model);

sub is_base_class { return 0 }
my $TABLE_NAME = 'user_group';

sub TABLE       { return $TABLE_NAME }
sub PRIMARY_KEY { return 'user_id' }
my $COLUMNS = ['user_id', 'group_id'];

sub COLUMNS { return $COLUMNS }
my $ALIASES = {};

lib/Ado/Model/Users.pm  view on Meta::CPAN

package Ado::Model::Users;    #A table/row class
use 5.010001;
use strict;
use warnings;
use utf8;
use parent qw(Ado::Model);
use Carp;
use Email::Address;
sub is_base_class { return 0 }
my $CLASS      = __PACKAGE__;
my $TABLE_NAME = 'users';

sub TABLE       { return $TABLE_NAME }
sub PRIMARY_KEY { return 'id' }
my $COLUMNS = [
    'id',         'group_id',   'login_name', 'login_password',

public/doc/bg/img/default_admin_screen.epz  view on Meta::CPAN

<?xml version="1.0"?>
<Document xmlns="http://www.evolus.vn/Namespace/Pencil"><Properties/><Pages><Page><Properties><Property name="name">Untitled Page</Property><Property name="id">1391472647609_5759</Property><Property name="width">980</Property><Property name="height">...
                ]]></p:property><p:property name="textFont"><![CDATA[Arial|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>

            <defs>
                <linearGradient x1="0%" y1="0%" x2="0%" y2="100%" p:name="linearFill" id="36be4582de964e90968b9d4a8d0823fa">
                    <stop style="stop-color: rgb(192, 192, 192); stop-opacity: 1;" offset="0" p:name="stop1" id="97ba4839a4a8438c832d3b69c28106b0"/>
                    <stop style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" offset="1" p:name="stop2" id="4f79e103cdb646b8a85a0656bf5af6c8"/>
                </linearGradient>
                <rect width="1025" height="75" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: url(&quot;#36be4582de964e90968b9d4a8d0823fa&quot;) none; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rrRect" id="65fcfb10486244958422f3bb...
                <filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="36fe3410734e42e0a6254778df8c1601">
                    <feGaussianBlur stdDeviation="1" in="SourceAlpha"/>

public/doc/en/intro.md  view on Meta::CPAN

##Built-in features
Ado is a typical Mojo application. It comes with a configuration file and a model[^2] layer - Mojolicious::Plugin::DSC. An SQLite database is bundled in the distribution at etc/ado.sqlite to get started quickly. All plugins can be disabled and re-ena...

Ado has the following:

1. Configuration file with most of the sensible settings in place, such as controller_class, name-spaces for routes (urls), name-spaces for plugins and commands, session settings, default routes...
2. Ado plugins work the same way as Mojolicious::Plugins and share the same common base trough Ado::Plugin. But they have one small additional feature. They can load their own configuration from `$ENV{MOJO_HOME}/etc/plugins/plugin_name.conf`. Busines...
By default the following plugins are enabled:
  1. All Mojolicious plugins which are otherwise enabled by default.
  2. Mojolicious::Plugin::Charset – UTF-8.
  3. Mojolicious::Plugin::DSC – a plugin which integrates DBIx::Simple::Class in the application.  DBIx::Simple::Class is a very lightweight object-relational mapper based on  DBIx::Simple. It abstracts the SQL from the programmer still allowing to...
  4. Ado::Plugin::Auth is a plugin that authenticates users to an Ado system. Users can be authenticated locally or using (TODO!) Facebook, Google, Twitter and other authentication service-providers. A pre-made login form can be used directly or as a...
  5. Ado::Plugin::MarkdownRenderer - Render static files in markdown format. One can create a personal blog or enterprise wiki using static files in markdown format.
3. The following libraries for user-interface development are used:
  1. Semantic UI – a CSS and JS framework for development of mobile-ready layouts. Its usage also results in more clean HTML than other popular frameworks.
  2. PageDown is the version of Attacklab's Showdown and WMD as used on Stack Overflow and the other Stack Exchange sites. It includes a converter that turns Markdown into HTML, a Markdown editor with realtime preview of the generated HTML, and a few...
4. The following Ado specific commands are available:
  1. Ado::Command::adduser allows adding users to an Ado application via a terminal. It also allows adding users to existing or not existing groups. The new group is automatically created.
  2. Ado::Command::version shows version information for installed core and optional modules.
1. Last but not least, Ado code is well covered with tests. Special care is taken to avoid accumulating technical debt by having Test::Perl::Critic tests set to level “harsh”. This way the coding style is forced to be consistent across the framew...

public/js/help_toc.js  view on Meta::CPAN

  //first item is the home page(cover.md)
  $('#toc ul:first').addClass('ui');
  $('#toc ul:first>li:first').prepend('<i class="home icon"></i>');
  //Each li is an "item" in the base list
  $('#toc li').addClass('item');
  //add title attributes to links
  $(toc_links_selector).each(function(){
    $(this).attr('title',$(this).text())
  });
  //Each li that contains a ul is a "folder"
  $('#toc li ul').parent().prepend('<i class="folder icon"></i>');
  //all the rest are documents
  $('#toc li').each(function (i) {
    if($(this).children('i.icon').length) return;
    $(this).prepend('<i class="file icon"></i>');
    //console.log( i + ": " + $( this ).text() );    
  });

  //Initialize the left menu
  $('#toc').sidebar();
  $('.attached.button').on('click',function (){

public/js/help_toc.js  view on Meta::CPAN

      ||$(this).text() == link.attr('title')){
      prev = $(sel).get((i-1));
      next = $(sel).get((i+1));
      index = i;
      return false;
    }
  })
  //previous
  var left_arrow = $('.left.arrow');
  if( index != 0 && prev){
    left_arrow.parent().attr('href',prev.href);
    left_arrow.parent().attr('title',$(prev).text());
    left_arrow.parent().removeClass('disabled');
  }
  else {
   left_arrow.parent().addClass('disabled') 
  }
  //next
  var right_arrow = $('.right.arrow'); 
  if( next ){
    right_arrow.parent().attr('href',next.href);
    right_arrow.parent().attr('title',$(next).text());
    right_arrow.parent().removeClass('disabled');
  }
  else {
   right_arrow.parent().addClass('disabled') 
  }
  /* 
  console.log(link.text()+'loaded')
  console.log('next page is:'+ $(next).text())
  console.log('prev page is:'+ $(prev).text())
  */
}//end function set_right_menu_arrows(link)

function remove_nolinks_text (argument) {
  // body...

public/vendor/pagedown/Markdown.Converter.js  view on Meta::CPAN

                (?:\n+|$)
            /gm, function(){...});
            */

            text = text.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,
                function (wholeMatch, m1, m2, m3, m4, m5) {
                    m1 = m1.toLowerCase();
                    g_urls.set(m1, _EncodeAmpsAndAngles(m2));  // Link IDs are case-insensitive
                    if (m4) {
                        // Oops, found blank lines, so it's not a title.
                        // Put back the parenthetical statement we stole.
                        return m3;
                    } else if (m5) {
                        g_titles.set(m1, m5.replace(/"/g, "&quot;"));
                    }

                    // Completely remove the definition from the text
                    return "";
                }
            );

public/vendor/pagedown/Markdown.Editor.js  view on Meta::CPAN

            return elapsedTime;
        };

        var isFirstTimeFilled = true;

        // IE doesn't let you use innerHTML if the element is contained somewhere in a table
        // (which is the case for inline editing) -- in that case, detach the element, set the
        // value, and reattach. Yes, that *is* ridiculous.
        var ieSafePreviewSet = function (text) {
            var preview = panels.preview;
            var parent = preview.parentNode;
            var sibling = preview.nextSibling;
            parent.removeChild(preview);
            preview.innerHTML = text;
            if (!sibling)
                parent.appendChild(preview);
            else
                parent.insertBefore(preview, sibling);
        }

        var nonSuckyBrowserPreviewSet = function (text) {
            panels.preview.innerHTML = text;
        }

        var previewSetter;

        var previewSet = function (text) {
            if (previewSetter)

public/vendor/pagedown/Markdown.Editor.js  view on Meta::CPAN

            if (isCancel) {
                text = null;
            }
            else {
                // Fixes common pasting errors.
                text = text.replace(/^http:\/\/(https?|ftp):\/\//, '$1://');
                if (!/^(?:https?|ftp):\/\//.test(text))
                    text = 'http://' + text;
            }

            dialog.parentNode.removeChild(dialog);

            callback(text);
            return false;
        };



        // Create the text input box form/window.
        var createDialog = function () {

public/vendor/pagedown/Markdown.Editor.js  view on Meta::CPAN


            if (/\n\n/.test(chunk.selection)) {
                this.addLinkDef(chunk, null);
                return;
            }
            var that = this;
            // The function to be executed when you enter a link and press OK or Cancel.
            // Marks up the link and adds the ref.
            var linkEnteredCallback = function (link) {

                background.parentNode.removeChild(background);

                if (link !== null) {
                    // (                          $1
                    //     [^\\]                  anything that's not a backslash
                    //     (?:\\\\)*              an even number (this includes zero) of backslashes
                    // )
                    // (?=                        followed by
                    //     [[\]]                  an opening or closing bracket
                    // )
                    //



( run in 0.430 second using v1.01-cache-2.11-cpan-4d50c553e7e )