Calguys Feedback Module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
Cyc
Forum Members
Forum Members
Posts: 78
Joined: Wed Nov 18, 2015 11:54 pm
Location: Poland

Calguys Feedback Module

Post by Cyc »

Hello everyone! In http://szablon.compsoul.pl/airflo/lisea ... at-eu.html I have two diffrent feedback module instance (like a rapper) and when I add comment, module replace first smarty instance, in this case rating module. When I change inline options, module redirect all website to another page. I want to set module behaviour like that: When I send grade, rating module disappears and I have message with information about sending grade, but when I add comment, form fade out and I have diffrent message.

My templates:

Form for adding comments:

Code: Select all

<article class="comments-form">
  <h2 class="comments-heading heading row" data-comment="{if $compsoulTotalMatches == 0}Brak komentarzy{else if}{$compsoulTotalMatches} {if $compsoulTotalMatches > 4}komentarzy{else if $compsoulTotalMatches == 1}komentarz{else if $compsoulTotalMatches == 2 ||  $compsoulTotalMatches == 3 || $compsoulTotalMatches == 4}komentarze{/if}{/if}">Komentarze</h2>
  {if isset($message)}
  <aside class="comment-message">{$message}</aside>
  {else}
  {if isset($error)}
  <aside class="comment-error">
    {$error}
  </aside> 
  {/if}
  {form_start action=default inline=$inline extraparms=$extraparms}
    {cge_form_csrf}
    <input type="text" name="{$actionid}feedback__data" value="" class="hidden">
    <fieldset class="comment-input-text placeholder icon">
      <input type="text" id="{$actionid}author_name" name="{$actionid}author_name" placeholder="dołącz do dyskusji" value="{$comment_obj->author_name}">
      <label for="{$actionid}author_name">Twoja nazwa</label>
    </fieldset>
    <fieldset class="comment-input-text placeholder icon">
      <input type="email" id="{$actionid}author_email" name="{$actionid}author_email" placeholder="twój email" value="{$comment_obj->author_email}">
      <label for="{$actionid}author_email">Twój email</label>
    </fieldset>
    <fieldset class="comment-textarea placeholder icon">
      <textarea id="{$actionid}comment" name="{$actionid}comment" placeholder="komentarz" required>{if $comment_obj->data}{$comment_obj->data}{/if}</textarea>
      <label for="{$actionid}comment">Komentarz</label>
    </fieldset>
    <div class="comment-footer row">
      <fieldset class="comment-checkbox col">
        <input type="checkbox" class="hidden" id="{$actionid}author_notify" name="{$actionid}author_notify" value="1" {if $comment_obj->author_notify == 1}checked{/if}>
        <label class="icon" for="{$actionid}author_notify">Powiadom mnie jeżeli ktoś inny doda komentarz</label>
      </fieldset>
      <div class="col">
        <button class="comment-button button" name="{$actionid}cgfb_submit" type="submit">Dodaj komentarz</button>
      </div>
    </div>
  {form_end}
  {/if}
</article>
Rating form:

Code: Select all

<aside class="ratings">
  <div class="container">
  {if isset($message)}
    <div class="rating-message">{$message}</div>
  {else}
    {if isset($error)}<div class="rating-error">{$error}</div>{/if}
    {form_start action=default inline=$inline extraparms=$extraparms}
      {cge_form_csrf}
      <fieldset class="rating-content row">
        <h3 class="col">Oceń artykuł:</h3>
        <div class="rating-radio col">
          <input class="hidden" type="radio" id="{$actionid}rating-first" name="{$actionid}rating" value="1"{if $compsoulStatsAvg >= 1 && $compsoulStatsAvg < 1.5} checked{/if}>
          <label class="icon" for="{$actionid}rating-first"><span class="hidden">Bardzo źle.</span></label>
          <input class="hidden" type="radio" id="{$actionid}rating-second" name="{$actionid}rating" value="2"{if $compsoulStatsAvg >= 1.5 && $compsoulStatsAvg < 2.5} checked{/if}>
          <label class="icon" for="{$actionid}rating-second"><span class="hidden">Źle.</span></label>
          <input class="hidden" type="radio" id="{$actionid}rating-third" name="{$actionid}rating" value="3"{if $compsoulStatsAvg >= 2.5 && $compsoulStatsAvg < 3.5} checked{/if}>
          <label class="icon" for="{$actionid}rating-third"><span class="hidden">Dobrze.</span></label>
          <input class="hidden" type="radio" id="{$actionid}rating-fourth" name="{$actionid}rating" value="4"{if $compsoulStatsAvg >= 3.5 && $compsoulStatsAvg < 4.5} checked{/if}>
          <label class="icon" for="{$actionid}rating-fourth"><span class="hidden">Bardzo dobrze.</span></label>
          <input class="hidden" type="radio" id="{$actionid}rating-fifth" name="{$actionid}rating" value="5"{if $compsoulStatsAvg >= 4.5} checked{/if}>
          <label class="icon" for="{$actionid}rating-fifth"><span class="hidden">Świetnie!</span></label> 
        </div>
        <button class="rating-button icon col" name="{$actionid}cgfb_submit">dodaj ocenę</button>
      </fieldset>
    {form_end}
  {/if}
  </div>
</aside>
I need $stats.avg when I create comments module:

Code: Select all

{$compsoulStatsAvg=$stats.avg scope=global}
Comments list:

Code: Select all

{if $total_matches}
<article class="comments-container">
  <h2 class="hidden comment-heading">Komentarze</h2>
  {foreach $comments as $one}
  <article class="comment">
    <header class="comment-header row">
      <h3 class="comment-heading col">{if $one->author_name}{$one->author_name}{else}Nieznany{/if}</h3>
      <time class="comment-time col" datetime="{$item->modified_time|date_format:"%Y-%m-%d"}">{$item->modified_time|date_format:"%e %B %Y"}</time>
    </header>
    <div class="comment-content content">{$one->data|cms_html_entity_decode}</div>
    <footer class="comment-footer">
      <button class="comment-reply more" data-reply="{if $one->author_name}{$one->author_name}{else}Nieznany{/if}">Odpowiedz</button>
    </footer>
  </article>
  {/foreach}
</article>
{/if}
I need a total number of all comments for the HTML template.

Code: Select all

{$compsoulTotalMatches=$total_matches scope=global}
Instances:

Ratings:

Code: Select all

{if $item->fielddefs.ratings.value}
  {CGFeedback key1="rating" key2="rating-{$item->item_id}" action="ratings" ratingstemplate="Template - Feedback rating avg"}
  {CGFeedback commenttemplate="Template - Feedback rating" key1="rating" key2="rating-{$item->item_id}"}
{/if}
Comments

Code: Select all

{if $item->fielddefs.comments.value}
{CGFeedback key1="article" key2="{$item->item_id}" action="summary" summarytemplate="Template - Feedback total"}
<section class="comments">
  <div class="container">
    <h2 class="hidden">Komentarze</h2>
    {CGFeedback key1="article" key2="{$item->item_id}"}
    {CGFeedback key1="article" key2="{$item->item_id}" action="summary"}
  </div>
</section>
{/if}
User avatar
Cyc
Forum Members
Forum Members
Posts: 78
Joined: Wed Nov 18, 2015 11:54 pm
Location: Poland

Re: Calguys Feedback Module

Post by Cyc »

Someone Can help me with that?
Post Reply

Return to “Modules/Add-Ons”