Skip to content

Commit

Permalink
Merge pull request #135 from AresMUSH/dev
Browse files Browse the repository at this point in the history
Beta 103
  • Loading branch information
lynnfaraday authored Oct 3, 2021
2 parents bedc41f + 7aea3dd commit f2ec4c2
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 27 deletions.
27 changes: 22 additions & 5 deletions engine/styles/ares.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ body {
.markdown-editor {
padding: 0px;
margin-bottom: 5px;
border: 0px;
}

.markdown-preview {
Expand Down Expand Up @@ -299,6 +300,11 @@ td, .table th, .table td {
vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd),
.table-striped > tbody > tr:nth-of-type(even) {
color: $text-color;
}

textarea.pre {
font-family:Consolas,Monaco,Lucida Console,monospace;
}
Expand Down Expand Up @@ -513,6 +519,10 @@ BOOTSTRAP OVERRIDES
font-size: 1em;
}

.btn-primary a {
color: $primary-words-color;
}

.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
background-color: $primary-color;
border-color: $primary-color;
Expand Down Expand Up @@ -564,6 +574,10 @@ mark {
margin-bottom: 1rem;
}

.modal-dialog {
max-width: 650px;
}

/* -------------------------
GOOGLE SEARCH OVERRIDES
------------------------- */
Expand Down Expand Up @@ -1346,11 +1360,14 @@ CHARACTERS SCREEN
------------------------- */

.profile-gallery {
display: inline-block;
padding-left: 10px;
padding-right: 10px;
width: 150px;

display: flex;
flex-direction: row;
flex-wrap: wrap;
}

.profile-gallery img {
padding: 10px;
width: 150px;
}

.profile-gallery-input textarea {
Expand Down
10 changes: 5 additions & 5 deletions plugins/forum/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def self.post(category_name, subject, message, author, client = nil)
author: {name: author_name, icon: Website.icon_for_char(author), id: author.id},
subject: subject,
message: Website.format_markdown_for_html(message),
raw_message: message,
raw_message: Website.format_input_for_html(message),
type: 'new_forum_post'
}
Forum.notify(new_post, category, :new_forum_post, message, data)
Expand Down Expand Up @@ -130,7 +130,7 @@ def self.reply(category, post, author, reply, client = nil)
author: { name: author.name, icon: Website.icon_for_char(author), id: author.id },
subject: post.subject,
message: Website.format_markdown_for_html(reply),
raw_message: reply,
raw_message: Website.format_input_for_html(reply),
type: 'forum_reply'
}

Expand Down Expand Up @@ -256,7 +256,7 @@ def self.edit_post(post, enactor, subject, message)
author: {name: enactor.name, icon: Website.icon_for_char(enactor), id: enactor.id},
subject: post.subject,
message: Website.format_markdown_for_html(message),
raw_message: message,
raw_message: Website.format_input_for_html(message),
tags: post.content_tags,
type: 'forum_edited'
}
Expand All @@ -283,7 +283,7 @@ def self.edit_reply(reply, enactor, message)
subject: post.subject,
author: {name: enactor.name, icon: Website.icon_for_char(enactor), id: enactor.id},
message: Website.format_markdown_for_html(message),
raw_message: message,
raw_message: Website.format_input_for_html(message),
type: 'reply_edited'
}

Expand Down Expand Up @@ -319,7 +319,7 @@ def self.get_authorable_chars(char, category)
end

