Jump to content

Luis

Members
  • Posts

    295
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by Luis

  1. Well, 90% of what i´m doing on the Mini is coding.

    For this workload the mini is just fine, i´m developing in Aptana Studio and in the background there running instances of Opera Browser, Mamp, Inet Radio and Mail.

    If I need to do some gfx I open Adobe Fireworks, at this point I notice the little Memory, so if I upgrade the memory to 8gb, I think everything would work perfect, but there is no need for me.

  2. I'm using the 2012 MacMini in the Office with an 27" Monitor.

    i5 with 4gb of RAM.

    If u choose the Mini, upgrade the RAM.

    Adobe suite is a bit slow on mine.

    But all in all i'm feeling contended with the Mini.

  3. good work Nico.

    I just tweaked the breacrumb for myself, I use the breadcrumb really often and so I moved it to the top.

    For those interested.

    Open the main.css in /templates-admin/styles

    Search #main

    add: margin-top:32px;

    Search nav

    add: margin-top:32px;

    Search #breadcrumb

    change: bottom:0px to top:0px;

    • Like 1
  4. Hi Folks,

    today we will learn how to set up a simple jquery plugin called calendario and fill events trough our admin backend.

    || ATTENTION ||

    Modern Browser needed

    First of all, we need the jquery plugin.

    Grab your copy here:

    http://tympanus.net/...alendar-plugin/

    Now create a new template file, lets call the file calendar.php

    In the next step we have to include all the needed files from the .zip package.

    You need the following .css files:

    calendar.css

    custom_2.css

    demo.css

    Just include them in the <head> </head> of your template file.

    Feel free to merge them together, so you could save some http connects.

    Now we need to include the needed javascript.

    Make sure you have included the latest jQuery library.

    Include the jquery.calendario.js and the modernizr.custom.63321.js right into the bottom of your template file.

    Save the calendar.php

    Now we will set up Processwire where the magic wil happen.

    We just need one new template.

    Create a new template called calendar.

    Assign the field headline to our template.

    Allow children to just use this template.

    Hit the save button.

    Now create a new Page as child of home and call it Calendar.

    Assign our calendar template to this page.

    Almost ready.

    Now we have to do some little scripting in our template file calendar.php

    Add this html markup to our calendar.php

    <div class="custom-calendar-wrap">
    <div id="custom-inner" class="custom-inner">
    <div class="custom-header clearfix">
     <nav>
    <span id="custom-prev" class="custom-prev"></span>
    <span id="custom-next" class="custom-next"></span>
     </nav>
     <h2 id="custom-month" class="custom-month"></h2>
     <h3 id="custom-year" class="custom-year"></h3>
    </div>
    <div id="calendar" class="fc-calendar-container"></div>
    </div>
    </div>
    

    Now we have to call the javascript function, to get the calendar running.

    Just put this snippet right under the included jquery.calendario.js

    <script type="text/javascript"
    $(function() {
    
    var transEndEventNames = {
     'WebkitTransition' : 'webkitTransitionend',
     'MozTransition' : 'transitionend',
     'OTransition' : 'oTransitionend',
     'msTransition' : 'MSTransitionend',
     'transition' : 'transitionend'
     },
     transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
     $wrapper = $( '#custom-inner' ),
     $calendar = $( '#calendar' ),
     cal = $calendar.calendario( {
     onDayClick : function( $el, $contentEl, dateProperties ) {
     if( $contentEl.length > 0 ) {
     showEvents( $contentEl, dateProperties );
     }
     },
     caldata : {
    <?= getEvents(); ?> // this is our function to grab our events
     },
     displayWeekAbbr : false
     } ),
     $month = $( '#custom-month' ).html( cal.getMonthName() ),
     $year = $( '#custom-year' ).html( cal.getYear() );
    $( '#custom-next' ).on( 'click', function() {
     cal.gotoNextMonth( updateMonthYear );
    } );
    $( '#custom-today' ).on( 'click', function() {
     cal.gotoNow( updateMonthYear );
    } );
    $( '#custom-prev' ).on( 'click', function() {
     cal.gotoPreviousMonth( updateMonthYear );
    } );
    function updateMonthYear() {
     $month.html( cal.getMonthName() );
     $year.html( cal.getYear() );
    }
    // just an example..
    function showEvents( $contentEl, dateProperties ) {
     hideEvents();
    
     var $events = $( '<div id="custom-content-reveal" class="custom-content-reveal"><h4>Termine am ' + dateProperties.day + '. ' + dateProperties.monthname + ' ' + dateProperties.year + '</h4></div>' ),
     $close = $( '<span class="custom-content-close"></span>' ).on( 'click', hideEvents );
     $events.append( $contentEl.html() , $close ).insertAfter( $wrapper );
    
     setTimeout( function() {
     $events.css( 'top', '0%' );
     }, 25 );
    }
    function hideEvents() {
     var $events = $( '#custom-content-reveal' );
     if( $events.length > 0 ) {
    
     $events.css( 'top', '100%' );
     Modernizr.csstransitions ? $events.on( transEndEventName, function() { $( this ).remove(); } ) : $events.remove();
     }
    }
    
    });
    </script>
    

    We are almost finished, but we are missing some very essential, have a look to our javascript.

    We are calling a function named getEvents()

    This function will grab our events and fire it right to our calendar.

    So here is the code:

    function getEvents()
    {
    $events = wire('pages')->get("/calendar/")->children();
    
    foreach ($events as $event)
    {
    echo "'$event->title' : '<span>$event->headline</span> ',";
    }
    }
    

    Put this snippet above the javascript includes.

    We will now create our first entry.

    Go back to the PW admin backend and create a Child of Calendar.

    Title and name need the Date on which the event has to be displayed.

    You have to form a date in this format: mm-dd-yyyy e.g. 12-27-2012.

    The headline field is our Event description.

    Hit the save button, go to your site and enjoy your event calendar.

    With a little coding you could extend the calendar to let it look like mine attached as screenshot.

    Hope this was useful to somebody. Cheerio.

    post-782-0-01494600-1356624995_thumb.jpg

    • Like 19
  5. Welcome aboard,

    For your safety, please take a moment to listen to this important message about safety on board.

    In preparation for departure, fasten your seat belt by placing the metal fitting into the buckle. For your comfort and safety, adjust the strap so it fits low and tight around your hips. To release your seat belt

    just lift the face plate of the buckle. As you know, turbulence is sometimes unexpected so we

    advise you to take a look at Somas Cheatsheet, you will find a copy under your seat (http://processwire.com/api/cheatsheet/)

    On behalf of all of us, we wish you a very pleasant flight. Thank you, for choosing ProcessWire.

    • Like 6
  6. As yesterday promised, the preview of the actual version.

    This Video shows the dependencies of the single modules.

    Dependencies of clients, invoices and accounting.

    Creating a client, creating a quotation assigned to this client, converting the quotation into an invoice, adding some invoice items and finally close the invoice and handle it over to the accounting module.

    https://youtu.be/WOUz3jfKOeM

    For those interested I attached a screenshot of the pagetree:

    post-782-0-73506400-1355818361_thumb.jpg

    • Like 1
  7. Hey Marc,

    How did you implemented the code?

    Sorry for the error, I didn´t tested the code just copy and pasted the snippet and edited it in the browser.

    Well my thoughts where the following:

    New Page called Albums. -> Status Hidden to exclude from search and nav.

    Children of Albums are the Password protected pages.

    New Template called Album. -> works as template for these children.

    Album template contains the following fields:

    password

    body

    images

    the template file should look something like this:

    <- Password / login code ->

    <- normal page code like head, foot and your assigned fields ->

    So you create a new child and enter your wished password in the assigned password field.

    After entering the password you should have access to the page.

  8. Did I understood right?

    1 Page with only a Password form?

    According to the password the user will be redirected to the common album?

    How secure has the login to be?

    I think the fastest way to achieve your needs would be a template with a input field -> site Password and the main content.

    In the Template file you could do something like this:

    <?php
    // check for login before outputting markup
    if($input->post->pass) {
    
     $pass = $input->post->pass;
     if($pass == $page->password_field) {
    		 // login successful
    		 $session->redirect($page->url);
     } else {
    		 $session->login_error = 'Please check your Password';
     }
    } ?>
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Login</title>
    </head>
    <body>
    <? if($input->post->pass) {
    	 echo "<div class='error'>				
    " . $session->login_error . "
    		 </div>";
    	 }?>		
    <form method="post" action="./" accept-charset="UTF-8">
    
    <input type="password" id="pass" name="pass" placeholder="Password" required />
    	 <button type="submit" name="submit" class="btn btn-success btn-block">Login</button>
    </form>
    
    </body>
    </html>
    <?
    die(); // don't go any further if not logged in
    } // end !logged in
    ?>
    
  9. create:

    new $user (example name: article_creater)

    new $role (for example creating_articles)

    give the user this role

    new template -> set permission to the new role and delete the others

    new page with the new template, set to hidden to exclude it from navs and search.

    create the template file for the template and look at this topic for login:

    http://processwire.com/talk/topic/107-custom-login/

    set the url after login to the same page

    look at this thread to generate content from frontend

    http://processwire.com/talk/topic/2174-writing-from-front-end-to-back-end/page__hl__login#entry20453

    hope could help you

  10. Hi soma,

    thank you :)

    Did you finally use the DataTable jQuery thingy?

    Yes, I´ve implemented the following: http://datatables.net/blog/Twitter_Bootstrap

    And you are right, lots of work ;)

    But the main part is already finished, as I mentioned in previously posts, I started to develop the app in PHP/MySQL., think round about 6 months ago before I discovered PW.

    I´m now just porting it to PW. So no more needs to think about the core functionality.

    Once i´ve finished I benefit from a deep insight into PW and know what could be done with PW.

    Well at this moment I don´t really know what couldn´t be done with PW :D

    • Like 1
×
×
  • Create New...