mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
add ability to disable site profile
This commit is contained in:
parent
31c7b7637a
commit
83756af770
4 changed files with 13 additions and 4 deletions
|
@ -51,7 +51,8 @@ post '/settings/:username/profile' do
|
||||||
require_ownership_for_settings
|
require_ownership_for_settings
|
||||||
|
|
||||||
@site.update(
|
@site.update(
|
||||||
profile_comments_enabled: params[:site][:profile_comments_enabled]
|
profile_comments_enabled: params[:site][:profile_comments_enabled],
|
||||||
|
profile_enabled: params[:site][:profile_enabled]
|
||||||
)
|
)
|
||||||
flash[:success] = 'Profile settings changed.'
|
flash[:success] = 'Profile settings changed.'
|
||||||
redirect "/settings/#{@site.username}#profile"
|
redirect "/settings/#{@site.username}#profile"
|
||||||
|
|
|
@ -11,6 +11,8 @@ get '/site/:username/?' do |username|
|
||||||
|
|
||||||
redirect '/' if site.is_education
|
redirect '/' if site.is_education
|
||||||
|
|
||||||
|
redirect site.uri unless site.profile_enabled
|
||||||
|
|
||||||
@title = site.title
|
@title = site.title
|
||||||
|
|
||||||
@page = params[:page]
|
@page = params[:page]
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<li class="active"><a href="#profile" data-toggle="tab">Profile</a></li>
|
<li class="active"><a href="#profile" data-toggle="tab">Profile</a></li>
|
||||||
<!-- <li><a href="#domain" data-toggle="tab">Domain Name</a></li> -->
|
<!-- <li><a href="#domain" data-toggle="tab">Domain Name</a></li> -->
|
||||||
<li><a href="#custom_domain" data-toggle="tab">Custom Domain</a></li>
|
<li><a href="#custom_domain" data-toggle="tab">Custom Domain</a></li>
|
||||||
<li><a href="#username" data-toggle="tab">Change Site (User) Name</a></li>
|
<li><a href="#username" data-toggle="tab">Change Site Name</a></li>
|
||||||
<li><a href="#tipping" data-toggle="tab">Tipping</a></li>
|
<li><a href="#tipping" data-toggle="tab">Tipping</a></li>
|
||||||
|
|
||||||
<li><a href="#api_key" data-toggle="tab">API Key</a></li>
|
<li><a href="#api_key" data-toggle="tab">API Key</a></li>
|
||||||
|
|
|
@ -6,9 +6,15 @@
|
||||||
<input name="site[profile_comments_enabled]" type="hidden" value="true">
|
<input name="site[profile_comments_enabled]" type="hidden" value="true">
|
||||||
<input name="site[profile_comments_enabled]" type="checkbox" value="false"
|
<input name="site[profile_comments_enabled]" type="checkbox" value="false"
|
||||||
<% if @site.profile_comments_enabled == false %>checked<% end %>
|
<% if @site.profile_comments_enabled == false %>checked<% end %>
|
||||||
> Turn off profile comments
|
> Disable Site Profile Comments
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<input name="site[profile_enabled]" type="hidden" value="true">
|
||||||
|
<input name="site[profile_enabled]" type="checkbox" value="false"
|
||||||
|
<% if @site.profile_enabled == false %>checked<% end %>
|
||||||
|
> Disable Site Profile
|
||||||
|
</p>
|
||||||
<input class="btn-Action" type="submit" value="Update Site Profile Settings">
|
<input class="btn-Action" type="submit" value="Update Site Profile Settings">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
Loading…
Add table
Reference in a new issue