def self.update_tags(post)
hashtags = (post.message || "").scan(/\s#\S+/).map { |t| t.after('#') }
hashtags = (post.message || "").scan(/\s#[^#]\S+/).map { |t| t.after('#') }
Website.update_tags(post, hashtags)
end
end
Expand Down
4 changes: 2 additions & 2 deletions plugins/forum/web/forum_topic_request_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def handle(request)
name: r.author_name,
icon: r.author ? Website.icon_for_char(r.author) : nil },
message: Website.format_markdown_for_html(r.message),
raw_message: r.message,
raw_message: Website.format_input_for_html(r.message),
date: r.created_date_str(enactor),
can_edit: Forum.can_edit_post?(enactor, r)
}
Expand All @@ -56,7 +56,7 @@ def handle(request)
name: topic.author_name,
icon: topic.author ? Website.icon_for_char(topic.author) : nil },
message: Website.format_markdown_for_html(topic.message),
raw_message: topic.message,
raw_message: Website.format_input_for_html(topic.message),
replies: replies,
can_reply: Forum.can_write_to_category?(enactor, category),
can_edit: Forum.can_edit_post?(enactor, topic),
Expand Down
2 changes: 1 addition & 1 deletion plugins/fs3skills/web/skill_scan_request_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def group_levels(groups, levels)
everybody[name] = {}
levels.times.each do |lvl|
everybody[name][lvl + 1] = skills
.select { |s| s.character && s.character.is_approved? && s.rating == lvl + 1}
.select { |s| s.character && s.character.is_approved? && s.character.is_active? && s.rating == lvl + 1}
.map { |s| s.character.name }
end
end
Expand Down
1 change: 1 addition & 0 deletions plugins/manage/help/en/community_contribs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ summary: Using community-contributed plugins and themes.
aliases:
- extras
- contribs
- theme
---
# Community Contributions

Expand Down
6 changes: 6 additions & 0 deletions plugins/rooms/events/char_disconnected_event_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ def on_event(event)
client = event.client
char = Character[event.char_id]
if (char.is_guest?)

# This has nothing to do with rooms, but there's no better place to put it.
char.screen_reader = false
char.fansi_on = true
char.color_mode = "FANSI"

Rooms.move_to(client, char, Game.master.welcome_room)
end
end
Expand Down
2 changes: 1 addition & 1 deletion plugins/scenes/helpers/permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def self.can_read_scene?(actor, scene)
def self.can_edit_scene?(actor, scene)
return false if !actor
return true if scene.owner == actor
if (scene.shared)
if (scene.shared || !scene.is_private?)
return true if Scenes.can_manage_scenes?(actor)
end
Scenes.has_alt_in_scene?(actor, scene)
Expand Down
2 changes: 1 addition & 1 deletion plugins/scenes/locales/locale_en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ en:
scene_ending: "%{name} has stopped this scene."
scene_ending_public: "%{name} has stopped this scene. You can restart it at any time, but it will restart in a temp room and NOT in this room."
scene_stopped: "The scene has ended. To share the log, set the scene info (help scene info) and then use `scene/share %{id}` to share it."
scene_not_specified: "You must either be in a room with an active scene, or specifiy a scene number for this command."
scene_not_specified: "You must either be in a room with an active scene, or specify a scene number for this command."
scene_not_found: "Scene not found."
pose_added: "Pose added to scene."
invalid_privacy: "Invalid privacy setting. Please use 'open' or 'private'."
Expand Down
10 changes: 7 additions & 3 deletions plugins/website/help/en/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ You can include a tab view with multiple tab selections.
`[[/tab]]`
`[[/tabview]]`

## Templates and Includes
## Includes

If you have a common snippet that you want to use in multiple places, you can put it into a wiki page of its own and then include it in other pages with the include tag.

Expand All @@ -156,7 +156,11 @@ In the page, `%{foo}` will be replaced with "Foo Value". Be sure to separate th

Tip: If the page you're including has an actual % in it, you'll need to format it as two percents (%%) otherwise the variable processing will get confused.

You can also create templates containing starter text for various kinds of pages. See [Wiki Tutorial](/help/wiki) for more information.
## Templates

Templates are basically starter text for a blank wiki page, so you can prompt players to fill in the necessary fields. You can create templates for wiki pages by naming the page `template:<name>`.

Note: Updating a template does not affect existing pages; it just gives different starter text the next time someone tries to use that template.

## Table of Contents

Expand All @@ -180,7 +184,7 @@ You can add a button that takes you to the "create wiki page" page, with the abi

