[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-templates/ -> project.php (source)

   1  <?php
   2  gp_title( sprintf( __('%s &lt; GlotPress'), esc_html( $project->name ) ) );
   3  gp_breadcrumb_project( $project );
   4  wp_enqueue_script( 'common' );
   5  $edit_link = gp_link_project_edit_get( $project, '(edit)' );
   6  $parity = gp_parity_factory();
   7  if ( $project->active ) add_filter( 'gp_breadcrumb', lambda( '$s', '$s . "<span class=\\"active bubble\\">Active</span>"' ) );
   8  gp_tmpl_header();
   9  ?>
  10  <h2><?php echo esc_html( $project->name ); ?> <?php echo $edit_link; ?></h2>
  11  <p class="description">
  12      <?php echo $project->description; ?>
  13  </p>
  14  
  15  <?php if ( $can_write ): ?>
  16  
  17  <div class="actionlist">
  18      <a href="#" class="project-actions" id="project-actions-toggle"><?php _e('Project actions &darr;'); ?></a>
  19      <div class="project-actions hide-if-js">
  20          <ul>
  21              <li><?php gp_link( gp_url_project( $project, 'import-originals' ), __( 'Import originals' ) ); ?></li>
  22              <li><?php gp_link( gp_url_project( $project, array( '-permissions' ) ), __('Permissions') ); ?></li>
  23              <li><?php gp_link( gp_url_project( '', '-new', array('parent_project_id' => $project->id) ), __('New Sub-Project') ); ?></li>
  24              <li><?php gp_link( gp_url( '/sets/-new', array( 'project_id' => $project->id ) ), __('New Translation Set') ); ?></li>
  25              <li><?php gp_link( gp_url_project( $project, array( '-mass-create-sets' ) ), __('Mass-create Translation Sets') ); ?></li>
  26              <?php if ( $translation_sets ): ?>
  27              <li>
  28                  <a href="#" class="personal-options" id="personal-options-toggle"><?php _e('Personal project options &darr;'); ?></a>
  29                  <div class="personal-options">
  30                      <form action="<?php echo gp_url_project( $project, '-personal' ); ?>" method="post">
  31                      <dl>
  32                          <dt><label for="source-url-template"><?php _e('Source file URL');  ?></label></dt>
  33                          <dd>
  34                              <input type="text" value="<?php echo esc_html( $project->source_url_template() ); ?>" name="source-url-template" id="source-url-template" />
  35                              <small><?php _e('URL to a source file in the project. You can use <code>%file%</code> and <code>%line%</code>. Ex. <code>http://trac.example.org/browser/%file%#L%line%</code>'); ?></small>
  36                          </dd>
  37                      </dl>
  38                      <p>
  39                          <input type="submit" name="submit" value="<?php echo esc_attr(__('Save &rarr;')); ?>" id="save" />
  40                          <a class="ternary" href="#" onclick="jQuery('#personal-options-toggle').click();return false;"><?php _e('Cancel'); ?></a>
  41                      </p>        
  42                      </form>
  43                  </div>
  44              </li>
  45          <?php endif; ?>
  46          </ul>
  47      </div>
  48  </div>
  49  <?php endif; ?>
  50  
  51  
  52  <?php if ($sub_projects): ?>
  53  <div id="sub-projects">
  54  <h3><?php _e('Sub-projects'); ?></h3>
  55  <dl>
  56  <?php foreach($sub_projects as $sub_project): ?>
  57      <dt>
  58          <?php gp_link_project( $sub_project, esc_html( $sub_project->name ) ); ?>
  59          <?php gp_link_project_edit( $sub_project, null, array( 'class' => 'bubble' ) ); ?>
  60          <?php if ( $sub_project->active ) echo "<span class='active bubble'>Active</span>"; ?>
  61      </dt>
  62      <dd>
  63          <?php echo esc_html( gp_html_excerpt( $sub_project->description, 111 ) ); ?>
  64      </dd>
  65  <?php endforeach; ?>
  66  </dl>
  67  </div>
  68  <?php endif; ?>
  69  
  70  <?php if ( $translation_sets ): ?>
  71  <div id="translation-sets">
  72      <h3>Translations</h3>
  73      <table class="translation-sets">
  74          <thead>
  75              <tr>
  76                  <th><?php _e( 'Language' ); ?></th>
  77                  <th><?php echo _x( '%', 'language translation percent header' ); ?></th>
  78                  <th><?php _e( 'Translated' ); ?></th>
  79                  <th><?php _e( 'Untranslated' ); ?></th>
  80                  <th><?php _e( 'Waiting' ); ?></th>
  81                  <th><?php _e( 'Extra' ); ?></th>
  82              </tr>
  83          </thead>
  84          <tbody>
  85          <?php foreach( $translation_sets as $set ): ?>
  86              <tr class="<?php echo $parity(); ?>">
  87                  <td>
  88                      <strong><?php gp_link( gp_url_project( $project, gp_url_join( $set->locale, $set->slug ) ), $set->name_with_locale() ); ?></strong>
  89                      <?php if ($set->current_count >= $set->all_count * 0.9 ): ?>
  90                          <span class="bubble morethan90">90%+</span>
  91                      <?php endif; ?>
  92                  </td>
  93                  <td class="stats percent"><?php echo $set->percent_translated; ?></td>
  94                  <td class="stats translated" title="translated"><?php gp_link( gp_url_project( $project, gp_url_join( $set->locale, $set->slug ),
  95                              array('filters[translated]' => 'yes', 'filters[status]' => 'current') ), $set->current_count );; ?></td>
  96                  <td class="stats untranslated" title="untranslated"><?php gp_link( gp_url_project( $project, gp_url_join( $set->locale, $set->slug ),
  97                              array('filters[status]' => 'untranslated' ) ), $set->untranslated_count ); ?></td>
  98                  <td class="stats waiting"><?php gp_link( gp_url_project( $project, gp_url_join( $set->locale, $set->slug ),
  99                              array('filters[translated]' => 'yes', 'filters[status]' => 'waiting') ), $set->waiting_count ); ?></td>
 100                  <td>
 101                      <?php do_action( 'project_template_translation_set_extra', $set, $project ); ?>
 102                  </td>
 103              </tr>
 104          <?php endforeach; ?>
 105          </tbody>
 106      </table>
 107  </div>
 108  <?php elseif ( !$sub_projects ): ?>
 109      <p><?php _e('There are no translations of this project.'); ?></p>
 110  <?php endif; ?>
 111  <div class="clear"></div>
 112  
 113  
 114  <script type="text/javascript" charset="utf-8">
 115      $gp.showhide('a.personal-options', 'div.personal-options', {
 116          show_text: 'Personal project options &darr;',
 117          hide_text: 'Personal project options &uarr;',
 118          focus: '#source-url-template',
 119          group: 'personal'
 120      });
 121      $('div.personal-options').hide();
 122      $gp.showhide('a.project-actions', 'div.project-actions', {
 123          show_text: 'Project actions &darr;',
 124          hide_text: 'Project actions &uarr;',
 125          focus: '#source-url-template',
 126          group: 'project'
 127      });
 128  </script>
 129  <?php gp_tmpl_footer();


Generated: Thu May 24 03:59:35 2012 Hosted by follow the white rabbit.