Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2011 10:28:27 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Move New Topic creation form to bottom of forums directory to match UX in group forum. (This may not make it for final release, but worth testing.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/forums/index.php

    r3828 r3924  
    1717        <div class="padder">
    1818
    19         <?php do_action( 'bp_before_directory_forums' ); ?>
     19            <?php do_action( 'bp_before_directory_forums' ); ?>
    2020
    21         <form action="" method="post" id="forums-search-form" class="dir-form">
     21            <form action="" method="post" id="forums-search-form" class="dir-form">
    2222
    23             <h3><?php _e( 'Group Forums Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() ) : ?> &nbsp;<a class="button" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'buddypress' ); ?></a><?php endif; ?></h3>
     23                <h3><?php _e( 'Group Forums Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() ) : ?> &nbsp;<a class="button" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'buddypress' ); ?></a><?php endif; ?></h3>
    2424
    25             <div id="forums-dir-search" class="dir-search" role="search">
     25                <div id="forums-dir-search" class="dir-search" role="search">
    2626
    27                 <?php bp_directory_forums_search_form(); ?>
     27                    <?php bp_directory_forums_search_form(); ?>
    2828
    29             </div>
    30         </form>
     29                </div>
     30            </form>
    3131
    32         <?php do_action( 'bp_before_new_topic_form' ); ?>
     32            <?php do_action( 'bp_before_topics' ); ?>
    3333
    34         <div id="new-topic-post" style="display: none;">
     34            <form action="" method="post" id="forums-directory-form" class="dir-form">
    3535
    36             <?php if ( is_user_logged_in() ) : ?>
     36                <div class="item-list-tabs" role="navigation">
     37                    <ul>
     38                        <li class="selected" id="forums-all"><a href="<?php bp_root_domain(); ?>"><?php printf( __( 'All Topics (%s)', 'buddypress' ), bp_get_forum_topic_count() ); ?></a></li>
    3739
    38                 <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?>
     40                        <?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?>
    3941
    40                     <form action="" method="post" id="forum-topic-form" class="standard-form">
     42                            <li id="forums-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ); ?>"><?php printf( __( 'My Topics (%s)', 'buddypress' ), bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
    4143
    42                         <?php do_action( 'groups_forum_new_topic_before' ) ?>
     44                        <?php endif; ?>
    4345
    44                         <a name="post-new"></a>
    45                         <h5><?php _e( 'Post a New Topic:', 'buddypress' ); ?></h5>
     46                        <?php do_action( 'bp_forums_directory_group_types' ); ?>
    4647
    47                         <label><?php _e( 'Title:', 'buddypress' ); ?></label>
    48                         <input type="text" name="topic_title" id="topic_title" value="" />
     48                    </ul>
     49                </div>
    4950
    50                         <label><?php _e( 'Content:', 'buddypress' ); ?></label>
    51                         <textarea name="topic_text" id="topic_text"></textarea>
     51                <div class="item-list-tabs" id="subnav" role="navigation">
     52                    <ul>
    5253
    53                         <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
    54                         <input type="text" name="topic_tags" id="topic_tags" value="" />
     54                        <?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
    5555
    56                         <label><?php _e( 'Post In Group Forum:', 'buddypress' ); ?></label>
    57                         <select id="topic_group_id" name="topic_group_id">
     56                        <li id="forums-order-select" class="last filter">
    5857
    59                             <option value="">----</option>
     58                            <?php _e( 'Order By:', 'buddypress' ); ?>
    6059
    61                             <?php while ( bp_groups() ) : bp_the_group(); ?>
     60                            <select>
     61                                <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     62                                <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
     63                                <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
    6264
    63                                 <?php if ( bp_group_is_forum_enabled() && 'public' == bp_get_group_status() ) : ?>
     65                                <?php do_action( 'bp_forums_directory_order_options' ); ?>
    6466
    65                                     <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
     67                            </select>
     68                        </li>
     69                    </ul>
     70                </div>
    6671
    67                                 <?php endif; ?>
     72                <?php do_action( 'bp_before_directory_forums_list' ); ?>
    6873
    69                             <?php endwhile; ?>
     74                <div id="forums-dir-list" class="forums dir-list" role="main">
    7075
    71                         </select><!-- #topic_group_id -->
     76                    <?php locate_template( array( 'forums/forums-loop.php' ), true ); ?>
    7277
    73                         <?php do_action( 'groups_forum_new_topic_after' ); ?>
     78                </div>
    7479
    75                         <div class="submit">
    76                             <input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" />
    77                             <input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ); ?>" />
     80                <?php do_action( 'bp_directory_forums_content' ); ?>
     81
     82                <?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ); ?>
     83
     84            </form>
     85
     86            <?php do_action( 'bp_after_directory_forums' ); ?>
     87
     88            <?php do_action( 'bp_before_new_topic_form' ); ?>
     89
     90            <div id="new-topic-post" style="display: none;">
     91
     92                <?php if ( is_user_logged_in() ) : ?>
     93
     94                    <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?>
     95
     96                        <form action="" method="post" id="forum-topic-form" class="standard-form">
     97
     98                            <?php do_action( 'groups_forum_new_topic_before' ) ?>
     99
     100                            <a name="post-new"></a>
     101                            <h5><?php _e( 'Post a New Topic:', 'buddypress' ); ?></h5>
     102
     103                            <label><?php _e( 'Title:', 'buddypress' ); ?></label>
     104                            <input type="text" name="topic_title" id="topic_title" value="" />
     105
     106                            <label><?php _e( 'Content:', 'buddypress' ); ?></label>
     107                            <textarea name="topic_text" id="topic_text"></textarea>
     108
     109                            <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
     110                            <input type="text" name="topic_tags" id="topic_tags" value="" />
     111
     112                            <label><?php _e( 'Post In Group Forum:', 'buddypress' ); ?></label>
     113                            <select id="topic_group_id" name="topic_group_id">
     114
     115                                <option value="">----</option>
     116
     117                                <?php while ( bp_groups() ) : bp_the_group(); ?>
     118
     119                                    <?php if ( bp_group_is_forum_enabled() && 'public' == bp_get_group_status() ) : ?>
     120
     121                                        <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
     122
     123                                    <?php endif; ?>
     124
     125                                <?php endwhile; ?>
     126
     127                            </select><!-- #topic_group_id -->
     128
     129                            <?php do_action( 'groups_forum_new_topic_after' ); ?>
     130
     131                            <div class="submit">
     132                                <input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" />
     133                                <input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ); ?>" />
     134                            </div>
     135
     136                            <?php wp_nonce_field( 'bp_forums_new_topic' ); ?>
     137
     138                        </form><!-- #forum-topic-form -->
     139
     140                    <?php else : ?>
     141
     142                        <div id="message" class="info">
     143
     144                            <p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'buddypress' ), site_url( BP_GROUPS_SLUG . '/create/' ) ) ?></p>
     145
    78146                        </div>
    79 
    80                         <?php wp_nonce_field( 'bp_forums_new_topic' ); ?>
    81 
    82                     </form><!-- #forum-topic-form -->
    83 
    84                 <?php else : ?>
    85 
    86                     <div id="message" class="info">
    87 
    88                         <p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'buddypress' ), site_url( BP_GROUPS_SLUG . '/create/' ) ) ?></p>
    89 
    90                     </div>
    91 
    92                 <?php endif; ?>
    93 
    94             <?php endif; ?>
    95         </div><!-- #new-topic-post -->
    96 
    97         <?php do_action( 'bp_before_topics' ); ?>
    98 
    99         <form action="" method="post" id="forums-directory-form" class="dir-form">
    100 
    101             <div class="item-list-tabs" role="navigation">
    102                 <ul>
    103                     <li class="selected" id="forums-all"><a href="<?php bp_root_domain(); ?>"><?php printf( __( 'All Topics (%s)', 'buddypress' ), bp_get_forum_topic_count() ); ?></a></li>
    104 
    105                     <?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?>
    106 
    107                         <li id="forums-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ); ?>"><?php printf( __( 'My Topics (%s)', 'buddypress' ), bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
    108147
    109148                    <?php endif; ?>
    110149
    111                     <?php do_action( 'bp_forums_directory_group_types' ); ?>
    112 
    113                 </ul>
    114             </div>
    115 
    116             <div class="item-list-tabs" id="subnav" role="navigation">
    117                 <ul>
    118 
    119                     <?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
    120 
    121                     <li id="forums-order-select" class="last filter">
    122 
    123                         <?php _e( 'Order By:', 'buddypress' ); ?>
    124 
    125                         <select>
    126                             <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
    127                             <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
    128                             <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
    129 
    130                             <?php do_action( 'bp_forums_directory_order_options' ); ?>
    131 
    132                         </select>
    133                     </li>
    134                 </ul>
    135             </div>
    136 
    137             <?php do_action( 'bp_before_directory_forums_list' ); ?>
    138 
    139             <div id="forums-dir-list" class="forums dir-list" role="main">
    140 
    141                 <?php locate_template( array( 'forums/forums-loop.php' ), true ); ?>
    142 
    143             </div>
    144 
    145             <?php do_action( 'bp_directory_forums_content' ); ?>
    146 
    147             <?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ); ?>
    148 
    149         </form>
    150 
    151         <?php do_action( 'bp_after_directory_forums' ); ?>
    152 
     150                <?php endif; ?>
     151            </div><!-- #new-topic-post -->
    153152        </div><!-- .padder -->
    154153    </div><!-- #content -->
Note: See TracChangeset for help on using the changeset viewer.