Separate parameters with a "|". All parameters are optional. Possible values include:

* Template - name of the wiki template to use. (default is 'blank')
* Template - name of the wiki template to use. (default is 'blank') Use just the base name of the template, not including the "template:" prefix.
* Category - a category value that will be prepended to the page name like "category:name". (default is no category)
* Button - text to put on the button. (default is "Create Page")
* Tags - Space-separated list of tags you want to add to the page.
Expand Down
3 changes: 2 additions & 1 deletion plugins/website/helpers/general.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ def self.webportal_version
def self.wiki_templates
templates = WikiPage.all.select { |p| p.category == "template" }.map { |p| {
title: p.title.gsub("template:", ""),
name: p.name.gsub("template:", ""),
text: p.text
}
}
templates << { title: 'blank', text: '' }
templates << { title: 'blank', name: 'blank', text: '' }
templates
end

Expand Down
2 changes: 1 addition & 1 deletion plugins/website/locales/locale_en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ en:
max_folder_size_kb: "Max folder size is %{kb}."
config_error: "There was a problem loading your config YAML for %{file}. See http://aresmush.com/tutorials for troubleshooting help: %{error}"
tinker_error: "There was a problem with the tinker code: %{error}"
redeploying_website: "Redeploying web portal. This may take a couple minutes. You'll see a message when it's done."
redeploying_website: "Redeploying web portal. This may take a couple minutes. You'll see a message when it's done. NOTE! If you see nothing after about 5 minutes, you may need to restart your server."
portal_deployed: "Web portal deployed!%R%RBuild Output:%R%{output}%R%R'npm WARN' statements are OK. A successful deploy will end with a list of file sizes.%RDone!"
only_upload_images: "That is not a valid file format: %{extensions}."
file_uploaded: "%{name} uploaded."
Expand Down
2 changes: 1 addition & 1 deletion plugins/website/templates/create_wiki.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a href="/wiki/create{{query_str}}">
<div class="btn btn-default {{css}}">
<div class="btn btn-primary {{css}}">
{{button}}
</div>
</a>
2 changes: 1 addition & 1 deletion plugins/website/web/get_blank_wiki_page_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def handle(request)
end

templates = Website.wiki_templates
template = templates.select { |t| (t[:title]).strip == template_name }.first
template = templates.select { |t| (t[:name]).strip == template_name }.first

if (!category.blank?)
name = "#{category}:#{WikiPage.sanitize_page_name(title)}"
Expand Down
3 changes: 2 additions & 1 deletion plugins/website/wiki_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def self.build_scene_index(scenes)
#Global.logger.debug "Parsing scene #{s.id} #{s.title}"

filename = FilenameSanitizer.sanitize(s.title)
page_name = "#{s.icdate}-#{filename}.html"
clean_date = "#{s.icdate}".gsub("/", "-")
page_name = "#{clean_date}-#{filename}.html"
index[page_name] = {}
index[page_name][:title] = s.date_title
index[page_name][:summary] = s.summary
Expand Down
2 changes: 1 addition & 1 deletion plugins/website/wiki_markdown/collapsible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.parse(matches)

data = {
"button_text" => button_text,
"id" => SecureRandom.uuid.gsub('-','')
"id" => "col#{SecureRandom.uuid.gsub('-','')}"
}

template.render(data)
Expand Down
4 changes: 2 additions & 2 deletions plugins/website/wiki_markdown/plot_scene_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def self.parse(matches)
end

if (char)
matches = plot.sorted_scenes.select { |s| s.participants.include?(char) }
matches = plot.sorted_scenes.select { |s| s.shared & s.participants.include?(char) }
else
matches = plot.sorted_scenes.to_a
matches = plot.sorted_scenes.select { |s| s.shared }
end

Global.logger.debug("Plot scene list for plot=#{plot_id} char=#{char_name} matches=#{matches.count}")
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.102
0.103

0 comments on commit f2ec4c2

Please sign in to comment.